@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.31
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 +97 -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 +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -1
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +16 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +20 -0
- package/dist/components/ai/Reasoning/index.d.ts +2 -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/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +1 -3
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/index.d.ts +3 -0
- package/dist/components/ai/index.js +6 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/CanvasToolbar.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -2
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/AreaChart/AreaChart.js +21 -32
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +7 -19
- 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 +9 -28
- 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 +8 -5
- 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/LineRenderer.js +15 -10
- 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 +9 -26
- 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/ScatterPlot/ScatterPlot.js +5 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +14 -19
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +9 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +150 -132
- 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 +3 -0
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/index.js +6 -0
- 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/theme/chart.theme.js +18 -23
- 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.js +1 -3
- 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 +2 -2
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +2 -1
- package/dist/components/core/Alert/Alert.animations.js +21 -6
- package/dist/components/core/Alert/Alert.js +7 -7
- 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.js +4 -2
- package/dist/components/core/Badge/Badge.js +9 -4
- package/dist/components/core/Badge/Badge.theme.js +18 -12
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +2 -2
- package/dist/components/core/Button/Button.js +9 -17
- package/dist/components/core/Button/Button.ripple.js +2 -2
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +34 -21
- package/dist/components/core/Button/Button.types.d.ts +18 -1
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +14 -22
- 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/Card/Card.theme.js +12 -4
- package/dist/components/core/Card/CardBody.js +1 -1
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +1 -1
- package/dist/components/core/Carousel/CarouselNext.js +2 -2
- package/dist/components/core/Carousel/CarouselPrevious.js +2 -2
- 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/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- 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 +6 -4
- package/dist/components/core/Message/Message.js +2 -2
- package/dist/components/core/Message/Message.theme.js +5 -7
- 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.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +2 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -2
- package/dist/components/core/ModalStack/ModalStackModal.js +2 -2
- package/dist/components/core/NavItem/NavItem.js +6 -6
- 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 +25 -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 +3 -3
- package/dist/components/core/Pill/Pill.js +4 -2
- package/dist/components/core/Pill/Pill.theme.js +6 -4
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +9 -6
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarHeader.js +2 -2
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +3 -3
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +2 -2
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +4 -2
- 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/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/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 +1 -1
- 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/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -2
- package/dist/components/data-display/KPI/KPI.js +2 -2
- package/dist/components/data-display/KPI/KPI.theme.js +4 -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 +9 -9
- 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 -2
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +4 -4
- 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 +3 -3
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +2 -2
- 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/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +2 -2
- 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 +3 -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 +3 -3
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- 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 +5 -1
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- 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/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 +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +22 -23
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +12 -11
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +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 +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 +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +6 -7
- 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 +23 -12
- package/dist/components/forms/index.js +1 -1
- package/dist/components/generative/registry.js +195 -2
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2687 -379
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/generative.schema.json +2687 -379
- 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 +1 -1
- package/dist/registry.json +835 -261
- package/dist/shadcn-compat.css +1 -1
- package/dist/styles.css +1 -1
- 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/tools.json +2705 -361
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/package.json +9 -6
- package/src/global.scss +15 -4
- package/src/styles/theme.css +440 -152
- package/tailwind.preset.cjs +52 -34
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
|
@@ -5,7 +5,7 @@ import { commandPaletteTheme } from './CommandPalette.theme.js';
|
|
|
5
5
|
import { containerAnimations, overlayAnimations } from './CommandPalette.animations.js';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { useSurfaceElevation, SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
8
|
-
import {
|
|
8
|
+
import { MagnifyingGlass } from '@phosphor-icons/react';
|
|
9
9
|
import { CommandItem } from './CommandItem.js';
|
|
10
10
|
import { Overlay } from '../../effects/Overlay/Overlay.js';
|
|
11
11
|
import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
@@ -107,7 +107,7 @@ const findNextEnabledIndex = (currentIndex, direction, commands) => {
|
|
|
107
107
|
* />
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
const CommandPalette = React__default.forwardRef(({ isOpen, onClose, commands = [], placeholder = "Type a command or search...", emptyMessage = "No results found.", maxHeight = "400px", className = "", overlayClassName = "", theme: themeOverrides, grouped = false, onSearchChange, filterFunction = defaultFilterFunction, closeOnOverlayClick = true, closeOnEsc = true, footer, footerClassName, elevation, lift, }, ref) => {
|
|
110
|
+
const CommandPalette = React__default.forwardRef(({ isOpen, onClose, commands = [], placeholder = "Type a command or search...", emptyMessage = "No results found.", maxHeight = "400px", className = "", overlayClassName = "", theme: themeOverrides, grouped = false, onSearchChange, filterFunction = defaultFilterFunction, closeOnOverlayClick = true, closeOnEsc = true, footer, footerClassName, elevation, lift, onCommandSelect, }, ref) => {
|
|
111
111
|
// Grounded backdrop overlay: the palette covers the viewport over a backdrop, so it
|
|
112
112
|
// paints a FIXED rung 5 regardless of where its JSX sits. Content inside lifts relative.
|
|
113
113
|
const surfaceLevel = useSurfaceElevation({ baseRung: 5, ground: true, elevation, lift });
|
|
@@ -190,8 +190,9 @@ const CommandPalette = React__default.forwardRef(({ isOpen, onClose, commands =
|
|
|
190
190
|
if (command.disabled)
|
|
191
191
|
return;
|
|
192
192
|
command.onSelect();
|
|
193
|
+
onCommandSelect === null || onCommandSelect === void 0 ? void 0 : onCommandSelect(command.id);
|
|
193
194
|
onClose();
|
|
194
|
-
}, [onClose]);
|
|
195
|
+
}, [onClose, onCommandSelect]);
|
|
195
196
|
// Keep refs in sync for keydown handler to avoid re-attaching listener
|
|
196
197
|
const flatFilteredCommandsRef = useRef(flatFilteredCommands);
|
|
197
198
|
flatFilteredCommandsRef.current = flatFilteredCommands;
|
|
@@ -258,7 +259,7 @@ const CommandPalette = React__default.forwardRef(({ isOpen, onClose, commands =
|
|
|
258
259
|
return (jsx(Overlay, { ref: ref, isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "top", overlayClassName: cn(theme.overlay, overlayClassName), contentClassName: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: false }), theme.container, className), animations: {
|
|
259
260
|
overlay: overlayAnimations,
|
|
260
261
|
content: containerAnimations,
|
|
261
|
-
}, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [jsx("div", { className: theme.searchWrapper, children: jsxs("div", { className: "flex items-center gap-3", children: [jsx(
|
|
262
|
+
}, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [jsx("div", { className: theme.searchWrapper, children: jsxs("div", { className: "flex items-center gap-3", children: [jsx(MagnifyingGlass, { className: "w-5 h-5 text-[var(--color-text-muted)]", weight: "bold" }), jsx("input", { ref: searchInputRef, type: "text", className: theme.searchInput, placeholder: placeholder, value: searchValue, onChange: handleSearchChange, autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-label": "Search commands" })] }) }), jsx(ScrollArea, { ref: listContainerRef, type: "hover", className: "overscroll-contain px-1", style: {
|
|
262
263
|
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight,
|
|
263
264
|
}, children: jsx("div", { role: "listbox", "aria-label": "Commands", children: renderCommandsList() }) }), footer && (jsx("div", { className: cn(theme.footer, footerClassName), children: footer }))] }) }));
|
|
264
265
|
});
|
|
@@ -16,15 +16,11 @@ const commandPaletteTheme = {
|
|
|
16
16
|
searchWrapper: "border-b border-[var(--color-border)] px-4 py-3 " + "",
|
|
17
17
|
searchInput: "w-full px-0 py-0 text-sm bg-transparent border-none outline-none " +
|
|
18
18
|
"text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] " +
|
|
19
|
-
"focus:outline-none focus:ring-0
|
|
20
|
-
|
|
21
|
-
"dark:text-[var(--color-text-primary)] dark:placeholder:text-[var(--color-neutral-500)]",
|
|
22
|
-
groupLabel: "px-4 py-1 text-xs font-semibold text-[var(--color-text-muted)]/50 uppercase " +
|
|
23
|
-
"dark:text-[var(--color-neutral-500)]",
|
|
19
|
+
"focus:outline-none focus:ring-0",
|
|
20
|
+
groupLabel: "px-4 py-1 text-xs font-semibold text-[var(--color-text-muted)]/50 uppercase",
|
|
24
21
|
// Command rows render via the shared MenuItem primitive and use its default
|
|
25
22
|
// styling (subtle highlight + standard padding) — no per-row theme here.
|
|
26
|
-
emptyState: "px-4 py-12 text-center text-sm text-[var(--color-text-muted)]
|
|
27
|
-
"dark:text-[var(--color-neutral-500)]",
|
|
23
|
+
emptyState: "px-4 py-12 text-center text-sm text-[var(--color-text-muted)]",
|
|
28
24
|
footer: "border-t border-[var(--color-border)] px-4 py-2 text-xs text-[var(--color-text-muted)]font-medium",
|
|
29
25
|
};
|
|
30
26
|
|
|
@@ -79,6 +79,8 @@ export interface CommandPaletteProps {
|
|
|
79
79
|
elevation?: SurfaceElevation;
|
|
80
80
|
/** `false` opts out of the relative lift — paints at the palette's base rung. */
|
|
81
81
|
lift?: boolean;
|
|
82
|
+
/** Fired with the selected command's id, in addition to that command's own onSelect. */
|
|
83
|
+
onCommandSelect?: (id: string) => void;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Theme overrides for the CommandPalette component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useCallback } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Check } from '@phosphor-icons/react';
|
|
5
5
|
import { useContextMenuContext } from './ContextMenuContext.js';
|
|
6
6
|
import { MenuItem } from '../MenuItem/MenuItem.js';
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ const ContextMenuItem = React__default.forwardRef(({ children, className, checke
|
|
|
22
22
|
// with icon rows AND the label never shifts when toggled — a `size-4` spacer holds
|
|
23
23
|
// the gutter while unchecked.
|
|
24
24
|
const isCheckable = checked !== undefined;
|
|
25
|
-
const checkIndicator = isCheckable ? (checked ? (jsx(
|
|
25
|
+
const checkIndicator = isCheckable ? (checked ? (jsx(Check, { className: theme.itemCheckedStyle, "aria-hidden": "true" })) : (jsx("span", { className: "size-4 shrink-0", "aria-hidden": "true" }))) : null;
|
|
26
26
|
const resolvedStartContent = checkIndicator || startContent ? (jsxs(Fragment, { children: [checkIndicator, startContent] })) : undefined;
|
|
27
27
|
// Build end content: user's endContent OR shortcut display
|
|
28
28
|
const resolvedEndContent = endContent ||
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useRef, useCallback } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { CaretRight } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useContextMenuContext, useSubMenuContext } from './ContextMenuContext.js';
|
|
7
7
|
|
|
@@ -54,7 +54,7 @@ const ContextMenuSubTrigger = React__default.forwardRef(({ children, className,
|
|
|
54
54
|
ref.current = el;
|
|
55
55
|
}
|
|
56
56
|
}, [ref, triggerRef]);
|
|
57
|
-
return (jsxs("div", { ref: handleRef, role: "menuitem", "aria-haspopup": "true", "aria-expanded": isOpen, "aria-disabled": disabled, "data-state": isOpen ? "open" : "closed", "data-disabled": disabled, tabIndex: disabled ? undefined : -1, className: cn(theme.subTriggerStyle, theme.itemFocusStyle, className), onMouseEnter: handleMouseEnter, onKeyDown: handleKeyDown, ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsx("span", { className: "flex-1 truncate", children: children }), jsx(
|
|
57
|
+
return (jsxs("div", { ref: handleRef, role: "menuitem", "aria-haspopup": "true", "aria-expanded": isOpen, "aria-disabled": disabled, "data-state": isOpen ? "open" : "closed", "data-disabled": disabled, tabIndex: disabled ? undefined : -1, className: cn(theme.subTriggerStyle, theme.itemFocusStyle, className), onMouseEnter: handleMouseEnter, onKeyDown: handleKeyDown, ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsx("span", { className: "flex-1 truncate", children: children }), jsx(CaretRight, { className: "absolute right-2 top-1/2 -translate-y-1/2 size-3 text-[var(--color-text-secondary)]", "aria-hidden": "true", weight: "bold" })] }));
|
|
58
58
|
});
|
|
59
59
|
ContextMenuSubTrigger.displayName = "ContextMenuSubTrigger";
|
|
60
60
|
|
|
@@ -8,12 +8,15 @@ const drawerTheme = {
|
|
|
8
8
|
"flex flex-col overflow-hidden rounded-[var(--drawer-radius)] " +
|
|
9
9
|
"dark:ring-white/5",
|
|
10
10
|
inner: "h-full flex flex-col",
|
|
11
|
-
header: "flex items-start justify-between
|
|
11
|
+
header: "flex items-start justify-between px-[var(--drawer-px)] py-[var(--drawer-py)] border-b border-[var(--color-border)] shrink-0 text-[var(--color-text-primary)] gap-4",
|
|
12
12
|
headerContent: "flex items-start gap-3 flex-1 min-w-0",
|
|
13
|
-
title: "text-
|
|
13
|
+
title: "text-[length:var(--drawer-title-size)] font-semibold leading-6 text-[var(--color-text-primary)]",
|
|
14
14
|
subtitle: "text-sm text-[var(--color-text-secondary)] mt-0.5",
|
|
15
|
-
body: "flex-1 overflow-y-auto
|
|
16
|
-
|
|
15
|
+
body: "flex-1 overflow-y-auto px-[var(--drawer-px)] py-[var(--drawer-py)]",
|
|
16
|
+
// Footer's vertical padding is deliberately lighter than header/body —
|
|
17
|
+
// proportional calc() off --drawer-py (today's ratio, 12/16) so it stays
|
|
18
|
+
// in that same relationship under a themed override; horizontal matches.
|
|
19
|
+
footer: "flex items-center justify-end gap-3 px-[var(--drawer-px)] py-[calc(var(--drawer-py)*0.75)] border-t border-[var(--color-border)] shrink-0 " +
|
|
17
20
|
"",
|
|
18
21
|
};
|
|
19
22
|
// Position variants with margin support
|
|
@@ -4,12 +4,12 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { useDrawerContext } from './DrawerContext.js';
|
|
5
5
|
import { Button } from '../Button/Button.js';
|
|
6
6
|
import 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { X } from '@phosphor-icons/react';
|
|
8
8
|
|
|
9
9
|
const DrawerHeader = ({ children, icon, showCloseButton, className, ...props }) => {
|
|
10
10
|
const { onClose, showCloseButton: contextShowCloseButton, theme, } = useDrawerContext();
|
|
11
11
|
const shouldShowCloseButton = showCloseButton !== null && showCloseButton !== void 0 ? showCloseButton : contextShowCloseButton;
|
|
12
|
-
return (jsxs("div", { className: cn(theme.header, className), ...props, children: [jsxs("div", { className: cn(theme.headerContent), children: [icon && (jsx("div", { className: "flex-shrink-0 text-[var(--color-text-secondary)]", children: icon })), jsx("div", { className: "flex-1 min-w-0", children: children })] }), shouldShowCloseButton && (jsx(Button, { color: "
|
|
12
|
+
return (jsxs("div", { className: cn(theme.header, className), ...props, children: [jsxs("div", { className: cn(theme.headerContent), children: [icon && (jsx("div", { className: "flex-shrink-0 text-[var(--color-text-secondary)]", children: icon })), jsx("div", { className: "flex-1 min-w-0", children: children })] }), shouldShowCloseButton && (jsx(Button, { color: "mono", variant: "outline", iconOnly: true, size: "sm", onClick: onClose, "aria-label": "Close drawer", className: "rounded-full shrink-0", children: jsx(X, { className: "size-4" }) }))] }));
|
|
13
13
|
};
|
|
14
14
|
DrawerHeader.displayName = "Drawer.Header";
|
|
15
15
|
|
|
@@ -4,7 +4,9 @@ const dropdownTheme = {
|
|
|
4
4
|
// Menu container - similar to Popover but with menu-specific styling.
|
|
5
5
|
// bg + shadow come from the relative-elevation engine (surfaceClasses) at runtime so
|
|
6
6
|
// a nested menu lifts above its host; keep the frosted blur + border + radius here.
|
|
7
|
-
|
|
7
|
+
// max-w caps runaway labels so MenuItem's `truncate` can engage (an unbounded
|
|
8
|
+
// menu can never ellipsize — it just stretches to fit the longest row).
|
|
9
|
+
menuStyle: "min-w-[200px] max-w-[20rem] max-h-[400px] overflow-y-auto rounded-[var(--dropdown-radius)] border border-[var(--color-border)] backdrop-blur-md focus:outline-none flex disabled:cursor-not-allowed gap-0.5",
|
|
8
10
|
// Delegate item styles to shared MenuItem theme
|
|
9
11
|
itemBaseStyle: menuItemTheme.baseStyle,
|
|
10
12
|
itemDangerStyle: menuItemTheme.dangerStyle,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useCallback } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Check } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useDropdownContext } from './DropdownContext.js';
|
|
7
7
|
import { MenuItem } from '../MenuItem/MenuItem.js';
|
|
@@ -63,7 +63,7 @@ const DropdownItem = React__default.forwardRef(({ itemKey, children, className,
|
|
|
63
63
|
: "menuitem";
|
|
64
64
|
// Build end content: user's endContent OR selection checkmark
|
|
65
65
|
const resolvedEndContent = endContent ||
|
|
66
|
-
(selectionMode !== "none" ? (jsx("div", { className: cn("flex items-center justify-center flex-shrink-0 w-5 h-5"), children: isSelected && (jsx(
|
|
66
|
+
(selectionMode !== "none" ? (jsx("div", { className: cn("flex items-center justify-center flex-shrink-0 w-5 h-5"), children: isSelected && (jsx(Check, { className: "size-4 text-[var(--color-text-secondary)]" })) })) : undefined);
|
|
67
67
|
return (jsx(MenuItem, { ref: ref, role: itemRole, disabled: disabled, isDanger: isDanger, startContent: startContent, endContent: resolvedEndContent, subtitle: subtitle, shortcut: shortcut, onActivate: handleActivate, selected: isSelected, ...(selectionMode !== "none" ? { "aria-checked": isSelected } : {}), className: className, theme: {
|
|
68
68
|
baseStyle: theme.itemBaseStyle,
|
|
69
69
|
dangerStyle: theme.itemDangerStyle,
|
|
@@ -13,8 +13,14 @@ import { useDropdownContext } from './DropdownContext.js';
|
|
|
13
13
|
* `data-state` (idle/loading), clobbering the open flag — `aria-expanded` is the reliable hook.
|
|
14
14
|
*
|
|
15
15
|
* Injected FIRST in the className merge, so a consumer's own `className` on the trigger child
|
|
16
|
-
* always wins (shadcn override model).
|
|
17
|
-
*
|
|
16
|
+
* always wins (shadcn override model).
|
|
17
|
+
*
|
|
18
|
+
* 🔴 Applied ONLY to non-`Button` triggers. A `Button` is a complete, self-styled component
|
|
19
|
+
* (its own hover/active/variant states), and a *filled* Button hovers via a `brightness` filter
|
|
20
|
+
* rather than a `hover:bg-*`, so this translucent tint would have nothing to override and would
|
|
21
|
+
* replace the Button's solid fill on hover/open (a filled trigger going see-through). Buttons
|
|
22
|
+
* therefore keep their own styling; this convenience tint is for plain/custom trigger elements
|
|
23
|
+
* that have no interaction state of their own.
|
|
18
24
|
*/
|
|
19
25
|
const triggerInteractionStyle = "hover:bg-[var(--color-surface-hover)] hover:text-[var(--color-text-primary)] " +
|
|
20
26
|
"dark:hover:bg-[var(--color-surface-hover)] " +
|
|
@@ -23,12 +29,17 @@ const triggerInteractionStyle = "hover:bg-[var(--color-surface-hover)] hover:tex
|
|
|
23
29
|
* DropdownTrigger component - wraps the trigger element
|
|
24
30
|
*/
|
|
25
31
|
const DropdownTrigger = ({ children, className }) => {
|
|
26
|
-
var _a;
|
|
32
|
+
var _a, _b;
|
|
27
33
|
const { isOpen, onOpenChange, triggerRef, menuId } = useDropdownContext();
|
|
28
34
|
const handleClick = useCallback(() => {
|
|
29
35
|
onOpenChange(!isOpen);
|
|
30
36
|
}, [isOpen, onOpenChange]);
|
|
31
37
|
const childElement = children;
|
|
38
|
+
// A Button trigger brings its own complete interaction styling — don't inject
|
|
39
|
+
// the default tint over it (it would override a filled Button's fill). See the
|
|
40
|
+
// note on triggerInteractionStyle above.
|
|
41
|
+
const isButtonChild = React__default.isValidElement(childElement) &&
|
|
42
|
+
((_a = childElement.type) === null || _a === void 0 ? void 0 : _a.displayName) === "Button";
|
|
32
43
|
// Clone the child element and add our props
|
|
33
44
|
const trigger = React__default.cloneElement(childElement, {
|
|
34
45
|
ref: (el) => {
|
|
@@ -56,8 +67,8 @@ const DropdownTrigger = ({ children, className }) => {
|
|
|
56
67
|
"aria-controls": isOpen ? menuId : undefined,
|
|
57
68
|
"data-state": isOpen ? "open" : "closed",
|
|
58
69
|
// Default interaction style first → child's own className (and the Trigger's
|
|
59
|
-
// `className` prop) override it.
|
|
60
|
-
className: cn(triggerInteractionStyle, (
|
|
70
|
+
// `className` prop) override it. Skipped for Button children (they self-style).
|
|
71
|
+
className: cn(!isButtonChild && triggerInteractionStyle, (_b = childElement.props) === null || _b === void 0 ? void 0 : _b.className, className),
|
|
61
72
|
});
|
|
62
73
|
return trigger;
|
|
63
74
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const heroCardTheme = {
|
|
2
|
-
// Shares
|
|
3
|
-
|
|
2
|
+
// Shares --card-radius (HeroCard is a Card presentation, not a distinct
|
|
3
|
+
// container) — a consumer overrides per-instance via `className`, same as
|
|
4
|
+
// every other component (shadcn override pattern).
|
|
5
|
+
// Gradient runs on the primary scale so it follows the app theme.
|
|
6
|
+
baseStyle: "relative overflow-hidden rounded-[var(--card-radius)] p-10 text-[var(--color-primary-contrast)] bg-gradient-to-br from-[var(--color-primary-600)] via-[var(--color-primary-700)] to-[var(--color-primary-500)] ring-4 ring-[var(--color-primary)]/20 ",
|
|
4
7
|
imageStyle: "absolute inset-0 z-0 pointer-events-none bg-cover",
|
|
5
8
|
contentStyle: "relative z-10",
|
|
6
9
|
};
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const kbdTheme = {
|
|
5
5
|
baseStyle: 'inline-flex items-center justify-center leading-none font-sans font-medium rounded-[calc(var(--radius-base)*0.75)] bg-[var(--color-surface-raised)] border border-[var(--color-border)] text-[var(--color-text-secondary)]',
|
|
6
|
+
// px tokenised (--kbd-px-*) so a theme can widen keycaps; height/min-width
|
|
7
|
+
// stay the fixed keycap size (h-5/h-6) and radius derives from --radius-base.
|
|
6
8
|
sizes: {
|
|
7
|
-
sm: 'text-xs px-
|
|
8
|
-
md: 'text-xs px-
|
|
9
|
+
sm: 'text-xs px-[var(--kbd-px-sm)] min-w-5 h-5',
|
|
10
|
+
md: 'text-xs px-[var(--kbd-px-md)] min-w-6 h-6',
|
|
9
11
|
},
|
|
10
12
|
separatorStyle: 'text-[var(--color-text-muted)] text-xs',
|
|
11
13
|
};
|
|
@@ -18,14 +18,16 @@ const LINK_BASE = "relative inline-flex items-center justify-center gap-2 bg-tra
|
|
|
18
18
|
"focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
19
19
|
// Animated underline — a bottom-anchored line that scales in from the left on
|
|
20
20
|
// hover/focus. `bg-current` inherits each color variant's text tint.
|
|
21
|
-
|
|
21
|
+
// `-bottom-px` offsets the line 1px below the text so it doesn't crowd the
|
|
22
|
+
// descenders — the pseudo-underline equivalent of `text-underline-offset`.
|
|
23
|
+
const LINK_UNDERLINE = "pointer-events-none absolute -bottom-px left-0 h-px w-full bg-current";
|
|
22
24
|
const UNDERLINE_VARIANTS = { rest: { scaleX: 0 }, hover: { scaleX: 1 } };
|
|
23
25
|
// Text tint per semantic color — the one thing `color` drives.
|
|
24
26
|
const LINK_COLORS = {
|
|
25
|
-
|
|
27
|
+
mono: "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] " +
|
|
26
28
|
"focus-visible:outline-[var(--color-text-secondary)] dark:text-[var(--color-text-primary)]",
|
|
27
|
-
primary: "text-[var(--color-primary
|
|
28
|
-
"dark:text-[var(--color-primary
|
|
29
|
+
primary: "text-[var(--color-primary)] " +
|
|
30
|
+
"dark:text-[var(--color-primary)]",
|
|
29
31
|
success: "text-[var(--color-success-600)] focus-visible:outline-[var(--color-success-600)] " +
|
|
30
32
|
"dark:text-[var(--color-success-300)]",
|
|
31
33
|
warning: "text-[var(--color-warning-600)] focus-visible:outline-[var(--color-warning-600)] " +
|
|
@@ -7,7 +7,7 @@ import { messageTheme } from './Message.theme.js';
|
|
|
7
7
|
import { Avatar } from '../Avatar/Avatar.js';
|
|
8
8
|
import { Button } from '../Button/Button.js';
|
|
9
9
|
import { motion } from 'motion/react';
|
|
10
|
-
import {
|
|
10
|
+
import { Copy, ArrowsClockwise } from '@phosphor-icons/react';
|
|
11
11
|
import { MessageContext } from './MessageContext.js';
|
|
12
12
|
import { MessageAvatar } from './MessageAvatar.js';
|
|
13
13
|
import { MessageBody } from './MessageBody.js';
|
|
@@ -119,7 +119,7 @@ const MessageRoot = React__default.forwardRef(({ role, variant: variantProp, con
|
|
|
119
119
|
// Backward compatibility
|
|
120
120
|
variant === "sender" && customTheme.senderTimestampStyle, variant === "receiver" && customTheme.receiverTimestampStyle, variant === "system" && customTheme.systemTimestampStyle);
|
|
121
121
|
// Build default action buttons if needed
|
|
122
|
-
const defaultActionButtons = shouldShowDefaultActions ? (jsxs("div", { className: cn(messageTheme.actionsContainerStyle, customTheme.actionsContainerStyle), children: [onCopy && (jsx(Button, { variant: "ghost", color: "
|
|
122
|
+
const defaultActionButtons = shouldShowDefaultActions ? (jsxs("div", { className: cn(messageTheme.actionsContainerStyle, customTheme.actionsContainerStyle), children: [onCopy && (jsx(Button, { variant: "ghost", color: "mono", size: "sm", iconOnly: true, onClick: onCopy, "aria-label": "Copy message", className: "opacity-40 hover:opacity-100", children: jsx(Copy, { className: "size-4" }) })), onRegenerate && (jsx(Button, { variant: "ghost", color: "mono", size: "sm", iconOnly: true, onClick: onRegenerate, "aria-label": "Regenerate response", className: "opacity-40 hover:opacity-100", children: jsx(ArrowsClockwise, { className: "size-4" }) }))] })) : undefined;
|
|
123
123
|
// Use custom actions if provided, otherwise use default actions
|
|
124
124
|
const finalActions = actions !== null && actions !== void 0 ? actions : defaultActionButtons;
|
|
125
125
|
// Use TypeWriter for streaming receiver/assistant messages with string content (props API)
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const messageTheme = {
|
|
6
6
|
// Shared base styles (apply to all variants)
|
|
7
|
-
bubbleBaseStyle: "max-w-[80%] sm:max-w-[85%] rounded-[
|
|
7
|
+
bubbleBaseStyle: "max-w-[80%] sm:max-w-[85%] rounded-[var(--message-bubble-radius)] px-3 py-2 w-fit min-w-fit h-fit",
|
|
8
8
|
containerBaseStyle: "flex items-start gap-3 h-fit text-sm",
|
|
9
|
-
timestampStyle: "text-xs text-[var(--color-text-placeholder)]
|
|
9
|
+
timestampStyle: "text-xs text-[var(--color-text-placeholder)]",
|
|
10
10
|
// Variant-specific modifiers (only differences)
|
|
11
11
|
variants: {
|
|
12
12
|
sender: {
|
|
13
13
|
containerModifier: "flex-row-reverse", // Reverse direction for right alignment
|
|
14
|
-
bubbleStyle: "bg-[var(--color-
|
|
14
|
+
bubbleStyle: "bg-[var(--color-mono-900)] text-[var(--color-mono-100)] " +
|
|
15
15
|
"rounded-tr-xs " +
|
|
16
16
|
// Dark mode - slightly darker gradient for better contrast
|
|
17
17
|
" ",
|
|
@@ -22,13 +22,12 @@ const messageTheme = {
|
|
|
22
22
|
bubbleStyle: " text-[var(--color-text-secondary)] rounded-tl-xs py-0 px-0 " +
|
|
23
23
|
" " +
|
|
24
24
|
// Dark mode - dark background with lighter text
|
|
25
|
-
" " +
|
|
26
25
|
"",
|
|
27
26
|
timestampModifier: "text-left pl-1",
|
|
28
27
|
},
|
|
29
28
|
system: {
|
|
30
29
|
containerModifier: "justify-center", // Center alignment
|
|
31
|
-
bubbleStyle: "bg-[var(--color-background)] text-[var(--color-text-muted)]/80 rounded-[calc(var(--radius-base)*0.75)] px-1 py-0.5 " +
|
|
30
|
+
bubbleStyle: "bg-[var(--color-background)] text-[var(--color-text-muted)]/80 rounded-[min(calc(var(--radius-base)*0.75),var(--surface-radius-cap-xs))] px-1 py-0.5 " +
|
|
32
31
|
"text-xs border-none " +
|
|
33
32
|
// Dark mode
|
|
34
33
|
"",
|
|
@@ -36,8 +35,7 @@ const messageTheme = {
|
|
|
36
35
|
},
|
|
37
36
|
},
|
|
38
37
|
// Feature styles (streaming, actions)
|
|
39
|
-
streamingIndicatorStyle: "flex items-center gap-1 text-[var(--color-text-placeholder)] text-xs
|
|
40
|
-
"dark:text-[var(--color-neutral-500)]",
|
|
38
|
+
streamingIndicatorStyle: "flex items-center gap-1 text-[var(--color-text-placeholder)] text-xs",
|
|
41
39
|
actionsContainerStyle: "flex items-start gap-3",
|
|
42
40
|
// Status styles
|
|
43
41
|
statusStyle: "flex items-center gap-1 text-xs mt-1",
|
|
@@ -3,10 +3,10 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { messageTheme } from './Message.theme.js';
|
|
6
|
-
import {
|
|
6
|
+
import { Play } from '@phosphor-icons/react';
|
|
7
7
|
|
|
8
8
|
const MessageAudio = ({ duration, name, onClick, className, }) => {
|
|
9
|
-
return (jsxs("div", { className: cn(messageTheme.audioStyle, className), children: [jsx("button", { onClick: onClick, className: "flex items-center justify-center size-8 rounded-full bg-[var(--color-primary)] text-[var(--color-primary-contrast)] flex-shrink-0 cursor-pointer", "aria-label": name ? `Play ${name}` : "Play audio", type: "button", children: jsx(
|
|
9
|
+
return (jsxs("div", { className: cn(messageTheme.audioStyle, className), children: [jsx("button", { onClick: onClick, className: "flex items-center justify-center size-8 rounded-full bg-[var(--color-primary)] text-[var(--color-primary-contrast)] flex-shrink-0 cursor-pointer", "aria-label": name ? `Play ${name}` : "Play audio", type: "button", children: jsx(Play, { className: "size-4 ml-0.5" }) }), jsxs("div", { className: "flex flex-col min-w-0 flex-1", children: [name && (jsx("span", { className: "font-medium text-[var(--color-text-primary)] truncate", children: name })), duration && (jsx("span", { className: "text-xs text-[var(--color-text-muted)]", children: duration }))] })] }));
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export { MessageAudio };
|
|
@@ -3,10 +3,10 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { messageTheme } from './Message.theme.js';
|
|
6
|
-
import {
|
|
6
|
+
import { File, DownloadSimple } from '@phosphor-icons/react';
|
|
7
7
|
|
|
8
8
|
const MessageFile = ({ name = "File", url, size, onClick, className, }) => {
|
|
9
|
-
const content = (jsxs("div", { className: cn(messageTheme.fileStyle, className), onClick: !url ? onClick : undefined, role: !url && onClick ? "button" : undefined, tabIndex: !url && onClick ? 0 : undefined, children: [jsx(
|
|
9
|
+
const content = (jsxs("div", { className: cn(messageTheme.fileStyle, className), onClick: !url ? onClick : undefined, role: !url && onClick ? "button" : undefined, tabIndex: !url && onClick ? 0 : undefined, children: [jsx(File, { className: "size-5 flex-shrink-0 text-[var(--color-text-muted)]" }), jsxs("div", { className: "flex flex-col min-w-0 flex-1", children: [jsx("span", { className: "font-medium text-[var(--color-text-primary)] truncate", children: name }), size && (jsx("span", { className: "text-xs text-[var(--color-text-muted)]", children: size }))] }), url && (jsx(DownloadSimple, { className: "size-4 flex-shrink-0 text-[var(--color-text-muted)]" }))] }));
|
|
10
10
|
if (url) {
|
|
11
11
|
return (jsx("a", { href: url, download: true, className: "no-underline", "aria-label": `Download ${name}`, children: content }));
|
|
12
12
|
}
|
|
@@ -2,10 +2,10 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { cn } from '../../../utils/cn.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import { messageTheme } from './Message.theme.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Link } from '@phosphor-icons/react';
|
|
6
6
|
|
|
7
7
|
const MessageLink = ({ url, thumbnailUrl, title, description, domain, className, }) => {
|
|
8
|
-
const content = (jsxs("div", { className: cn(messageTheme.linkStyle, className), children: [thumbnailUrl && (jsx("img", { src: thumbnailUrl, alt: title || "Link preview", className: "w-full h-32 object-cover" })), jsxs("div", { className: "px-3 py-2.5 flex flex-col gap-0.5", children: [title && (jsx("span", { className: "font-medium text-[var(--color-text-primary)] line-clamp-1", children: title })), description && (jsx("span", { className: "text-[var(--color-text-muted)] line-clamp-2", children: description })), domain && (jsxs("span", { className: "flex items-center gap-1 text-xs text-[var(--color-text-placeholder)] mt-0.5", children: [jsx(
|
|
8
|
+
const content = (jsxs("div", { className: cn(messageTheme.linkStyle, className), children: [thumbnailUrl && (jsx("img", { src: thumbnailUrl, alt: title || "Link preview", className: "w-full h-32 object-cover" })), jsxs("div", { className: "px-3 py-2.5 flex flex-col gap-0.5", children: [title && (jsx("span", { className: "font-medium text-[var(--color-text-primary)] line-clamp-1", children: title })), description && (jsx("span", { className: "text-[var(--color-text-muted)] line-clamp-2", children: description })), domain && (jsxs("span", { className: "flex items-center gap-1 text-xs text-[var(--color-text-placeholder)] mt-0.5", children: [jsx(Link, { className: "size-3" }), domain] }))] })] }));
|
|
9
9
|
if (url) {
|
|
10
10
|
return (jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "no-underline", "aria-label": title ? `Open ${title}` : "Open link", children: content }));
|
|
11
11
|
}
|
|
@@ -4,20 +4,20 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import { messageTheme } from './Message.theme.js';
|
|
6
6
|
import { Link } from '../Link/Link.js';
|
|
7
|
-
import {
|
|
7
|
+
import { WarningCircle, Check, Clock } from '@phosphor-icons/react';
|
|
8
8
|
|
|
9
|
-
const DoubleCheck = ({ className }) => (jsxs("span", { className: cn("inline-flex items-center -space-x-2", className), children: [jsx(
|
|
9
|
+
const DoubleCheck = ({ className }) => (jsxs("span", { className: cn("inline-flex items-center -space-x-2", className), children: [jsx(Check, { className: "size-3.5" }), jsx(Check, { className: "size-3.5" })] }));
|
|
10
10
|
const MessageStatusIndicator = ({ status, readAt, onRetry, className, }) => {
|
|
11
11
|
if (!status)
|
|
12
12
|
return null;
|
|
13
13
|
const statusConfig = {
|
|
14
14
|
sending: {
|
|
15
|
-
icon: jsx(
|
|
15
|
+
icon: jsx(Clock, { className: "size-3.5" }),
|
|
16
16
|
style: messageTheme.statusSending,
|
|
17
17
|
label: "Sending",
|
|
18
18
|
},
|
|
19
19
|
sent: {
|
|
20
|
-
icon: jsx(
|
|
20
|
+
icon: jsx(Check, { className: "size-3.5" }),
|
|
21
21
|
style: messageTheme.statusSent,
|
|
22
22
|
label: "Sent",
|
|
23
23
|
},
|
|
@@ -34,7 +34,7 @@ const MessageStatusIndicator = ({ status, readAt, onRetry, className, }) => {
|
|
|
34
34
|
: "Read",
|
|
35
35
|
},
|
|
36
36
|
failed: {
|
|
37
|
-
icon: jsx(
|
|
37
|
+
icon: jsx(WarningCircle, { className: "size-3.5" }),
|
|
38
38
|
style: messageTheme.statusFailed,
|
|
39
39
|
label: "Failed",
|
|
40
40
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModalProps } from "./Modal.types";
|
|
2
2
|
export { ModalContext, useModalContext } from "./ModalContext";
|
|
3
3
|
export declare const Modal: {
|
|
4
|
-
({ isOpen, onClose, size, closeOnOverlayClick, closeOnEsc, showCloseButton, role, children, className, theme: themeOverrides, elevation, lift, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ isOpen, onClose, size, closeOnOverlayClick, closeOnEsc, showCloseButton, role, children, className, theme: themeOverrides, elevation, lift, darkMode, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
7
|
Header: {
|
|
@@ -14,7 +14,7 @@ import { ModalBody } from './ModalBody.js';
|
|
|
14
14
|
import { ModalFooter } from './ModalFooter.js';
|
|
15
15
|
import { useSurfaceElevation, SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
16
16
|
|
|
17
|
-
const ModalRoot = ({ isOpen, onClose, size = "md", closeOnOverlayClick = true, closeOnEsc = true, showCloseButton = true, role = "dialog", children, className, theme: themeOverrides, elevation, lift, ...props }) => {
|
|
17
|
+
const ModalRoot = ({ isOpen, onClose, size = "md", closeOnOverlayClick = true, closeOnEsc = true, showCloseButton = true, role = "dialog", children, className, theme: themeOverrides, elevation, lift, darkMode = false, ...props }) => {
|
|
18
18
|
// Grounded backdrop overlay: a Modal covers the viewport, so it paints a FIXED rung 4
|
|
19
19
|
// regardless of where its <Modal> JSX sits (a Modal declared inside a Card must not
|
|
20
20
|
// inherit the Card's rung). Content inside still lifts relative to the modal.
|
|
@@ -54,7 +54,7 @@ const ModalRoot = ({ isOpen, onClose, size = "md", closeOnOverlayClick = true, c
|
|
|
54
54
|
titleId,
|
|
55
55
|
subtitleId,
|
|
56
56
|
}), [isOpen, onClose, size, isSizeToken, closeOnOverlayClick, closeOnEsc, showCloseButton, theme, isBodyScrollable, setIsBodyScrollable, titleId, subtitleId]);
|
|
57
|
-
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "center", role: role, ariaModal: true, ariaLabelledBy: titleId, ariaDescribedBy: subtitleId, contentClassName: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: false }), theme.container, isSizeToken ? modalSizeVariants[size] : size, className), animations: {
|
|
57
|
+
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "center", role: role, ariaModal: true, ariaLabelledBy: titleId, ariaDescribedBy: subtitleId, contentClassName: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: false }), theme.container, isSizeToken ? modalSizeVariants[size] : size, darkMode && "dark", className), animations: {
|
|
58
58
|
overlay: modalOverlayAnimations,
|
|
59
59
|
content: modalContentAnimations,
|
|
60
60
|
}, ...props, children: jsx(ModalContext.Provider, { value: contextValue, children: jsx(SurfaceProvider, { level: surfaceLevel, children: children }) }) }));
|
|
@@ -4,12 +4,17 @@ const modalTheme = {
|
|
|
4
4
|
// bg comes from the relative-elevation engine (surfaceClasses) at runtime so a modal
|
|
5
5
|
// lifts above its host substrate; keep the dramatic shadow + ring + border + radius here.
|
|
6
6
|
container: "relative w-full max-h-[calc(100vh-2rem)] rounded-[var(--modal-radius)] shadow-2xl shadow-black/30 flex flex-col my-4 min-h-0 overflow-hidden ring-6 !ring-white/10 border border-[var(--color-border)]",
|
|
7
|
-
header: "flex items-start justify-between
|
|
7
|
+
header: "flex items-start justify-between px-[var(--modal-px)] pt-[var(--modal-py)] pb-0 shrink-0 border-b border-transparent gap-6 relative",
|
|
8
8
|
headerContent: "flex flex-col items-start gap-2 flex-1",
|
|
9
|
-
title: "text-
|
|
9
|
+
title: "text-[length:var(--modal-title-size)] leading-6 font-semibold text-[var(--color-text-primary)]",
|
|
10
10
|
subtitle: "text-sm text-[var(--color-text-secondary)] mt-0.5",
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// pb-[...*0.75] is the gap before the footer — proportional to --modal-py
|
|
12
|
+
// (today's ratio, 12/16) so a themed --modal-py increase widens it too.
|
|
13
|
+
body: "flex-1 overflow-y-auto px-[var(--modal-px)] pt-[var(--modal-py)] pb-[calc(var(--modal-py)*0.75)]",
|
|
14
|
+
// Footer is deliberately lighter/tighter than header/body — expressed as a
|
|
15
|
+
// proportional calc() off the same tokens (today's ratios: 0.75x/0.5x) so
|
|
16
|
+
// that relationship survives a themed --modal-px/--modal-py override.
|
|
17
|
+
footer: "flex items-center justify-end gap-2 px-[calc(var(--modal-px)*0.75)] py-[calc(var(--modal-py)*0.5)] border-t border-transparent",
|
|
13
18
|
};
|
|
14
19
|
// Size variants for the modal container
|
|
15
20
|
const modalSizeVariants = {
|
|
@@ -4,12 +4,12 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { useModalContext } from './ModalContext.js';
|
|
5
5
|
import { Button } from '../Button/Button.js';
|
|
6
6
|
import 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { X } from '@phosphor-icons/react';
|
|
8
8
|
|
|
9
9
|
const ModalHeader = ({ children, icon, showCloseButton, className, ...props }) => {
|
|
10
10
|
const { onClose, showCloseButton: contextShowCloseButton, theme, isBodyScrollable, } = useModalContext();
|
|
11
11
|
const shouldShowCloseButton = showCloseButton !== null && showCloseButton !== void 0 ? showCloseButton : contextShowCloseButton;
|
|
12
|
-
return (jsxs("div", { className: cn(theme.header, isBodyScrollable && "border-[var(--color-border)] relative", className), ...props, children: [jsxs("div", { className: cn(theme.headerContent), children: [icon && (jsx("div", { className: "flex-shrink-0 text-[var(--color-text-secondary)]", children: icon })), jsx("div", { className: "flex-1", children: children })] }), shouldShowCloseButton && (jsx("div", { className: "", children: jsx(Button, { color: "
|
|
12
|
+
return (jsxs("div", { className: cn(theme.header, isBodyScrollable && "border-[var(--color-border)] relative", className), ...props, children: [jsxs("div", { className: cn(theme.headerContent), children: [icon && (jsx("div", { className: "flex-shrink-0 text-[var(--color-text-secondary)]", children: icon })), jsx("div", { className: "flex-1", children: children })] }), shouldShowCloseButton && (jsx("div", { className: "", children: jsx(Button, { color: "mono", variant: "outline", iconOnly: true, size: "sm", onClick: onClose, "aria-label": "Close modal", className: "rounded-full shrink-0", children: jsx(X, { className: "size-4" }) }) }))] }));
|
|
13
13
|
};
|
|
14
14
|
ModalHeader.displayName = "Modal.Header";
|
|
15
15
|
|
|
@@ -5,7 +5,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
5
5
|
import '../Modal/Modal.js';
|
|
6
6
|
import { modalTheme, modalSizeVariants } from '../Modal/Modal.theme.js';
|
|
7
7
|
import { SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
8
|
-
import {
|
|
8
|
+
import { ArrowLeft } from '@phosphor-icons/react';
|
|
9
9
|
import { modalStackTheme } from './ModalStack.theme.js';
|
|
10
10
|
import { Link } from '../Link/Link.js';
|
|
11
11
|
import { ModalContext } from '../Modal/ModalContext.js';
|
|
@@ -47,7 +47,7 @@ const ModalStackModal = ({ size = "md", showCloseButton = true, showBackButton =
|
|
|
47
47
|
titleId,
|
|
48
48
|
subtitleId,
|
|
49
49
|
}), [closeHandler, size, isSizeToken, showCloseButton, theme, isBodyScrollable, setIsBodyScrollable, titleId, subtitleId]);
|
|
50
|
-
return (jsx(ModalContext.Provider, { value: contextValue, children: jsx("div", { className: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: false }), theme.container, modalSizeVariants[size], className), role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": subtitleId, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [showBackButton && (jsx("div", { className: cn(modalStackTheme.backButton), children: jsxs(Link, { onClick: backHandler, "aria-label": "Go back", size: "sm", children: [jsx(
|
|
50
|
+
return (jsx(ModalContext.Provider, { value: contextValue, children: jsx("div", { className: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: false }), theme.container, modalSizeVariants[size], className), role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": subtitleId, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [showBackButton && (jsx("div", { className: cn(modalStackTheme.backButton), children: jsxs(Link, { onClick: backHandler, "aria-label": "Go back", size: "sm", children: [jsx(ArrowLeft, { className: "size-4" }), "Back"] }) })), children] }) }) }));
|
|
51
51
|
};
|
|
52
52
|
ModalStackModal.displayName = "ModalStack.Modal";
|
|
53
53
|
|
|
@@ -14,7 +14,7 @@ import { useSidebarContext, useAccordionNavContext, useSidebarDensity } from '..
|
|
|
14
14
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
15
15
|
import '../Tooltip/Tooltip.animations.js';
|
|
16
16
|
import { Badge } from '../Badge/Badge.js';
|
|
17
|
-
import {
|
|
17
|
+
import { CaretDown } from '@phosphor-icons/react';
|
|
18
18
|
import { AnimatePresence, motion } from 'motion/react';
|
|
19
19
|
|
|
20
20
|
const NavItem = React__default.forwardRef(({ children, startContent, endContent, notification, description, shortcut, href, onClick, active = false, isDisabled = false, hasSubmenu: propHasSubmenu = false, expanded: controlledExpanded, onToggleExpanded, items, defaultExpanded = false, level = 0, showTooltipWhenCollapsed = true, className, theme: customTheme = {}, ...props }, ref) => {
|
|
@@ -125,7 +125,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
125
125
|
return (jsx("span", { className: cn(navItemTheme.notificationDot, customTheme.notificationDot) }));
|
|
126
126
|
}
|
|
127
127
|
if (typeof notification === "number" && notification > 0) {
|
|
128
|
-
return (jsx(Badge, { color: "
|
|
128
|
+
return (jsx(Badge, { color: "mono", variant: "soft", size: "sm", children: notification > 99 ? "99+" : notification }));
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}, [notification, customTheme.notificationDot]);
|
|
@@ -186,7 +186,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
186
186
|
const iconClasses = cn(theme.icon, getIconStateClasses(), hasSubmenu && isExpanded && !isActive && "opacity-100", isCollapsedView && ((_b = theme.collapsed) === null || _b === void 0 ? void 0 : _b.icon), isHoveredOrDropdownOpen && "opacity-100");
|
|
187
187
|
const textClasses = cn(theme.text);
|
|
188
188
|
// Chevron for submenu
|
|
189
|
-
const chevron = hasSubmenu && !isCollapsedView ? (jsx(
|
|
189
|
+
const chevron = hasSubmenu && !isCollapsedView ? (jsx(CaretDown, { weight: "bold", className: cn("size-4 transition-transform duration-200 text-[var(--color-text-muted)]", isExpanded && "text-[var(--color-text-primary)]", isExpanded && "rotate-180") })) : null;
|
|
190
190
|
// Strip drag/animation DOM handlers that collide with motion's prop types.
|
|
191
191
|
// `onSubmit`/`onSubmitCapture` are stripped too: NavItem renders as either
|
|
192
192
|
// `motion.a` or `motion.button`, but `NavItemProps extends HTMLAttributes<HTMLElement>`
|
|
@@ -255,7 +255,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
255
255
|
delay: idx * 0.055,
|
|
256
256
|
duration: 0.16,
|
|
257
257
|
ease: "easeOut",
|
|
258
|
-
}, className: "absolute left-[-6px] top-1/2 h-[calc(100%+0.125rem)] w-px origin-top bg-[var(--color-
|
|
258
|
+
}, className: "absolute left-[-6px] top-1/2 h-[calc(100%+0.125rem)] w-px origin-top bg-[var(--color-mono-400)] dark:bg-[var(--color-mono-600)]", "aria-hidden": "true" })), jsx(motion.span, { initial: { opacity: 0, scale: 0.5 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.5 }, transition: {
|
|
259
259
|
delay: idx * 0.055,
|
|
260
260
|
type: "spring",
|
|
261
261
|
stiffness: 520,
|
|
@@ -263,7 +263,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
263
263
|
mass: 0.6,
|
|
264
264
|
}, className: cn("absolute left-[-8.5px] top-1/2 z-10 size-1.5 -translate-y-1/2 rounded-full", item.active
|
|
265
265
|
? "bg-[var(--color-primary)]"
|
|
266
|
-
: "bg-[var(--color-
|
|
266
|
+
: "bg-[var(--color-mono-400)] dark:bg-[var(--color-mono-600)]"), "aria-hidden": "true" }), jsx(motion.div, { initial: { opacity: 0, x: -6 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -6 }, transition: {
|
|
267
267
|
delay: idx * 0.055 + 0.035,
|
|
268
268
|
type: "spring",
|
|
269
269
|
stiffness: 460,
|
|
@@ -291,7 +291,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
291
291
|
return (jsx("span", { className: cn(theme.notificationDot, customTheme.notificationDot) }));
|
|
292
292
|
}
|
|
293
293
|
if (typeof item.notification === "number" && item.notification > 0) {
|
|
294
|
-
return (jsx(Badge, { color: "
|
|
294
|
+
return (jsx(Badge, { color: "mono", variant: "soft", size: "sm", children: item.notification > 99 ? "99+" : item.notification }));
|
|
295
295
|
}
|
|
296
296
|
return null;
|
|
297
297
|
})();
|