@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +375 -5
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +40 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +73 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +3 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +14 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +6 -2
- package/dist/components/ai/index.js +10 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +2 -3
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -3
- package/dist/components/canvas/NodeRenderer.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +24 -35
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +10 -22
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +13 -32
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +10 -7
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +16 -11
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +11 -28
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +151 -133
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +12 -6
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +10 -8
- package/dist/components/charts/index.js +8 -4
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +21 -26
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -21
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +3 -3
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -3
- package/dist/components/core/Alert/Alert.animations.js +30 -8
- package/dist/components/core/Alert/Alert.js +23 -9
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -82
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +33 -65
- package/dist/components/core/Badge/Badge.theme.js +26 -24
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +6 -6
- package/dist/components/core/Button/Button.js +14 -58
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +35 -22
- package/dist/components/core/Button/Button.types.d.ts +26 -13
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +15 -23
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +40 -4
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +22 -9
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -3
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +7 -5
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +4 -2
- package/dist/components/core/Message/Message.theme.js +8 -10
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +6 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +4 -2
- package/dist/components/core/NavItem/NavItem.js +8 -7
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +27 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +5 -5
- package/dist/components/core/Pill/Pill.js +5 -2
- package/dist/components/core/Pill/Pill.theme.js +9 -5
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +2 -2
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +10 -7
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +3 -3
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +4 -4
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +3 -3
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +5 -3
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +7 -7
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -3
- package/dist/components/data-display/KPI/KPI.js +12 -21
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +11 -11
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -3
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +13 -6
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +4 -4
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +3 -3
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +4 -4
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +7 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1681
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +14 -13
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +74 -8
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +3 -2
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/TimePicker/TimePicker.theme.js +7 -8
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +38 -13
- package/dist/components/forms/index.js +2 -1
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +197 -4
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2522 -328
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +2522 -328
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +2 -5
- package/dist/registry.json +3262 -2464
- package/dist/shadcn-compat.css +6 -6
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +2557 -328
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/dist/utils/index.d.ts +0 -1
- package/package.json +39 -6
- package/src/global.scss +32 -28
- package/src/styles/theme.css +547 -176
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +66 -38
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -207
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -65
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -12
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -1,61 +1,17 @@
|
|
|
1
|
-
import { RichTextEditorTheme
|
|
1
|
+
import type { RichTextEditorTheme } from "./RichTextEditor.types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* import `colorOptions` directly. The RichTextEditor's color picker now uses
|
|
5
|
-
* the full Tailwind spectrum below.
|
|
6
|
-
*/
|
|
7
|
-
export declare const colorOptions: ColorOption[];
|
|
8
|
-
/**
|
|
9
|
-
* Tailwind shade scale (same for every family). Used by both the picker
|
|
10
|
-
* UI and the `getTailwindShadeTokens` utility below.
|
|
11
|
-
*/
|
|
12
|
-
export declare const TAILWIND_SHADE_LABELS: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
|
|
13
|
-
/**
|
|
14
|
-
* The 22 Tailwind color families, in spectrum order.
|
|
15
|
-
* Tailwind v4 exposes each shade as `--color-{family}-{shade}` automatically,
|
|
16
|
-
* so we render swatches via `var(--color-...)` instead of hardcoding hex.
|
|
17
|
-
*/
|
|
18
|
-
export declare const TAILWIND_COLOR_FAMILIES: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
|
|
19
|
-
/**
|
|
20
|
-
* Returns shade tokens for a given Tailwind family.
|
|
3
|
+
* RichTextEditor theme.
|
|
21
4
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
export declare const getTailwindShadeTokens: (family: string) => string[];
|
|
27
|
-
/**
|
|
28
|
-
* Resolves a Tailwind shade token to a CSS color value usable in inline
|
|
29
|
-
* styles for swatch backgrounds. Reads `--color-{token}` directly; modern
|
|
30
|
-
* browsers accept the resulting `oklch(...)` (or fallback `rgb()`) in
|
|
31
|
-
* `background-color` without normalization.
|
|
5
|
+
* The bordered shell reuses `formsBaseTheme`'s inset-box-shadow border and state
|
|
6
|
+
* variants verbatim, so the editor's resting/hover/focus/invalid edges are
|
|
7
|
+
* pixel-identical to Input, Textarea and Select (CLAUDE.md §9).
|
|
32
8
|
*
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* lists `bg-{family}-{shade}` for the full 22×11 palette so Tailwind's
|
|
41
|
-
* content scanner emits all CSS variables. Not used at runtime.
|
|
42
|
-
*/
|
|
43
|
-
export declare const _TAILWIND_PALETTE_KEEPALIVE: string;
|
|
44
|
-
/**
|
|
45
|
-
* The two non-family base colors users always reach for, shown in their own row
|
|
46
|
-
* above the spectrum.
|
|
47
|
-
*
|
|
48
|
-
* `value` is the resolved background color (used to paint the swatch);
|
|
49
|
-
* `token` is the Tailwind shade fragment used to build the `text-{token}`
|
|
50
|
-
* class applied to the editor content.
|
|
51
|
-
*/
|
|
52
|
-
export declare const MONO_COLORS: {
|
|
53
|
-
name: string;
|
|
54
|
-
value: string;
|
|
55
|
-
token: string;
|
|
56
|
-
}[];
|
|
57
|
-
export declare const _RTE_CLASSES_KEEPALIVE: string;
|
|
58
|
-
/**
|
|
59
|
-
* Rich Text Editor theme - extends common forms base theme for consistency
|
|
9
|
+
* 🔴 No typography or colour maps here, and no Tailwind "keepalive" sentinel.
|
|
10
|
+
* The previous implementation applied formatting via runtime `classList.add` of
|
|
11
|
+
* utility classes (`font-bold`, `text-rose-500`, `leading-relaxed`), which meant
|
|
12
|
+
* stored HTML only rendered correctly inside a Tailwind build that had scanned a
|
|
13
|
+
* 242-entry sentinel string. Formatting is now semantic markup, styled by the
|
|
14
|
+
* `[&_x]:` descendant rules below — so the content is portable and the CSS is
|
|
15
|
+
* bounded.
|
|
60
16
|
*/
|
|
61
17
|
export declare const richTextEditorTheme: RichTextEditorTheme;
|
|
@@ -1,129 +1,71 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { formsBaseTheme } from '../forms.theme.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
* UI and the `getTailwindShadeTokens` utility below.
|
|
7
|
-
*/
|
|
8
|
-
const TAILWIND_SHADE_LABELS = [
|
|
9
|
-
"50",
|
|
10
|
-
"100",
|
|
11
|
-
"200",
|
|
12
|
-
"300",
|
|
13
|
-
"400",
|
|
14
|
-
"500",
|
|
15
|
-
"600",
|
|
16
|
-
"700",
|
|
17
|
-
"800",
|
|
18
|
-
"900",
|
|
19
|
-
"950",
|
|
20
|
-
];
|
|
21
|
-
/**
|
|
22
|
-
* The 22 Tailwind color families, in spectrum order.
|
|
23
|
-
* Tailwind v4 exposes each shade as `--color-{family}-{shade}` automatically,
|
|
24
|
-
* so we render swatches via `var(--color-...)` instead of hardcoding hex.
|
|
25
|
-
*/
|
|
26
|
-
const TAILWIND_COLOR_FAMILIES = [
|
|
27
|
-
"slate",
|
|
28
|
-
"gray",
|
|
29
|
-
"zinc",
|
|
30
|
-
"neutral",
|
|
31
|
-
"stone",
|
|
32
|
-
"red",
|
|
33
|
-
"orange",
|
|
34
|
-
"amber",
|
|
35
|
-
"yellow",
|
|
36
|
-
"lime",
|
|
37
|
-
"green",
|
|
38
|
-
"emerald",
|
|
39
|
-
"teal",
|
|
40
|
-
"cyan",
|
|
41
|
-
"sky",
|
|
42
|
-
"blue",
|
|
43
|
-
"indigo",
|
|
44
|
-
"violet",
|
|
45
|
-
"purple",
|
|
46
|
-
"fuchsia",
|
|
47
|
-
"pink",
|
|
48
|
-
"rose",
|
|
49
|
-
];
|
|
50
|
-
/**
|
|
51
|
-
* Returns shade tokens for a given Tailwind family.
|
|
4
|
+
* RichTextEditor theme.
|
|
52
5
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
const getTailwindShadeTokens = (family) => TAILWIND_SHADE_LABELS.map((shade) => `${family}-${shade}`);
|
|
58
|
-
/**
|
|
59
|
-
* Resolves a Tailwind shade token to a CSS color value usable in inline
|
|
60
|
-
* styles for swatch backgrounds. Reads `--color-{token}` directly; modern
|
|
61
|
-
* browsers accept the resulting `oklch(...)` (or fallback `rgb()`) in
|
|
62
|
-
* `background-color` without normalization.
|
|
6
|
+
* The bordered shell reuses `formsBaseTheme`'s inset-box-shadow border and state
|
|
7
|
+
* variants verbatim, so the editor's resting/hover/focus/invalid edges are
|
|
8
|
+
* pixel-identical to Input, Textarea and Select (CLAUDE.md §9).
|
|
63
9
|
*
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.getPropertyValue(cssVar)
|
|
72
|
-
.trim();
|
|
73
|
-
return resolved || `var(${cssVar})`;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* The two non-family base colors users always reach for, shown in their own row
|
|
77
|
-
* above the spectrum.
|
|
78
|
-
*
|
|
79
|
-
* `value` is the resolved background color (used to paint the swatch);
|
|
80
|
-
* `token` is the Tailwind shade fragment used to build the `text-{token}`
|
|
81
|
-
* class applied to the editor content.
|
|
82
|
-
*/
|
|
83
|
-
const MONO_COLORS = [
|
|
84
|
-
{ name: "white", value: "#ffffff", token: "white" },
|
|
85
|
-
{ name: "black", value: "#000000", token: "black" },
|
|
86
|
-
];
|
|
87
|
-
/**
|
|
88
|
-
* Rich Text Editor theme - extends common forms base theme for consistency
|
|
10
|
+
* 🔴 No typography or colour maps here, and no Tailwind "keepalive" sentinel.
|
|
11
|
+
* The previous implementation applied formatting via runtime `classList.add` of
|
|
12
|
+
* utility classes (`font-bold`, `text-rose-500`, `leading-relaxed`), which meant
|
|
13
|
+
* stored HTML only rendered correctly inside a Tailwind build that had scanned a
|
|
14
|
+
* 242-entry sentinel string. Formatting is now semantic markup, styled by the
|
|
15
|
+
* `[&_x]:` descendant rules below — so the content is portable and the CSS is
|
|
16
|
+
* bounded.
|
|
89
17
|
*/
|
|
90
18
|
const richTextEditorTheme = {
|
|
91
|
-
// Base container styles - inherited from common form theme
|
|
92
19
|
wrapperStyle: formsBaseTheme.wrapperStyle,
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
20
|
+
// The shell is a content-bearing container, so its radius is CAPPED (§3) — it
|
|
21
|
+
// must not scale uncapped with --radius-base the way a control does.
|
|
22
|
+
containerStyle: "relative flex flex-col overflow-hidden bg-[var(--field-fill)] " +
|
|
23
|
+
"rounded-[min(calc(var(--radius-base)*1.5),var(--surface-radius-cap-sm))] " +
|
|
24
|
+
"shadow-[inset_0_0_0_1px_var(--color-border)] " +
|
|
25
|
+
"focus-within:shadow-[inset_0_0_0_1px_var(--color-primary-600)] " +
|
|
26
|
+
"focus-within:ring-4 focus-within:ring-[var(--color-primary)]/10 " +
|
|
27
|
+
"not-focus-within:hover:shadow-[inset_0_0_0_1px_var(--color-border-secondary)] " +
|
|
28
|
+
"transition-[box-shadow] duration-[var(--motion-duration-fast)] " +
|
|
29
|
+
"dark:focus-within:shadow-[inset_0_0_0_1px_var(--color-primary-500)] " +
|
|
30
|
+
"dark:focus-within:ring-[var(--color-primary-500)]/20",
|
|
31
|
+
containerStates: {
|
|
32
|
+
default: "",
|
|
33
|
+
disabled: formsBaseTheme.states.disabled,
|
|
34
|
+
invalid: formsBaseTheme.states.invalid,
|
|
35
|
+
},
|
|
36
|
+
toolbarStyle: "flex flex-wrap items-center gap-1 p-1.5 " +
|
|
37
|
+
"border-b border-[var(--color-border)]",
|
|
38
|
+
// Descendant rules style the semantic markup the editor produces. This is the
|
|
39
|
+
// ONLY place editor content is styled — nothing is written into the HTML.
|
|
40
|
+
editorStyle: "w-full overflow-y-auto outline-none text-[var(--color-text-primary)] " +
|
|
41
|
+
"focus:outline-none " +
|
|
42
|
+
"[&_h1]:text-2xl [&_h1]:font-semibold [&_h1]:mb-2 " +
|
|
43
|
+
"[&_h2]:text-xl [&_h2]:font-semibold [&_h2]:mb-2 " +
|
|
44
|
+
"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-1.5 " +
|
|
45
|
+
"[&_h4]:text-base [&_h4]:font-semibold [&_h4]:mb-1.5 " +
|
|
46
|
+
"[&_p]:mb-2 last:[&_p]:mb-0 " +
|
|
47
|
+
"[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:mb-2 " +
|
|
48
|
+
"[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:mb-2 " +
|
|
49
|
+
"[&_li]:mb-0.5 " +
|
|
50
|
+
"[&_a]:text-[var(--color-primary)] [&_a]:underline [&_a]:underline-offset-2 " +
|
|
51
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-[var(--color-border-secondary)] " +
|
|
52
|
+
"[&_blockquote]:pl-3 [&_blockquote]:text-[var(--color-text-secondary)] [&_blockquote]:mb-2 " +
|
|
53
|
+
"[&_code]:rounded-[var(--radius-base)] [&_code]:bg-[var(--color-surface-sunken)] " +
|
|
54
|
+
"[&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.9em] " +
|
|
55
|
+
"[&_pre]:rounded-[min(calc(var(--radius-base)*1.5),var(--surface-radius-cap-xs))] " +
|
|
56
|
+
"[&_pre]:bg-[var(--color-surface-sunken)] [&_pre]:p-3 [&_pre]:mb-2 [&_pre]:overflow-x-auto",
|
|
57
|
+
editorSizes: {
|
|
58
|
+
sm: "px-[var(--form-px-sm)] py-[var(--form-py-sm)] text-[length:var(--form-text-size-sm)]/[var(--form-line-height-sm)]",
|
|
59
|
+
md: "px-[var(--form-px-md)] py-[var(--form-py-md)] text-[length:var(--form-text-size-md)]/[var(--form-line-height-md)]",
|
|
60
|
+
lg: "px-[var(--form-px-lg)] py-[var(--form-py-lg)] text-[length:var(--form-text-size-lg)]/[var(--form-line-height-lg)]",
|
|
122
61
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
|
|
62
|
+
separatorStyle: "mx-0.5 h-5 w-px shrink-0 bg-[var(--color-border)]",
|
|
63
|
+
// `:empty` alone is unreliable in a contentEditable (browsers leave a stray
|
|
64
|
+
// <br>), so the editor sets data-empty from its own value check.
|
|
65
|
+
placeholderStyle: "before:content-[attr(data-placeholder)] before:pointer-events-none " +
|
|
66
|
+
"before:absolute before:text-[var(--color-text-placeholder)]",
|
|
67
|
+
helperTextStyle: "mt-1.5 text-xs text-[var(--color-text-secondary)]",
|
|
68
|
+
errorTextStyle: "mt-1.5 text-xs text-[var(--color-danger)]",
|
|
127
69
|
};
|
|
128
70
|
|
|
129
|
-
export {
|
|
71
|
+
export { richTextEditorTheme };
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SurfaceElevation } from '../../../theme/SurfaceContext';
|
|
3
2
|
/**
|
|
4
|
-
* Rich Text Editor component props
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @property {function} onChange - Callback when content changes
|
|
11
|
-
* @property {string} placeholder - Placeholder text when editor is empty
|
|
12
|
-
* @property {boolean} required - Whether the editor is required
|
|
13
|
-
* @property {number} minHeight - Minimum height of the editor in pixels
|
|
14
|
-
* @property {number} maxHeight - Maximum height of the editor in pixels
|
|
15
|
-
* @property {ToolbarConfig} toolbar - Toolbar configuration
|
|
3
|
+
* Rich Text Editor component props.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 Per CLAUDE.md §9, `className`, `ref` and `...rest` all target the PRIMARY
|
|
6
|
+
* FUNCTIONAL ELEMENT — here the contentEditable surface — exactly as `className`
|
|
7
|
+
* targets the inner `<input>` on `Input`. The wrapper, bordered shell and toolbar
|
|
8
|
+
* each get their own explicit prop.
|
|
16
9
|
*/
|
|
17
10
|
export interface RichTextEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'value'> {
|
|
18
11
|
/** The size of the editor */
|
|
@@ -29,63 +22,53 @@ export interface RichTextEditorProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
29
22
|
* unaffected/still shown as normal otherwise.
|
|
30
23
|
*/
|
|
31
24
|
errorMessage?: React.ReactNode;
|
|
32
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The HTML content value. Always sanitized before it reaches the DOM.
|
|
27
|
+
*
|
|
28
|
+
* Serialized as portable semantic HTML (`<h2>`, `<strong>`, `<ul>`) with no
|
|
29
|
+
* framework classes or inline styles, so stored content renders identically
|
|
30
|
+
* outside this library.
|
|
31
|
+
*/
|
|
33
32
|
value?: string;
|
|
34
|
-
/** Callback when content changes */
|
|
33
|
+
/** Callback when content changes. Receives sanitized HTML. */
|
|
35
34
|
onChange?: (value: string) => void;
|
|
36
35
|
/** Placeholder text when editor is empty */
|
|
37
36
|
placeholder?: string;
|
|
38
|
-
/**
|
|
37
|
+
/** Class name for the editable surface (the primary element). */
|
|
39
38
|
className?: string;
|
|
39
|
+
/** Class name for the outer wrapper (label + field + helper text). */
|
|
40
|
+
wrapperClassName?: string;
|
|
41
|
+
/** Class name for the bordered editor shell (toolbar + editable surface). */
|
|
42
|
+
containerClassName?: string;
|
|
43
|
+
/** Class name for the toolbar. */
|
|
44
|
+
toolbarClassName?: string;
|
|
40
45
|
/** Additional class name for the label */
|
|
41
46
|
labelClassName?: string;
|
|
42
47
|
/** Additional class name for the helper text */
|
|
43
48
|
helperTextClassName?: string;
|
|
44
|
-
/** Additional class name for the wrapper */
|
|
45
|
-
wrapperClassName?: string;
|
|
46
|
-
/** Additional class name for the editor container */
|
|
47
|
-
editorClassName?: string;
|
|
48
49
|
/** Whether the editor is required */
|
|
49
50
|
required?: boolean;
|
|
50
|
-
/** Minimum height of the
|
|
51
|
+
/** Minimum height of the editable surface in pixels */
|
|
51
52
|
minHeight?: number;
|
|
52
|
-
/** Maximum height of the
|
|
53
|
+
/** Maximum height of the editable surface in pixels */
|
|
53
54
|
maxHeight?: number;
|
|
54
55
|
/** Toolbar configuration */
|
|
55
56
|
toolbar?: ToolbarConfig;
|
|
56
57
|
/** Component-level theme overrides */
|
|
57
58
|
theme?: RichTextEditorThemeOverrides;
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* Whether the editor should lazy-load Google Fonts when picked.
|
|
66
|
-
* Defaults to `true`. Set to `false` if you load fonts yourself
|
|
67
|
-
* (e.g. via `next/font` or a `<link>` in your app head) — the picker still
|
|
68
|
-
* applies the font, but no network request is fired.
|
|
69
|
-
*/
|
|
70
|
-
loadFontsOnDemand?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Optional HTML sanitizer function applied before setting innerHTML.
|
|
73
|
-
* Receives raw HTML string, must return sanitized HTML string.
|
|
74
|
-
* Recommended: pass DOMPurify.sanitize for robust XSS protection.
|
|
75
|
-
* If not provided, a basic built-in sanitizer strips script tags and on* event handlers.
|
|
60
|
+
* Optional HTML sanitizer, replacing the built-in one on every write path
|
|
61
|
+
* (`value`, paste, drop, and the value handed to `onChange`).
|
|
62
|
+
*
|
|
63
|
+
* The built-in sanitizer is a strict deny-by-default allowlist and is safe for
|
|
64
|
+
* content authored in this editor. If you render hostile third-party HTML,
|
|
65
|
+
* pass a hardened sanitizer instead.
|
|
76
66
|
*
|
|
77
67
|
* @example
|
|
78
68
|
* import DOMPurify from 'dompurify';
|
|
79
69
|
* <RichTextEditor sanitize={DOMPurify.sanitize} />
|
|
80
70
|
*/
|
|
81
71
|
sanitize?: (html: string) => string;
|
|
82
|
-
/**
|
|
83
|
-
* Pin the floating toolbar / dropdown surface elevation rung (overrides the
|
|
84
|
-
* automatic relative lift) — a rung number (1–8) or a semantic alias.
|
|
85
|
-
*/
|
|
86
|
-
elevation?: SurfaceElevation;
|
|
87
|
-
/** `false` opts out of the relative lift — paints at the floating surface's base rung. */
|
|
88
|
-
lift?: boolean;
|
|
89
72
|
}
|
|
90
73
|
export type RichTextEditorSize = 'sm' | 'md' | 'lg';
|
|
91
74
|
export type RichTextEditorState = 'default' | 'disabled' | 'invalid';
|
|
@@ -95,107 +78,60 @@ export type RichTextEditorState = 'default' | 'disabled' | 'invalid';
|
|
|
95
78
|
export interface ToolbarConfig {
|
|
96
79
|
/** Whether to show the toolbar */
|
|
97
80
|
show?: boolean;
|
|
98
|
-
/**
|
|
99
|
-
position?: 'top' | 'floating';
|
|
100
|
-
/** Which tools to show in the toolbar */
|
|
81
|
+
/** Which tools to show, in order. Defaults to `DEFAULT_TOOLBAR_TOOLS`. */
|
|
101
82
|
tools?: ToolbarTool[];
|
|
102
83
|
/** Custom toolbar className */
|
|
103
84
|
className?: string;
|
|
104
85
|
}
|
|
105
86
|
/**
|
|
106
|
-
* Available toolbar tools
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* - `family` is the canonical Google Fonts family name (used to build the load URL).
|
|
113
|
-
* Omit for system fonts (e.g. "Default" or "Sans") — they will not be lazy-loaded.
|
|
114
|
-
* - `stack` is the CSS font-family value applied to the selection. Always include
|
|
115
|
-
* safe fallbacks so text remains readable while the font is loading.
|
|
116
|
-
* - `weights` is the optional list of weights to request (defaults to all 9).
|
|
87
|
+
* Available toolbar tools.
|
|
88
|
+
*
|
|
89
|
+
* Deliberately semantic: this editor produces meaning (headings, lists, quotes),
|
|
90
|
+
* not typography. Font family/size/weight/colour controls were removed — they
|
|
91
|
+
* forced formatting to serialize as framework utility classes, which made stored
|
|
92
|
+
* content unrenderable outside a Tailwind context.
|
|
117
93
|
*/
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
stack: string;
|
|
122
|
-
family?: string;
|
|
123
|
-
weights?: number[];
|
|
124
|
-
}
|
|
125
|
-
export type RichTextFontSizeKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
126
|
-
export type RichTextFontWeightKey = 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
|
|
127
|
-
export type RichTextLineHeightKey = 'tight' | 'snug' | 'normal' | 'relaxed' | 'loose';
|
|
128
|
-
export type RichTextLetterSpacingKey = 'tighter' | 'tight' | 'normal' | 'wide' | 'wider' | 'widest';
|
|
94
|
+
export type ToolbarTool = 'blockStyle' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'link' | 'bulletList' | 'orderedList' | 'blockquote' | 'code' | 'clearFormat' | 'undo' | 'redo' | 'separator';
|
|
95
|
+
/** Block-level style applied to the selection's containing block. */
|
|
96
|
+
export type BlockStyle = 'paragraph' | 'h1' | 'h2' | 'h3' | 'h4';
|
|
129
97
|
/**
|
|
130
|
-
*
|
|
98
|
+
* The formatting active at the current selection.
|
|
99
|
+
*
|
|
100
|
+
* Read by walking the selection's ancestors (see `editorState.ts`) rather than
|
|
101
|
+
* via `document.queryCommandState`, which is unreliable for block-level state.
|
|
131
102
|
*/
|
|
132
103
|
export interface FormattingState {
|
|
133
104
|
bold: boolean;
|
|
134
105
|
italic: boolean;
|
|
135
106
|
underline: boolean;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
107
|
+
strikethrough: boolean;
|
|
108
|
+
bulletList: boolean;
|
|
109
|
+
orderedList: boolean;
|
|
110
|
+
blockquote: boolean;
|
|
111
|
+
code: boolean;
|
|
112
|
+
/** `href` of the anchor containing the selection, or `null`. */
|
|
113
|
+
link: string | null;
|
|
114
|
+
block: BlockStyle;
|
|
143
115
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Color palette for text color picker
|
|
146
|
-
*/
|
|
147
|
-
export interface ColorOption {
|
|
148
|
-
label: string;
|
|
149
|
-
value: string;
|
|
150
|
-
className: string;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Theme overrides for the RichTextEditor component
|
|
154
|
-
*/
|
|
155
116
|
export interface RichTextEditorThemeOverrides {
|
|
156
|
-
/** Base wrapper style */
|
|
157
117
|
wrapperStyle?: string;
|
|
158
|
-
/** Editor container style */
|
|
159
118
|
containerStyle?: string;
|
|
160
|
-
/** ContentEditable element style */
|
|
161
|
-
editorStyle?: string;
|
|
162
|
-
/** Toolbar container style (docked variant) */
|
|
163
119
|
toolbarStyle?: string;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
sizes?: Partial<Record<RichTextEditorSize, string>>;
|
|
170
|
-
/** State variants */
|
|
171
|
-
states?: {
|
|
172
|
-
default?: string;
|
|
173
|
-
disabled?: string;
|
|
174
|
-
invalid?: string;
|
|
175
|
-
};
|
|
176
|
-
/** Helper text style */
|
|
177
|
-
helperText?: string;
|
|
120
|
+
editorStyle?: string;
|
|
121
|
+
separatorStyle?: string;
|
|
122
|
+
placeholderStyle?: string;
|
|
123
|
+
helperTextStyle?: string;
|
|
124
|
+
errorTextStyle?: string;
|
|
178
125
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Complete theme structure for RichTextEditor component
|
|
181
|
-
*/
|
|
182
126
|
export interface RichTextEditorTheme {
|
|
183
127
|
wrapperStyle: string;
|
|
184
128
|
containerStyle: string;
|
|
185
|
-
|
|
129
|
+
containerStates: Record<RichTextEditorState, string>;
|
|
186
130
|
toolbarStyle: string;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
dropdownStyle: string;
|
|
190
|
-
dropdownItemStyle: string;
|
|
131
|
+
editorStyle: string;
|
|
132
|
+
editorSizes: Record<RichTextEditorSize, string>;
|
|
191
133
|
separatorStyle: string;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
states: {
|
|
196
|
-
default: string;
|
|
197
|
-
disabled: string;
|
|
198
|
-
invalid: string;
|
|
199
|
-
};
|
|
200
|
-
helperText: string;
|
|
134
|
+
placeholderStyle: string;
|
|
135
|
+
helperTextStyle: string;
|
|
136
|
+
errorTextStyle: string;
|
|
201
137
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RichTextLinkFieldProps {
|
|
3
|
+
/** Existing href when editing a link, `null` when creating one. */
|
|
4
|
+
initialHref: string | null;
|
|
5
|
+
onApply: (href: string) => void;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Inline link editor, revealed under the toolbar.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately NOT a portaled popover: this row appears while the user's text
|
|
14
|
+
* selection must stay intact, and an anchored overlay adds focus-restore and
|
|
15
|
+
* placement problems for no benefit at this size. The row takes focus on open
|
|
16
|
+
* and returns it to the editor when it closes.
|
|
17
|
+
*/
|
|
18
|
+
export declare const RichTextLinkField: React.FC<RichTextLinkFieldProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { Check, Trash, X } from '@phosphor-icons/react';
|
|
5
|
+
import { Button } from '../../core/Button/Button.js';
|
|
6
|
+
import { Input } from '../Input/Input.js';
|
|
7
|
+
import '../Input/Input.theme.js';
|
|
8
|
+
import { cn } from '../../../utils/cn.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Inline link editor, revealed under the toolbar.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately NOT a portaled popover: this row appears while the user's text
|
|
14
|
+
* selection must stay intact, and an anchored overlay adds focus-restore and
|
|
15
|
+
* placement problems for no benefit at this size. The row takes focus on open
|
|
16
|
+
* and returns it to the editor when it closes.
|
|
17
|
+
*/
|
|
18
|
+
const RichTextLinkField = ({ initialHref, onApply, onRemove, onCancel, className, }) => {
|
|
19
|
+
const [href, setHref] = useState(initialHref !== null && initialHref !== void 0 ? initialHref : "");
|
|
20
|
+
const inputRef = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
24
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.select();
|
|
25
|
+
}, []);
|
|
26
|
+
const apply = () => {
|
|
27
|
+
const trimmed = href.trim();
|
|
28
|
+
if (trimmed)
|
|
29
|
+
onApply(trimmed);
|
|
30
|
+
else
|
|
31
|
+
onCancel();
|
|
32
|
+
};
|
|
33
|
+
return (jsxs("div", { className: cn("flex items-center gap-1.5 border-b border-[var(--color-border)] p-1.5", className), children: [jsx(Input, { ref: inputRef, size: "sm", type: "url", value: href, placeholder: "https://example.com", "aria-label": "Link URL", inputGroupClassName: "flex-1", onValueChange: setHref, onKeyDown: (event) => {
|
|
34
|
+
if (event.key === "Enter") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
apply();
|
|
37
|
+
}
|
|
38
|
+
else if (event.key === "Escape") {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
onCancel();
|
|
41
|
+
}
|
|
42
|
+
} }), jsx(Button, { type: "button", iconOnly: true, size: "sm", variant: "ghost", color: "mono", "aria-label": "Apply link", iconStart: jsx(Check, {}), onClick: apply }), initialHref !== null && (jsx(Button, { type: "button", iconOnly: true, size: "sm", variant: "ghost", color: "danger", "aria-label": "Remove link", iconStart: jsx(Trash, {}), onClick: onRemove })), jsx(Button, { type: "button", iconOnly: true, size: "sm", variant: "ghost", color: "mono", "aria-label": "Cancel", iconStart: jsx(X, {}), onClick: onCancel })] }));
|
|
43
|
+
};
|
|
44
|
+
RichTextLinkField.displayName = "RichTextLinkField";
|
|
45
|
+
|
|
46
|
+
export { RichTextLinkField };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { BlockStyle, FormattingState, RichTextEditorSize, ToolbarTool } from "./RichTextEditor.types";
|
|
3
|
+
/** The compact default: block style, inline marks, links, lists, history. */
|
|
4
|
+
export declare const DEFAULT_TOOLBAR_TOOLS: ToolbarTool[];
|
|
5
|
+
export interface RichTextToolbarProps {
|
|
6
|
+
tools: ToolbarTool[];
|
|
7
|
+
formatting: FormattingState;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
size: RichTextEditorSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Invoked for every button-shaped tool. */
|
|
12
|
+
onCommand: (tool: Exclude<ToolbarTool, "blockStyle" | "separator">) => void;
|
|
13
|
+
onBlockChange: (block: BlockStyle) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const RichTextToolbar: React.FC<RichTextToolbarProps>;
|