@flikk/ui 1.0.0-beta.31 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +295 -22
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +2 -2
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.js +27 -3
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +58 -5
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +2 -1
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +13 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +3 -2
- package/dist/components/ai/index.js +4 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +0 -1
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +0 -1
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +3 -3
- package/dist/components/charts/AreaChart/AreaChart.theme.js +3 -3
- package/dist/components/charts/BarChart/BarChart.js +4 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +2 -2
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +1 -1
- package/dist/components/charts/LineChart/LineChart.js +2 -2
- package/dist/components/charts/LollipopChart/LollipopChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +3 -3
- package/dist/components/charts/hooks/useChartAccessibility.js +9 -6
- package/dist/components/charts/index.d.ts +4 -8
- package/dist/components/charts/index.js +2 -4
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +3 -3
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -19
- package/dist/components/core/Accordion/Accordion.theme.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -4
- package/dist/components/core/Alert/Alert.animations.js +11 -4
- package/dist/components/core/Alert/Alert.js +16 -2
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -84
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +27 -64
- package/dist/components/core/Badge/Badge.theme.js +8 -12
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +4 -4
- package/dist/components/core/Button/Button.js +7 -43
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/Button/Button.types.d.ts +8 -12
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +29 -1
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +21 -8
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.js +0 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Link/Link.js +1 -1
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +2 -0
- package/dist/components/core/Message/Message.theme.js +3 -3
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/ModalHeader.js +0 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -1
- package/dist/components/core/NavItem/NavItem.js +3 -2
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +4 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.js +2 -1
- package/dist/components/core/Pill/Pill.theme.js +4 -2
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.theme.js +1 -1
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +1 -1
- package/dist/components/core/Sidebar/SidebarSearch.js +2 -2
- package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.theme.js +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +6 -6
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +0 -1
- package/dist/components/data-display/KPI/KPI.js +11 -20
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.theme.js +4 -4
- package/dist/components/data-display/Table/Table.theme.js +2 -2
- package/dist/components/data-display/Table/TableColumnManager.js +1 -2
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableFilter.js +9 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.theme.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +1 -1
- package/dist/components/forms/Combobox/Combobox.js +2 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/Radio/Radio.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1680
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +70 -7
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.js +2 -1
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
- package/dist/components/forms/forms.theme.js +19 -5
- package/dist/components/forms/index.js +1 -0
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +10 -10
- package/dist/components/generative/schema.generated.js +178 -292
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +178 -292
- package/dist/index.js +1 -4
- package/dist/registry.json +2599 -2375
- package/dist/shadcn-compat.css +5 -5
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +179 -294
- package/dist/utils/index.d.ts +0 -1
- package/package.json +31 -1
- package/src/global.scss +21 -28
- package/src/styles/theme.css +124 -41
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +30 -20
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -208
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -60
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -19
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -26,7 +26,7 @@ export interface SelectBaseProps {
|
|
|
26
26
|
* Select component props
|
|
27
27
|
* @template T The type of the select value
|
|
28
28
|
*/
|
|
29
|
-
export interface
|
|
29
|
+
export interface SelectCommonProps<T = unknown> extends SelectBaseProps {
|
|
30
30
|
/** ID for the select component */
|
|
31
31
|
id?: string;
|
|
32
32
|
/** Name for the select component */
|
|
@@ -35,8 +35,6 @@ export interface SelectProps<T = unknown> extends SelectBaseProps {
|
|
|
35
35
|
size?: SelectSize;
|
|
36
36
|
/** Current state of the select component */
|
|
37
37
|
state?: SelectState;
|
|
38
|
-
/** Currently selected option */
|
|
39
|
-
value?: T;
|
|
40
38
|
/** Custom display value to show in trigger (overrides selected option label) */
|
|
41
39
|
displayValue?: React.ReactNode;
|
|
42
40
|
/** Placeholder text when no option is selected */
|
|
@@ -51,12 +49,8 @@ export interface SelectProps<T = unknown> extends SelectBaseProps {
|
|
|
51
49
|
label?: React.ReactNode;
|
|
52
50
|
/** Helper text below the select — pass a string for default styling, or a ReactNode for full control */
|
|
53
51
|
helperText?: React.ReactNode;
|
|
54
|
-
/** Enable multi-select mode — value becomes T[] and chips are rendered in trigger */
|
|
55
|
-
multiple?: boolean;
|
|
56
52
|
/** Maximum number of chips to display before showing "+N more" (default: 3) */
|
|
57
53
|
maxDisplayedChips?: number;
|
|
58
|
-
/** Called when the selection changes */
|
|
59
|
-
onChange?: (value: T) => void;
|
|
60
54
|
/** Called when the select receives focus */
|
|
61
55
|
onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
62
56
|
/** Called when the select loses focus */
|
|
@@ -113,7 +107,74 @@ export interface SelectProps<T = unknown> extends SelectBaseProps {
|
|
|
113
107
|
elevation?: SurfaceElevation;
|
|
114
108
|
/** `false` opts out of the relative lift — paints at the listbox's base rung. */
|
|
115
109
|
lift?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Accessible name for a Select with no visible `label` — e.g. a control sitting
|
|
112
|
+
* in a toolbar. `aria-labelledby` wins over this when both are present.
|
|
113
|
+
*
|
|
114
|
+
* 🔴 Declared explicitly because TypeScript does NOT check hyphenated JSX
|
|
115
|
+
* attributes against a component's props type: before this existed,
|
|
116
|
+
* `<Select aria-label="…" />` typechecked cleanly and was then dropped at
|
|
117
|
+
* runtime, leaving the trigger with no accessible name at all.
|
|
118
|
+
*/
|
|
119
|
+
"aria-label"?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Single-select props — the default mode.
|
|
123
|
+
* `value` is one `T` and `onChange` receives one `T`.
|
|
124
|
+
*/
|
|
125
|
+
export interface SelectSingleProps<T = unknown> extends SelectCommonProps<T> {
|
|
126
|
+
/** Enable multi-select mode. Omit or pass `false` for single-select. */
|
|
127
|
+
multiple?: false;
|
|
128
|
+
/**
|
|
129
|
+
* Currently selected option.
|
|
130
|
+
* 🔴 `NoInfer` matters: without it TS treats this as an inference site for `T`,
|
|
131
|
+
* so `<Select multiple value={["a"]} />` infers `T = string[]` from THIS branch
|
|
132
|
+
* and then demands `SelectOption<string[]>[]` for `options`. Inference must come
|
|
133
|
+
* from `options` alone; the value/onChange shapes follow from it.
|
|
134
|
+
*/
|
|
135
|
+
value?: NoInfer<T>;
|
|
136
|
+
/** Called when the selection changes */
|
|
137
|
+
onChange?: (value: NoInfer<T>) => void;
|
|
116
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Multi-select props — `multiple` is `true`, so `value` is an ARRAY and
|
|
141
|
+
* `onChange` receives the full next array (not the toggled item).
|
|
142
|
+
*/
|
|
143
|
+
export interface SelectMultipleProps<T = unknown> extends SelectCommonProps<T> {
|
|
144
|
+
/** Enable multi-select mode — chips are rendered in the trigger. */
|
|
145
|
+
multiple: true;
|
|
146
|
+
/** Currently selected options. `NoInfer` for the reason given on the single variant. */
|
|
147
|
+
value?: NoInfer<T>[];
|
|
148
|
+
/** Called with the complete next selection whenever it changes */
|
|
149
|
+
onChange?: (value: NoInfer<T>[]) => void;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Select component props — a discriminated union on `multiple`.
|
|
153
|
+
*
|
|
154
|
+
* 🔴 `value`/`onChange` change shape with the mode, which a single
|
|
155
|
+
* `value?: T` could not express: multi-select genuinely hands back a `T[]`.
|
|
156
|
+
* The implementation always did this and lied about it with
|
|
157
|
+
* `onChange?.(updated as unknown as T)`, so `<Select multiple value={["a"]} />`
|
|
158
|
+
* — correct usage, and what the JSDoc documented — failed to type-check while
|
|
159
|
+
* `onChange` handlers were silently typed as the element type instead of the
|
|
160
|
+
* array. Narrow with `multiple` to get the right shape on both.
|
|
161
|
+
*
|
|
162
|
+
* @template T The type of an individual option value (NOT the array)
|
|
163
|
+
*/
|
|
164
|
+
export type SelectProps<T = unknown> = SelectSingleProps<T> | SelectMultipleProps<T>;
|
|
165
|
+
/**
|
|
166
|
+
* @internal Widened shape the implementation destructures. A union cannot be
|
|
167
|
+
* destructured and then called (`onChange` would be a union of incompatible
|
|
168
|
+
* signatures), so the mode-dependent members are widened exactly once, here,
|
|
169
|
+
* and the public `Select` export casts back to the precise union. This is the
|
|
170
|
+
* single sanctioned cast — it replaces three `as unknown as T` casts that
|
|
171
|
+
* previously misreported the runtime contract to consumers.
|
|
172
|
+
*/
|
|
173
|
+
export type SelectInternalProps<T = unknown> = SelectCommonProps<T> & {
|
|
174
|
+
multiple?: boolean;
|
|
175
|
+
value?: T | T[];
|
|
176
|
+
onChange?: (value: T | T[]) => void;
|
|
177
|
+
};
|
|
117
178
|
/**
|
|
118
179
|
* Select button props
|
|
119
180
|
*/
|
|
@@ -148,6 +209,8 @@ export interface SelectButtonProps extends SelectBaseProps {
|
|
|
148
209
|
"aria-describedby"?: string;
|
|
149
210
|
/** ID of the element that labels this button (e.g. form label) */
|
|
150
211
|
"aria-labelledby"?: string;
|
|
212
|
+
/** Accessible name for a Select with no visible `label` (e.g. a toolbar control) */
|
|
213
|
+
"aria-label"?: string;
|
|
151
214
|
/** Structural content rendered before iconStart */
|
|
152
215
|
contentStart?: React.ReactNode;
|
|
153
216
|
/** Structural content rendered after iconEnd */
|
|
@@ -5,10 +5,16 @@ import type { SelectOption } from "./Select.types";
|
|
|
5
5
|
export interface UseSelectStateProps<T = any> {
|
|
6
6
|
/** Array of available options */
|
|
7
7
|
options: SelectOption<T>[];
|
|
8
|
-
/** Currently selected value (controlled) */
|
|
9
|
-
value?: T;
|
|
8
|
+
/** Currently selected value (controlled). `T[]` when `multiple` is set. */
|
|
9
|
+
value?: T | T[];
|
|
10
10
|
/** Callback when selection changes */
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Called when the selection changes. In `multiple` mode the payload is the
|
|
13
|
+
* complete next `T[]`, not the toggled item — which is why this is widened
|
|
14
|
+
* rather than `(value: T) => void`. The public `SelectProps` union narrows it
|
|
15
|
+
* back to the exact shape per mode.
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (value: T | T[]) => void;
|
|
12
18
|
/** Whether filtering/search is enabled */
|
|
13
19
|
searchable?: boolean;
|
|
14
20
|
/** Whether new options can be created */
|
|
@@ -23,7 +23,10 @@ import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
|
23
23
|
function useSelectState({ options = [], value, onChange, searchable = false, creatable = false, onCreateOption, createLabel, enableTypeahead = true, multiple = false, }) {
|
|
24
24
|
// Core state
|
|
25
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
26
|
-
|
|
26
|
+
// `value` is widened to `T | T[]` because multi-select hands back an array;
|
|
27
|
+
// this single-value slot only ever holds the non-array branch (the array lives
|
|
28
|
+
// in `selectedValues` below), matching the Array.isArray idiom used throughout.
|
|
29
|
+
const [selectedValue, setSelectedValue] = useState(Array.isArray(value) ? undefined : value);
|
|
27
30
|
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
28
31
|
const [searchValue, setSearchValue] = useState("");
|
|
29
32
|
// Multi-select state
|
|
@@ -5,6 +5,7 @@ import { useReducedMotion, motion } from 'motion/react';
|
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { Radio } from '../Radio/Radio.js';
|
|
7
7
|
import { Checkbox } from '../Checkbox/Checkbox.js';
|
|
8
|
+
import { Ripple } from '../../core/shared/Ripple.js';
|
|
8
9
|
import { useOptionalSelectableCardContext } from './SelectableCardContext.js';
|
|
9
10
|
import { selectableCardTheme } from './SelectableCard.theme.js';
|
|
10
11
|
import { SelectableCardGroup } from './SelectableCardGroup.js';
|
|
@@ -63,7 +64,7 @@ const SelectableCardRoot = React__default.forwardRef(({ value, disabled: cardDis
|
|
|
63
64
|
? { variants: cardVariants, animate: "rest", whileTap: "press" }
|
|
64
65
|
: {};
|
|
65
66
|
const indicatorNode = resolvedIndicator !== "none" && (jsx("div", { className: cn(theme.indicator, "pointer-events-none"), "aria-hidden": "true", children: resolvedIndicator === "radio" ? (jsx(Radio, { value: value, checked: isSelected, onChange: () => { }, state: isDisabled ? "disabled" : "default", size: indicatorSize })) : (jsx(Checkbox, { value: value, checked: isSelected, onChange: () => { }, state: isDisabled ? "disabled" : "default", size: indicatorSize })) }));
|
|
66
|
-
return (jsxs(motion.div, { ref: ref, role: role, "aria-checked": isSelected, "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, "data-selected": isSelected, "data-disabled": isDisabled || undefined, className: cn(theme.card, (_a = theme.cardSizes) === null || _a === void 0 ? void 0 : _a[resolvedSize], isSelected && theme.selectedCard, isDisabled && theme.disabledCard, className), onClick: handleClick, onKeyDown: handleKeyDown, ...motionProps, ...props, children: [jsx("input", { type: inputType, id: inputId, name: isStandalone ? undefined : ctx === null || ctx === void 0 ? void 0 : ctx.name, value: value, checked: isSelected, disabled: isDisabled, onChange: () => { }, className: "sr-only", tabIndex: -1, "aria-hidden": true }), resolvedIndicatorPosition === "start" && indicatorNode, jsx("div", { className: theme.contentWrapper, children: children }), resolvedIndicatorPosition === "end" && indicatorNode] }));
|
|
67
|
+
return (jsxs(motion.div, { ref: ref, role: role, "aria-checked": isSelected, "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, "data-selected": isSelected, "data-disabled": isDisabled || undefined, className: cn(theme.card, (_a = theme.cardSizes) === null || _a === void 0 ? void 0 : _a[resolvedSize], isSelected && theme.selectedCard, isDisabled && theme.disabledCard, className), onClick: handleClick, onKeyDown: handleKeyDown, ...motionProps, ...props, children: [jsx("input", { type: inputType, id: inputId, name: isStandalone ? undefined : ctx === null || ctx === void 0 ? void 0 : ctx.name, value: value, checked: isSelected, disabled: isDisabled, onChange: () => { }, className: "sr-only", tabIndex: -1, "aria-hidden": true }), resolvedIndicatorPosition === "start" && indicatorNode, jsx("div", { className: theme.contentWrapper, children: children }), resolvedIndicatorPosition === "end" && indicatorNode, jsx(Ripple, { disabled: isDisabled })] }));
|
|
67
68
|
});
|
|
68
69
|
SelectableCardRoot.displayName = "SelectableCard";
|
|
69
70
|
// ─── Compound Export ─────────────────────────────────────────────────────────
|
|
@@ -2,7 +2,7 @@ const selectableCardTheme = {
|
|
|
2
2
|
group: "flex flex-col gap-3",
|
|
3
3
|
card:
|
|
4
4
|
// Base layout — no justify-between; indicator position handled by render order
|
|
5
|
-
"relative flex items-start gap-3 rounded-[var(--radius-base)] cursor-pointer transition-[border-color,background-color,box-shadow,outline] duration-
|
|
5
|
+
"relative flex items-start gap-3 rounded-[var(--radius-base)] cursor-pointer transition-[border-color,background-color,box-shadow,outline] duration-[var(--motion-duration-base)] " +
|
|
6
6
|
// Default state
|
|
7
7
|
"border border-[var(--color-border)] bg-[var(--color-surface)] " +
|
|
8
8
|
"dark:bg-[var(--color-background)] " +
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const switchTheme = {
|
|
13
13
|
container: "flex w-full justify-between items-center gap-4",
|
|
14
14
|
// Structural base only — no state colors (those live in `trackStates`)
|
|
15
|
-
track: "group rounded-full cursor-pointer shadow-inner-real-sm transition-colors duration-
|
|
15
|
+
track: "group rounded-full cursor-pointer shadow-inner-real-sm transition-colors duration-[var(--motion-duration-slowest)] motion-reduce:transition-none outline-1 outline-[var(--color-border)] peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-[var(--color-primary-600)]",
|
|
16
16
|
// Resolved in JS and layered via cn() so later keys win (tailwind-merge dedupes bg-*).
|
|
17
17
|
// No `invalid` key: a switch is binary — on and off are both valid values, so there is
|
|
18
18
|
// nothing to validate. (See §9 carve-out: invalid only applies to controls with a value.)
|
|
@@ -25,7 +25,7 @@ const switchTheme = {
|
|
|
25
25
|
// off-track, which is never white). ON state: Switch.tsx swaps the fill to
|
|
26
26
|
// --color-primary-contrast so the knob stays visible on any primary track — white
|
|
27
27
|
// on a dark primary, dark on a light primary (the near-white-primary case).
|
|
28
|
-
thumb: "rounded-full bg-gradient-to-b from-neutral-200 via-neutral-50 to-white shadow-real-lg border-t border-white/80 dark:border-white/20 transition-shadow duration-
|
|
28
|
+
thumb: "rounded-full bg-gradient-to-b from-neutral-200 via-neutral-50 to-white shadow-real-lg border-t border-white/80 dark:border-white/20 transition-shadow duration-[var(--motion-duration-slow)] motion-reduce:transition-none",
|
|
29
29
|
description: "text-sm text-[var(--color-text-muted)] -mt-1.5",
|
|
30
30
|
trackSizes: {
|
|
31
31
|
sm: "w-9 h-5",
|
|
@@ -35,7 +35,7 @@ const timePickerTheme = {
|
|
|
35
35
|
// Selected value text style
|
|
36
36
|
valueTextStyle: "text-[var(--color-text-primary)]",
|
|
37
37
|
// Clear button styles (positioned between left content and right icon)
|
|
38
|
-
clearButtonStyle: "absolute right-8 top-1/2 -translate-y-1/2 p-1 rounded text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-
|
|
38
|
+
clearButtonStyle: "absolute right-8 top-1/2 -translate-y-1/2 p-1 rounded text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-surface)] transition-colors z-10",
|
|
39
39
|
// Dropdown container styles (TimePicker-specific)
|
|
40
40
|
// Width is controlled by trigger size via estimatedWidth parameter
|
|
41
41
|
dropdownStyle: "fixed z-[1000] backdrop-blur-md border border-[var(--color-border)] rounded-[var(--form-radius)] shadow-lg overflow-hidden",
|
|
@@ -48,7 +48,7 @@ const TimePickerTrigger = ({ id, disabled, isOpen, state = 'default', size = 'md
|
|
|
48
48
|
), children: [jsxs("div", { className: "relative flex-1", children: [jsx("input", { ref: inputRef, id: id, type: "text", inputMode: "numeric", value: inputValue, onChange: (e) => onInputChange(e.target.value), onFocus: onInputFocus, onKeyDown: onInputKeyDown, placeholder: placeholder, maxLength: 5, disabled: disabled, className: cn(inputStyle, sizeStyle, hasStartIcon && iconStartPadding), role: "combobox", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-controls": dialogId, "aria-label": "Enter time", "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, autoComplete: "off" }), iconStart !== undefined ? (iconStart && jsx("div", { className: iconStartStyle, children: iconStart })) : (jsx("div", { className: iconStartStyle, children: jsx(Clock, { className: "h-4 w-4" }) }))] }), format === '12h' && (jsx("button", { type: "button", onClick: onPeriodToggle, disabled: disabled, className: cn(periodToggleStyle, "shrink-0"), "aria-label": `Toggle AM/PM, current: ${period}`, tabIndex: -1, children: period || 'AM' })), clearable && hasValue && !disabled && (jsx("button", { type: "button", onClick: (e) => {
|
|
49
49
|
e.stopPropagation();
|
|
50
50
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
51
|
-
}, className: "shrink-0 p-0.5 rounded text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-
|
|
51
|
+
}, className: "shrink-0 p-0.5 rounded text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-surface)] transition-colors", "aria-label": "Clear time", tabIndex: -1, children: jsx(X, { className: "w-4 h-4" }) })), iconEnd !== undefined ? (iconEnd && (jsx("span", { className: "shrink-0 flex items-center pr-3 pointer-events-none text-[var(--color-text-muted)]", children: iconEnd }))) : (jsx("span", { className: "shrink-0 flex items-center pr-3 pointer-events-none text-[var(--color-text-muted)]", children: jsx(CaretUpDown, { className: "h-4 w-4" }) }))] }) }));
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export { TimePickerTrigger };
|
|
@@ -130,13 +130,19 @@ const formsBaseTheme = {
|
|
|
130
130
|
// (utilities layer ⟶ win over that base-layer rule) suppress it here; scroll still works via
|
|
131
131
|
// wheel/trackpad/keyboard. Scoped to the dropdown panel only — app scrollbars are untouched.
|
|
132
132
|
"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden " +
|
|
133
|
-
//
|
|
134
|
-
//
|
|
133
|
+
// Padding on ALL sides (never py-only): the rows are rounded (see `option`), so they must
|
|
134
|
+
// inset evenly — with vertical-only padding a row's rounded corners and its hover ring run
|
|
135
135
|
// flush into the panel's own edge and the radius reads as a rendering glitch. This lives
|
|
136
136
|
// here rather than at each call site because every consumer needs it and, when it was a
|
|
137
137
|
// call-site decision, two of four got it wrong.
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
// 🔴 --form-dropdown-padding, not a literal p-1: it also feeds
|
|
139
|
+
// --form-dropdown-inner-radius, which rounds the first/last row to match this panel's
|
|
140
|
+
// curve. A literal survives a themed radius change and silently breaks that.
|
|
141
|
+
"p-[var(--form-dropdown-padding)] " +
|
|
142
|
+
// --form-dropdown-radius, NOT --form-radius: this is a padded content container, so it
|
|
143
|
+
// needs a capped token. --form-radius is `var(--radius-base)` — the uncapped CONTROL
|
|
144
|
+
// radius — which on `ember` (base 24px) curved this panel 24px against 4px of padding.
|
|
145
|
+
"rounded-[var(--form-dropdown-radius)] backdrop-blur-md text-sm border border-[var(--color-border)] " +
|
|
140
146
|
"ring-1 ring-[var(--color-border)] focus:outline-none",
|
|
141
147
|
// Base option style — hover uses the shared `--color-surface-hover` interaction tint
|
|
142
148
|
// (§3): a translucent shade that composites over the dropdown's surface, darkening in
|
|
@@ -145,8 +151,16 @@ const formsBaseTheme = {
|
|
|
145
151
|
// The radius belongs here, not per-consumer: `container`'s gap-0.5 and this row's inset
|
|
146
152
|
// hover ring only read correctly on a rounded, inset row, so the base already assumes
|
|
147
153
|
// this treatment — withholding the radius just let call sites drift out of it.
|
|
154
|
+
// Radius mirrors the menu rows (MenuItem): interior rows are a flat 4px, and the two rows
|
|
155
|
+
// that MEET the panel's corners take --form-dropdown-inner-radius (the panel's radius minus
|
|
156
|
+
// its border and padding) so their curve is concentric with the panel's instead of bulging
|
|
157
|
+
// past it. It was a flat --radius-base on every row, which equalled the panel's own radius.
|
|
158
|
+
// 🔴 first:/last: resolve against DOM SIBLINGS — every consumer here renders its options as
|
|
159
|
+
// direct children of the panel (verified for Select/Combobox/InputTag/Mention). Wrapping
|
|
160
|
+
// them in a group element would make a row both first and last of its own subtree and round
|
|
161
|
+
// all four corners; see ContextMenuSub, which renders no element for exactly that reason.
|
|
148
162
|
option: "relative cursor-pointer select-none py-2 px-3 text-[var(--color-text-primary)] " +
|
|
149
|
-
"rounded-[var(--radius-
|
|
163
|
+
"rounded-[4px] first:rounded-t-[var(--form-dropdown-inner-radius)] last:rounded-b-[var(--form-dropdown-inner-radius)] " +
|
|
150
164
|
"hover:bg-[var(--color-surface-hover)] hover:shadow-[inset_0_0_0_1px_var(--color-border)]",
|
|
151
165
|
// Selected option modifier
|
|
152
166
|
optionSelected: "text-[var(--color-text-primary)] bg-[var(--color-surface-hover)] shadow-[inset_0_0_0_1px_var(--color-border)]",
|
|
@@ -40,6 +40,7 @@ export { sliderTheme } from './Slider/Slider.theme.js';
|
|
|
40
40
|
export { Signature } from './Signature/Signature.js';
|
|
41
41
|
export { signatureTheme } from './Signature/Signature.theme.js';
|
|
42
42
|
export { RichTextEditor } from './RichTextEditor/RichTextEditor.js';
|
|
43
|
+
import './RichTextEditor/RichTextToolbar.js';
|
|
43
44
|
export { richTextEditorTheme } from './RichTextEditor/RichTextEditor.theme.js';
|
|
44
45
|
export { InputOTP } from './InputOTP/InputOTP.js';
|
|
45
46
|
export { inputOTPTheme } from './InputOTP/InputOTP.theme.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormValues } from "./formScope";
|
|
3
|
+
export interface FormShellProps {
|
|
4
|
+
formId: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
/** Label for the auto-rendered submit button. @default "Submit" */
|
|
8
|
+
submitLabel?: string;
|
|
9
|
+
/** Heading for the blocked-submit error summary. */
|
|
10
|
+
errorSummaryTitle?: string;
|
|
11
|
+
values?: FormValues;
|
|
12
|
+
defaultValues?: FormValues;
|
|
13
|
+
onValuesChange?: (values: FormValues) => void;
|
|
14
|
+
onSubmit: (values: FormValues) => void;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generative-only form shell — the runtime half of the `Form` spec container.
|
|
19
|
+
* Sibling in spirit to `CardShell` in registry.tsx: it exists to serve the
|
|
20
|
+
* engine and is deliberately NOT a public library component.
|
|
21
|
+
*/
|
|
22
|
+
export declare function FormShell({ formId, title, description, submitLabel, errorSummaryTitle, values, defaultValues, onValuesChange, onSubmit, children, }: FormShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { WarningCircle } from '@phosphor-icons/react';
|
|
5
|
+
import { Button } from '../core/Button/Button.js';
|
|
6
|
+
import { cn } from '../../utils/cn.js';
|
|
7
|
+
import { useFormScopeState, FormScopeContext } from './formScope.js';
|
|
8
|
+
|
|
9
|
+
// SSR-safe layout effect (house shim — see src/hooks/useScaleBackground.ts):
|
|
10
|
+
// `useLayoutEffect` warns during server rendering, so it must not be called
|
|
11
|
+
// bare in an SSR-safe library (CLAUDE.md §6/§11).
|
|
12
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React__default.useLayoutEffect : React__default.useEffect;
|
|
13
|
+
/**
|
|
14
|
+
* Error-summary copy. Kept as props (not trapped strings) per CLAUDE.md §6:
|
|
15
|
+
* every built-in visible string must be overridable.
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_ERROR_SUMMARY_TITLE = "Please fix the following before continuing:";
|
|
18
|
+
/**
|
|
19
|
+
* Generative-only form shell — the runtime half of the `Form` spec container.
|
|
20
|
+
* Sibling in spirit to `CardShell` in registry.tsx: it exists to serve the
|
|
21
|
+
* engine and is deliberately NOT a public library component.
|
|
22
|
+
*/
|
|
23
|
+
function FormShell({ formId, title, description, submitLabel = "Submit", errorSummaryTitle = DEFAULT_ERROR_SUMMARY_TITLE, values, defaultValues, onValuesChange, onSubmit, children, }) {
|
|
24
|
+
const formRef = React__default.useRef(null);
|
|
25
|
+
const summaryRef = React__default.useRef(null);
|
|
26
|
+
const titleId = React__default.useId();
|
|
27
|
+
const summaryTitleId = React__default.useId();
|
|
28
|
+
// A blocked submit moves focus HERE, to the form-level summary — not to the
|
|
29
|
+
// first invalid control. That is a deliberate supersession of a per-field
|
|
30
|
+
// focus approach, and it is about coverage, not preference: only six of the
|
|
31
|
+
// thirteen curated controls even render a focusable primary element such a
|
|
32
|
+
// hook could target. Select/TimePicker spread no rest props onto one, and
|
|
33
|
+
// Combobox/Switch/Slider/InputOTP/InputTag land their root on a
|
|
34
|
+
// non-focusable wrapper `<div>`, where `.focus()` is a silent no-op.
|
|
35
|
+
// Closing that gap means changing those six core form components to
|
|
36
|
+
// forward a ref/rest props to their focusable element — a separate,
|
|
37
|
+
// dedicated pass, deferred and not yet started. Worse, the per-field
|
|
38
|
+
// *message* is thinner still: Switch and Rating render no error text and
|
|
39
|
+
// set no `aria-invalid` at all, so a required Switch ("accept the terms")
|
|
40
|
+
// produced a form whose Submit button did nothing, forever, with no
|
|
41
|
+
// programmatic state a screen reader could reach — a WCAG 3.3.1 failure.
|
|
42
|
+
// One summary covers all thirteen identically today and needs nothing from
|
|
43
|
+
// them. The per-field `state="invalid"` / `errorMessage` treatment still
|
|
44
|
+
// applies wherever a control declares those props (see FIELD_PROP_SUPPORT
|
|
45
|
+
// in GenerativeView.tsx); the summary is additive, not a replacement for it.
|
|
46
|
+
const [focusToken, setFocusToken] = React__default.useState(0);
|
|
47
|
+
const handleInvalid = React__default.useCallback(() => setFocusToken((t) => t + 1), []);
|
|
48
|
+
const scope = useFormScopeState({
|
|
49
|
+
formId,
|
|
50
|
+
values,
|
|
51
|
+
defaultValues,
|
|
52
|
+
onValuesChange,
|
|
53
|
+
onSubmit,
|
|
54
|
+
onInvalid: handleInvalid,
|
|
55
|
+
});
|
|
56
|
+
// Derived from `scope.errors` rather than held as its own state, so the
|
|
57
|
+
// summary clears itself the moment a user fixes a field (`setValue` drops
|
|
58
|
+
// that field's error) without a second source of truth to keep in sync.
|
|
59
|
+
const invalidNames = Object.keys(scope.errors);
|
|
60
|
+
// Focus after the summary has actually rendered: `onInvalid` fires inside
|
|
61
|
+
// `scope.submit()`, one React state update BEFORE `scope.errors` — and
|
|
62
|
+
// therefore the summary element — exists. A layout effect keyed on the token
|
|
63
|
+
// (not on `invalidNames`, which is unchanged when a second submit is blocked
|
|
64
|
+
// by the very same fields) re-focuses on every blocked attempt.
|
|
65
|
+
useIsomorphicLayoutEffect(() => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (focusToken > 0)
|
|
68
|
+
(_a = summaryRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
69
|
+
}, [focusToken]);
|
|
70
|
+
// A child submit button suppresses the auto-rendered one. Checked on the
|
|
71
|
+
// rendered DOM rather than by inspecting children, so it works for buttons
|
|
72
|
+
// nested inside container nodes the model wrapped them in. The query
|
|
73
|
+
// excludes the auto-rendered button itself (via its marker attribute) —
|
|
74
|
+
// otherwise the very button this effect renders would be picked up as
|
|
75
|
+
// "a child submit button" and immediately hide itself.
|
|
76
|
+
//
|
|
77
|
+
// Runs in a LAYOUT effect (not a passive one) so the correction lands
|
|
78
|
+
// before the browser paints: a passive effect fires after paint, so a
|
|
79
|
+
// caller supplying a real child submit button would flash both buttons
|
|
80
|
+
// for one frame before the auto one is hidden (the same mount-then-correct
|
|
81
|
+
// anti-pattern already documented for chart container measurement).
|
|
82
|
+
const [hasChildSubmit, setHasChildSubmit] = React__default.useState(false);
|
|
83
|
+
useIsomorphicLayoutEffect(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
const found = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('button[type="submit"]:not([data-generative-auto-submit])');
|
|
86
|
+
setHasChildSubmit(!!found);
|
|
87
|
+
}, [children]);
|
|
88
|
+
return (jsx(FormScopeContext.Provider, { value: scope, children: jsxs("form", { ref: formRef, noValidate: true, "aria-labelledby": title ? titleId : undefined, className: "flex flex-col gap-4", onSubmit: (e) => {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
scope.submit();
|
|
91
|
+
}, children: [title && (jsx("h3", { id: titleId, className: "text-base font-semibold text-[var(--color-text-primary)]", children: title })), description && (jsx("p", { className: "text-sm text-[var(--color-text-secondary)]", children: description })), invalidNames.length > 0 && (jsxs("div", { ref: summaryRef,
|
|
92
|
+
// `role="alert"` is an implicit assertive live region, so the list
|
|
93
|
+
// is announced even when focus does not land here (e.g. a consumer
|
|
94
|
+
// re-rendering the form). `tabIndex={-1}` makes it a programmatic
|
|
95
|
+
// focus target without adding a Tab stop.
|
|
96
|
+
role: "alert", tabIndex: -1, "aria-labelledby": summaryTitleId, className: cn("flex flex-col gap-1 rounded-[var(--alert-radius)] p-3 text-sm", "border border-[var(--color-danger-600)] dark:border-[var(--color-danger-400)]", "bg-[var(--color-danger-50)] dark:bg-[var(--color-danger-900)]/30", "text-[var(--color-danger-700)] dark:text-[var(--color-danger-300)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-danger)]"), children: [jsxs("p", { id: summaryTitleId, className: "flex items-center gap-2 font-medium", children: [jsx(WarningCircle, { className: "size-4 shrink-0", "aria-hidden": "true" }), errorSummaryTitle] }), jsx("ul", { className: "list-disc pl-9", children: invalidNames.map((name) => {
|
|
97
|
+
var _a;
|
|
98
|
+
return (jsxs("li", { children: [(_a = scope.getLabel(name)) !== null && _a !== void 0 ? _a : name, ": ", scope.errors[name]] }, name));
|
|
99
|
+
}) })] })), children, !hasChildSubmit && (jsx(Button, { type: "submit", variant: "filled", color: "primary", "data-generative-auto-submit": "", className: cn("self-start"), children: submitLabel }))] }) }));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { FormShell };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UISpec } from "./types";
|
|
2
2
|
import { GenerativeRegistry } from "./registry";
|
|
3
3
|
import { ActionHandler } from "./actions";
|
|
4
|
+
import { GenerativeValues } from "./formScope";
|
|
4
5
|
export interface GenerativeViewProps {
|
|
5
6
|
/** The serializable spec tree (one root or top-level siblings). */
|
|
6
7
|
spec: UISpec;
|
|
@@ -13,9 +14,59 @@ export interface GenerativeViewProps {
|
|
|
13
14
|
*/
|
|
14
15
|
onAction?: ActionHandler;
|
|
15
16
|
className?: string;
|
|
17
|
+
/** Controlled form values, keyed by form id then field name. */
|
|
18
|
+
values?: GenerativeValues;
|
|
19
|
+
/** Uncontrolled seed for form values. */
|
|
20
|
+
defaultValues?: GenerativeValues;
|
|
21
|
+
/** Fires with the complete next values bag whenever any field changes. */
|
|
22
|
+
onValuesChange?: (values: GenerativeValues) => void;
|
|
16
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Which props each curated field component actually DECLARES, and may
|
|
26
|
+
* therefore be handed. NOT every FIELD_BINDINGS entry supports all three —
|
|
27
|
+
* hand-verified against each component's OWN Props interface, not a sibling's
|
|
28
|
+
* (mirrors the same "don't infer from the name" caution as `fieldBinding.ts`'s
|
|
29
|
+
* own table):
|
|
30
|
+
* - Select/Combobox/Switch/Slider/TimePicker/InputTag accept `state` (for
|
|
31
|
+
* border styling) but declare NO `errorMessage` prop at all.
|
|
32
|
+
* - Checkbox accepts `state` but NOT `errorMessage` — `errorMessage` exists
|
|
33
|
+
* only on the separate `CheckboxGroupProps` (`Checkbox.Group`), not on
|
|
34
|
+
* `CheckboxProps` (what's actually registered/rendered here). Checkbox.tsx
|
|
35
|
+
* destructures known props and spreads the rest onto the native `<input>`
|
|
36
|
+
* (Checkbox.tsx:35,115), so this one is a real, reproducible DOM leak if
|
|
37
|
+
* gotten wrong, not a hypothetical — verified by reverting this row and
|
|
38
|
+
* confirming GenerativeView.test.tsx's Checkbox pinning test fails.
|
|
39
|
+
* - Rating has none of the three: it's a Core rating widget, not a
|
|
40
|
+
* FORMS_STANDARDS component.
|
|
41
|
+
* Forwarding a prop a component doesn't declare reaches the DOM as an
|
|
42
|
+
* unrecognized attribute (most of these spread unknown rest props onto
|
|
43
|
+
* their root element) and React logs it — see GenerativeView.test.tsx's
|
|
44
|
+
* "does not forward errorMessage/state to a control that doesn't declare
|
|
45
|
+
* them" tests (Switch and Checkbox each get their own).
|
|
46
|
+
*
|
|
47
|
+
* 🔴 `required` is on this table for FORWARDING ONLY. It is separately an
|
|
48
|
+
* ENGINE-SEMANTIC prop: `node.props.required` is read below to register the
|
|
49
|
+
* field's required-ness with the FormScope, which is what blocks submit —
|
|
50
|
+
* that happens for all 13 regardless of this table, and is why all 13 must
|
|
51
|
+
* declare `required` in the generated schema (see `REQUIRED_PROP` in
|
|
52
|
+
* packages/mcp/scripts/generativeManifest.ts). The four that decline it here
|
|
53
|
+
* (InputOTP/InputCounter/InputTag/Rating) extend
|
|
54
|
+
* `HTMLAttributes<HTMLDivElement>` and declare no `required` of their own, so
|
|
55
|
+
* forwarding would paint an invalid `required` attribute onto a `<div>` and
|
|
56
|
+
* buy nothing. Their required-ness is still enforced, and surfaced to the
|
|
57
|
+
* user by `FormShell`'s error summary rather than a per-field indicator.
|
|
58
|
+
* 🔴 The forwarding strip below is UNCONDITIONAL — it runs for every node,
|
|
59
|
+
* not only ones with a `name`/binding. A `required` prop with no `name` at
|
|
60
|
+
* all never registers with the scope, but it still rides along in `hydrated`
|
|
61
|
+
* and would otherwise reach a component's root element untouched.
|
|
62
|
+
*/
|
|
63
|
+
export declare const FIELD_PROP_SUPPORT: Record<string, {
|
|
64
|
+
state: boolean;
|
|
65
|
+
errorMessage: boolean;
|
|
66
|
+
required: boolean;
|
|
67
|
+
}>;
|
|
17
68
|
/**
|
|
18
69
|
* Render a serializable UINode spec with the given registry.
|
|
19
70
|
* Render-only in P1 — streaming (P3) and action dispatch (P4) layer on top.
|
|
20
71
|
*/
|
|
21
|
-
export declare function GenerativeView({ spec, registry, onAction, className, }: GenerativeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare function GenerativeView({ spec, registry, onAction, className, values, defaultValues, onValuesChange, }: GenerativeViewProps): import("react/jsx-runtime").JSX.Element;
|