@flikk/ui 1.0.0-beta.31 → 1.0.0-beta.33
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 +497 -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 +5 -5
- 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 +34 -18
- package/dist/components/core/Pill/Pill.theme.js +4 -2
- package/dist/components/core/Pill/Pill.types.d.ts +14 -1
- 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/SlidingNumber/SlidingNumber.d.ts +8 -0
- package/dist/components/core/SlidingNumber/SlidingNumber.js +12 -3
- 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/ColorPicker.js +45 -3
- package/dist/components/forms/ColorPicker/ColorPickerBody.js +8 -4
- 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 +10 -4
- package/dist/components/forms/Combobox/Combobox.theme.js +9 -0
- package/dist/components/forms/Combobox/Combobox.types.d.ts +13 -0
- package/dist/components/forms/DatePicker/DatePicker.js +19 -12
- package/dist/components/forms/DatePicker/DatePicker.theme.js +5 -0
- package/dist/components/forms/DatePicker/DatePicker.types.d.ts +8 -0
- package/dist/components/forms/DatePicker/DatePickerContext.d.ts +0 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +5 -3
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +6 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.types.d.ts +8 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +5 -3
- package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +17 -12
- package/dist/components/forms/Input/Input.theme.js +10 -0
- package/dist/components/forms/Input/Input.types.d.ts +14 -0
- package/dist/components/forms/InputAddress/InputAddress.js +5 -5
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +9 -2
- package/dist/components/forms/InputCounter/InputCounter.js +194 -17
- package/dist/components/forms/InputCounter/InputCounter.theme.d.ts +12 -0
- package/dist/components/forms/InputCounter/InputCounter.theme.js +92 -2
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +47 -4
- package/dist/components/forms/InputCreditCard/InputCreditCard.js +4 -4
- package/dist/components/forms/InputCreditCard/InputCreditCard.types.d.ts +7 -0
- package/dist/components/forms/Mention/Mention.js +13 -11
- 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 +174 -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 +19 -12
- package/dist/components/forms/Select/Select.theme.js +9 -1
- package/dist/components/forms/Select/Select.types.d.ts +86 -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.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/Textarea/Textarea.js +14 -25
- package/dist/components/forms/TimePicker/TimePicker.theme.js +10 -1
- package/dist/components/forms/TimePicker/TimePicker.types.d.ts +11 -0
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +7 -5
- package/dist/components/forms/forms.theme.d.ts +57 -0
- package/dist/components/forms/forms.theme.js +102 -13
- 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 +11 -10
- package/dist/components/generative/schema.generated.js +199 -293
- 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 +199 -293
- package/dist/index.js +1 -4
- package/dist/registry.json +2765 -2450
- 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 +200 -295
- package/dist/utils/composeEventHandlers.d.ts +19 -0
- package/dist/utils/composeEventHandlers.js +26 -0
- package/dist/utils/composeEventHandlers.test.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +31 -1
- package/src/global.scss +21 -28
- package/src/styles/theme.css +157 -50
- 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
|
@@ -51,8 +51,16 @@ const selectTheme = {
|
|
|
51
51
|
helperTextStates: formsBaseTheme.helperTextStates,
|
|
52
52
|
// Left icon style - inherited from common form theme
|
|
53
53
|
iconStartStyle: formsBaseTheme.iconStyles.left,
|
|
54
|
-
|
|
54
|
+
iconStartStyles: formsBaseTheme.iconStyles.leftSizes,
|
|
55
|
+
iconStartPaddings: formsBaseTheme.iconStyles.paddingLeftSizes,
|
|
56
|
+
// Right icon (the chevron) — size-aware: the slot insets from the control's
|
|
57
|
+
// own --form-px-*, the glyph ramps 12/14/16, and the text runway is reserved
|
|
58
|
+
// to match. Flat `pr-3` + `size-4` at every size left the sm chevron both
|
|
59
|
+
// oversized against 14px text and further from the edge than it looked.
|
|
55
60
|
iconEndStyle: formsBaseTheme.iconStyles.right,
|
|
61
|
+
iconEndStyles: formsBaseTheme.iconStyles.rightSizes,
|
|
62
|
+
iconEndSizes: formsBaseTheme.iconStyles.sizes,
|
|
63
|
+
iconEndPaddings: formsBaseTheme.iconStyles.paddingRightSizes,
|
|
56
64
|
// Check icon style for selected options
|
|
57
65
|
checkIconStyle: "absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--color-primary)] " +
|
|
58
66
|
"dark:text-[var(--color-primary-400)]",
|
|
@@ -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 */
|
|
@@ -240,8 +303,23 @@ export interface SelectThemeOverrides {
|
|
|
240
303
|
helperTextStates?: Partial<Record<SelectState, string>>;
|
|
241
304
|
/** Left icon style */
|
|
242
305
|
iconStartStyle?: string;
|
|
243
|
-
/**
|
|
306
|
+
/** Per-size left icon slot style (position + inset) */
|
|
307
|
+
iconStartStyles?: Partial<Record<SelectSize, string>>;
|
|
308
|
+
/** Per-size text runway reserved for the left icon */
|
|
309
|
+
iconStartPaddings?: Partial<Record<SelectSize, string>>;
|
|
310
|
+
/**
|
|
311
|
+
* Right icon slot style.
|
|
312
|
+
* @deprecated superseded by `iconEndStyles`, which insets the slot from the
|
|
313
|
+
* control's own `--form-px-*` instead of a flat `pr-3` at every size. Still
|
|
314
|
+
* honoured as a fallback when `iconEndStyles` has no entry for the size.
|
|
315
|
+
*/
|
|
244
316
|
iconEndStyle?: string;
|
|
317
|
+
/** Per-size right icon slot style (position + inset) */
|
|
318
|
+
iconEndStyles?: Partial<Record<SelectSize, string>>;
|
|
319
|
+
/** Per-size sizing for the built-in chevron */
|
|
320
|
+
iconEndSizes?: Partial<Record<SelectSize, string>>;
|
|
321
|
+
/** Per-size text runway reserved for the right icon */
|
|
322
|
+
iconEndPaddings?: Partial<Record<SelectSize, string>>;
|
|
245
323
|
/** Style for the check icon in selected options */
|
|
246
324
|
checkIconStyle?: string;
|
|
247
325
|
/** Icon padding styles */
|
|
@@ -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",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import React__default
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
import { FormLabel } from '../FormLabel/FormLabel.js';
|
|
5
5
|
import { textareaTheme } from './Textarea.theme.js';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
|
|
8
8
|
const Textarea = React__default.forwardRef(({ size = "md", state = "default", className = "", label, labelClassName = "", helperText, errorMessage, helperTextClassName = "", wrapperClassName = "", inputGroupClassName = "", id, theme = {}, required, rows = 3, cols, unstyled = false, onValueChange, ...props }, ref) => {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
10
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
11
10
|
const generatedId = React__default.useId();
|
|
12
11
|
const inputId = id || generatedId;
|
|
13
12
|
// Derived state flags for internal use
|
|
@@ -16,17 +15,20 @@ const Textarea = React__default.forwardRef(({ size = "md", state = "default", cl
|
|
|
16
15
|
// errorMessage takes precedence over helperText while invalid; helperText
|
|
17
16
|
// behavior is unchanged otherwise.
|
|
18
17
|
const displayedMessage = isInvalid && errorMessage ? errorMessage : helperText;
|
|
18
|
+
// Pull onChange out of props so the explicit handler below isn't overwritten
|
|
19
|
+
// by the spread, and wire it ONCE — 🔴 both render paths must use it. The
|
|
20
|
+
// `unstyled` early return below used to drop `onValueChange` entirely, so
|
|
21
|
+
// `value` + `onValueChange` + `unstyled` produced a permanently read-only
|
|
22
|
+
// textarea: React saw a controlled value with no onChange, warned, and
|
|
23
|
+
// nothing the user typed ever reached the consumer.
|
|
24
|
+
const { onChange: propsOnChange, ...restProps } = props;
|
|
25
|
+
const handleChange = (event) => {
|
|
26
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(event);
|
|
27
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(event.target.value);
|
|
28
|
+
};
|
|
19
29
|
// If unstyled, render only the textarea element
|
|
20
30
|
if (unstyled) {
|
|
21
|
-
return (jsx("textarea", { ref: ref, id: inputId, className: className, disabled: isDisabled, "aria-invalid": isInvalid, required: required, rows: rows, cols: cols,
|
|
22
|
-
var _a;
|
|
23
|
-
setIsFocused(true);
|
|
24
|
-
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
25
|
-
}, onBlur: (e) => {
|
|
26
|
-
var _a;
|
|
27
|
-
setIsFocused(false);
|
|
28
|
-
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
29
|
-
}, ...props }));
|
|
31
|
+
return (jsx("textarea", { ref: ref, id: inputId, className: className, disabled: isDisabled, "aria-invalid": isInvalid, required: required, rows: rows, cols: cols, onChange: handleChange, ...restProps }));
|
|
30
32
|
}
|
|
31
33
|
// State class for CSS selectors
|
|
32
34
|
const stateClass = isInvalid
|
|
@@ -34,8 +36,6 @@ const Textarea = React__default.forwardRef(({ size = "md", state = "default", cl
|
|
|
34
36
|
: isDisabled
|
|
35
37
|
? "state-disabled"
|
|
36
38
|
: "state-default";
|
|
37
|
-
// Pull onChange out of props so the explicit handler below isn't overwritten by the spread
|
|
38
|
-
const { onChange: propsOnChange, ...restProps } = props;
|
|
39
39
|
// Get theme classes
|
|
40
40
|
const wrapperClasses = theme.wrapperStyle || textareaTheme.wrapperStyle || "";
|
|
41
41
|
const inputGroupClasses = theme.inputGroupStyle || textareaTheme.inputGroupStyle || "";
|
|
@@ -43,18 +43,7 @@ const Textarea = React__default.forwardRef(({ size = "md", state = "default", cl
|
|
|
43
43
|
const sizeClasses = ((_a = theme.sizes) === null || _a === void 0 ? void 0 : _a[size]) || ((_b = textareaTheme.sizes) === null || _b === void 0 ? void 0 : _b[size]) || "";
|
|
44
44
|
const stateClasses = ((_c = theme.states) === null || _c === void 0 ? void 0 : _c[state]) || ((_d = textareaTheme.states) === null || _d === void 0 ? void 0 : _d[state]) || "";
|
|
45
45
|
const helperTextClasses = theme.helperText || textareaTheme.helperText || "";
|
|
46
|
-
return (jsxs("div", { className: cn(wrapperClasses, stateClass, wrapperClassName), children: [label && (typeof label === 'string' ? (jsx("div", { className: "mb-1", children: jsx(FormLabel, { htmlFor: inputId, className: labelClassName, state: state, required: required, children: label }) })) : (label)), jsx("div", { children: jsx("div", { className: cn(inputGroupClasses, stateClasses, inputGroupClassName), children: jsx("div", { className: "relative flex-1", children: jsx("textarea", { ref: ref, id: inputId, className: cn(baseClasses, sizeClasses, className), disabled: isDisabled, "aria-invalid": isInvalid, "aria-describedby": displayedMessage ? `${inputId}-helper` : undefined, required: required, rows: rows, cols: cols,
|
|
47
|
-
var _a;
|
|
48
|
-
setIsFocused(true);
|
|
49
|
-
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
50
|
-
}, onBlur: (e) => {
|
|
51
|
-
var _a;
|
|
52
|
-
setIsFocused(false);
|
|
53
|
-
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
54
|
-
}, onChange: (e) => {
|
|
55
|
-
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(e);
|
|
56
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(e.target.value);
|
|
57
|
-
}, ...restProps }) }) }) }), displayedMessage && (typeof displayedMessage === 'string' ? (jsx("div", { id: `${inputId}-helper`, role: isInvalid ? "alert" : undefined, className: cn(helperTextClasses, helperTextClassName), children: displayedMessage })) : (displayedMessage))] }));
|
|
46
|
+
return (jsxs("div", { className: cn(wrapperClasses, stateClass, wrapperClassName), children: [label && (typeof label === 'string' ? (jsx("div", { className: "mb-1", children: jsx(FormLabel, { htmlFor: inputId, className: labelClassName, state: state, required: required, children: label }) })) : (label)), jsx("div", { children: jsx("div", { className: cn(inputGroupClasses, stateClasses, inputGroupClassName), children: jsx("div", { className: "relative flex-1", children: jsx("textarea", { ref: ref, id: inputId, className: cn(baseClasses, sizeClasses, className), disabled: isDisabled, "aria-invalid": isInvalid, "aria-describedby": displayedMessage ? `${inputId}-helper` : undefined, required: required, rows: rows, cols: cols, onChange: handleChange, ...restProps }) }) }) }), displayedMessage && (typeof displayedMessage === 'string' ? (jsx("div", { id: `${inputId}-helper`, role: isInvalid ? "alert" : undefined, className: cn(helperTextClasses, helperTextClassName), children: displayedMessage })) : (displayedMessage))] }));
|
|
58
47
|
});
|
|
59
48
|
Textarea.displayName = "Textarea";
|
|
60
49
|
|
|
@@ -30,12 +30,21 @@ const timePickerTheme = {
|
|
|
30
30
|
// Icon padding styles - inherited from common form theme
|
|
31
31
|
iconStartPadding: formsBaseTheme.iconStyles.padding.left,
|
|
32
32
|
iconEndPadding: formsBaseTheme.iconStyles.padding.right,
|
|
33
|
+
// Size-aware icon geometry: slot inset from --form-px-*, glyph from
|
|
34
|
+
// --form-icon-size-*. Flat keys above stay as the fallback.
|
|
35
|
+
iconStartStyles: formsBaseTheme.iconStyles.leftSizes,
|
|
36
|
+
iconEndStyles: formsBaseTheme.iconStyles.rightSizes,
|
|
37
|
+
iconSizes: formsBaseTheme.iconStyles.sizes,
|
|
38
|
+
iconPaddings: {
|
|
39
|
+
left: formsBaseTheme.iconStyles.paddingLeftSizes,
|
|
40
|
+
right: formsBaseTheme.iconStyles.paddingRightSizes,
|
|
41
|
+
},
|
|
33
42
|
// Placeholder text style - matches Select/Combobox placeholder styling
|
|
34
43
|
placeholderTextStyle: formsBaseTheme.placeholderStyle,
|
|
35
44
|
// Selected value text style
|
|
36
45
|
valueTextStyle: "text-[var(--color-text-primary)]",
|
|
37
46
|
// 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-
|
|
47
|
+
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
48
|
// Dropdown container styles (TimePicker-specific)
|
|
40
49
|
// Width is controlled by trigger size via estimatedWidth parameter
|
|
41
50
|
dropdownStyle: "fixed z-[1000] backdrop-blur-md border border-[var(--color-border)] rounded-[var(--form-radius)] shadow-lg overflow-hidden",
|
|
@@ -141,6 +141,17 @@ export interface TimePickerThemeOverrides {
|
|
|
141
141
|
iconStartPadding?: string;
|
|
142
142
|
/** End icon padding */
|
|
143
143
|
iconEndPadding?: string;
|
|
144
|
+
/** Per-size leading icon slot (position + inset) */
|
|
145
|
+
iconStartStyles?: Partial<Record<TimePickerSize, string>>;
|
|
146
|
+
/** Per-size trailing icon slot (position + inset) */
|
|
147
|
+
iconEndStyles?: Partial<Record<TimePickerSize, string>>;
|
|
148
|
+
/** Per-size sizing for the built-in clock/caret/clear icons */
|
|
149
|
+
iconSizes?: Record<TimePickerSize, string>;
|
|
150
|
+
/** Per-size text runway reserved for each icon slot */
|
|
151
|
+
iconPaddings?: {
|
|
152
|
+
left?: Partial<Record<TimePickerSize, string>>;
|
|
153
|
+
right?: Partial<Record<TimePickerSize, string>>;
|
|
154
|
+
};
|
|
144
155
|
/** Placeholder text style */
|
|
145
156
|
placeholderTextStyle?: string;
|
|
146
157
|
/** Selected value text style */
|
|
@@ -11,7 +11,7 @@ import { TimePickerContext } from './TimePickerContext.js';
|
|
|
11
11
|
* Follows the same visual pattern as DatePickerTrigger and SelectButton
|
|
12
12
|
*/
|
|
13
13
|
const TimePickerTrigger = ({ id, disabled, isOpen, state = 'default', size = 'md', clearable, onClear, iconStart, iconEnd, className, inputValue, onInputChange, onInputFocus, onInputKeyDown, format, period, onPeriodToggle, placeholder, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, }) => {
|
|
14
|
-
var _a, _b, _c, _d;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
15
|
const context = useContext(TimePickerContext);
|
|
16
16
|
if (!context) {
|
|
17
17
|
throw new Error('TimePickerTrigger must be used within a TimePicker');
|
|
@@ -21,12 +21,14 @@ const TimePickerTrigger = ({ id, disabled, isOpen, state = 'default', size = 'md
|
|
|
21
21
|
const sizeStyle = ((_a = theme.triggerSizes) === null || _a === void 0 ? void 0 : _a[size]) || "";
|
|
22
22
|
const stateStyle = ((_b = theme.triggerStates) === null || _b === void 0 ? void 0 : _b[state]) || "";
|
|
23
23
|
const hoverStateStyle = ((_c = theme.triggerHoverStates) === null || _c === void 0 ? void 0 : _c[state]) || "";
|
|
24
|
-
const iconStartStyle = theme.iconStartStyle || "";
|
|
24
|
+
const iconStartStyle = ((_d = theme.iconStartStyles) === null || _d === void 0 ? void 0 : _d[size]) || theme.iconStartStyle || "";
|
|
25
|
+
// Glyph ramps with the control (--form-icon-size-*), not a flat h-4 w-4.
|
|
26
|
+
const iconSizeStyle = ((_e = theme.iconSizes) === null || _e === void 0 ? void 0 : _e[size]) || "size-4";
|
|
25
27
|
const inputStyle = theme.inputStyle || "";
|
|
26
28
|
const periodToggleStyle = theme.periodToggleStyle || "";
|
|
27
29
|
// Apply focused styles when open — same pattern as SelectButton and DatePickerTrigger
|
|
28
30
|
const activeFocusState = isOpen
|
|
29
|
-
? ((
|
|
31
|
+
? ((_f = theme.triggerFocusStates) === null || _f === void 0 ? void 0 : _f[state]) || "shadow-[inset_0_0_0_1px_var(--color-primary-600)] ring-4 ring-[var(--color-primary)]/10 dark:shadow-[inset_0_0_0_1px_var(--color-primary-500)] dark:ring-[var(--color-primary-500)]/20"
|
|
30
32
|
: "";
|
|
31
33
|
// Determine whether start icon is present (for input padding)
|
|
32
34
|
const hasStartIcon = iconStart !== undefined ? Boolean(iconStart) : true;
|
|
@@ -45,10 +47,10 @@ const TimePickerTrigger = ({ id, disabled, isOpen, state = 'default', size = 'md
|
|
|
45
47
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
46
48
|
setIsOpen(true);
|
|
47
49
|
}, className: cn(baseStyle, stateStyle, hoverStateStyle, activeFocusState, 'w-full items-center', className // User overrides take highest precedence
|
|
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:
|
|
50
|
+
), 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: iconSizeStyle }) }))] }), 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
51
|
e.stopPropagation();
|
|
50
52
|
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-
|
|
53
|
+
}, 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: iconSizeStyle }) })), 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: iconSizeStyle }) }))] }) }));
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
export { TimePickerTrigger };
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const formsBaseTheme: {
|
|
7
7
|
wrapperStyle: string;
|
|
8
|
+
/** The field edge alone — for controls that must supply their own transition/fill. */
|
|
9
|
+
inputGroupBorderStyle: string;
|
|
8
10
|
inputGroupBaseStyle: string;
|
|
9
11
|
controlBaseStyle: string;
|
|
10
12
|
sizes: {
|
|
@@ -51,6 +53,61 @@ export declare const formsBaseTheme: {
|
|
|
51
53
|
left: string;
|
|
52
54
|
right: string;
|
|
53
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* The leading-icon slot, inset by the control's own horizontal padding —
|
|
58
|
+
* EXACTLY, not the trailing slot's `− 4px`. A leading icon stands where the
|
|
59
|
+
* text would have started, so matching `--form-px-*` keeps one constant left
|
|
60
|
+
* edge for a field's contents whether or not it has an icon. The trailing
|
|
61
|
+
* slot is chrome rather than content, which is why it insets tighter.
|
|
62
|
+
*/
|
|
63
|
+
leftSizes: {
|
|
64
|
+
sm: string;
|
|
65
|
+
md: string;
|
|
66
|
+
lg: string;
|
|
67
|
+
};
|
|
68
|
+
/** Text runway for the leading slot: inset + icon + an 8px gap (32/36/40). */
|
|
69
|
+
paddingLeftSizes: {
|
|
70
|
+
sm: string;
|
|
71
|
+
md: string;
|
|
72
|
+
lg: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The trailing-icon slot, inset from the right edge by the control's own
|
|
76
|
+
* horizontal padding MINUS 4px (8 / 10 / 12 at the default theme). Tighter
|
|
77
|
+
* than the text inset on purpose: a chevron is mostly whitespace, so at the
|
|
78
|
+
* same metric distance it reads as further from the edge than a glyph does.
|
|
79
|
+
* Derived from `--form-px-*` rather than a literal, so retuning a theme's
|
|
80
|
+
* control padding moves the icon with it.
|
|
81
|
+
*/
|
|
82
|
+
rightSizes: {
|
|
83
|
+
sm: string;
|
|
84
|
+
md: string;
|
|
85
|
+
lg: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Text runway reserved for that slot: inset + icon + an 8px gap, i.e.
|
|
89
|
+
* `--form-px-*` + 16/18/20 (28 / 32 / 36). It replaces a flat `pr-10` that
|
|
90
|
+
* over-reserved at every size.
|
|
91
|
+
*/
|
|
92
|
+
paddingRightSizes: {
|
|
93
|
+
sm: string;
|
|
94
|
+
md: string;
|
|
95
|
+
lg: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The glyph itself, ramping with the control (12 / 14 / 16px) instead of a
|
|
99
|
+
* flat 16 — at `sm` a 16px icon out-weighed the 14px text beside it.
|
|
100
|
+
*
|
|
101
|
+
* 🔴 Reads --form-icon-size-*, not a Tailwind literal: icon size was the one
|
|
102
|
+
* axis of a field's geometry a theme could not retune, so a preset that
|
|
103
|
+
* scaled height/padding/type left every decorator at its hardcoded size.
|
|
104
|
+
* Not to be confused with --button-icon-square-*, which is a BUTTON's box.
|
|
105
|
+
*/
|
|
106
|
+
sizes: {
|
|
107
|
+
sm: string;
|
|
108
|
+
md: string;
|
|
109
|
+
lg: string;
|
|
110
|
+
};
|
|
54
111
|
};
|
|
55
112
|
dropdownStyles: {
|
|
56
113
|
container: string;
|