entasis 0.10.2 → 0.12.0
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/README.md +1 -1
- package/dist/attachments/disclosurePanel.svelte.d.ts +84 -0
- package/dist/attachments/disclosurePanel.svelte.js +277 -0
- package/dist/attachments/portal.d.ts +17 -1
- package/dist/attachments/portal.js +39 -2
- package/dist/attachments/spinnerOverlay.svelte.js +12 -0
- package/dist/attachments/transitionSize.d.ts +6 -0
- package/dist/attachments/transitionSize.js +30 -0
- package/dist/components/AIAskUserQuestion/AIAskUserQuestion.svelte +131 -17
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionFileStep.svelte +26 -6
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionFileStep.svelte.d.ts +6 -0
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionFooter.svelte +27 -53
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionFooter.svelte.d.ts +3 -4
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionHeader.svelte +19 -16
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionStep.svelte +180 -21
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionStep.svelte.d.ts +9 -1
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionSummary.svelte +56 -0
- package/dist/components/AIAskUserQuestion/AIAskUserQuestionSummary.svelte.d.ts +4 -0
- package/dist/components/AIAskUserQuestion/aiAskUserQuestion.mcp.d.ts +1 -1
- package/dist/components/AIAskUserQuestion/aiAskUserQuestion.mcp.js +26 -8
- package/dist/components/AIAskUserQuestion/aiAskUserQuestion.props.d.ts +62 -5
- package/dist/components/AIAskUserQuestion/aiAskUserQuestion.theme.d.ts +42 -0
- package/dist/components/AIAskUserQuestion/aiAskUserQuestion.theme.js +53 -12
- package/dist/components/AIAskUserQuestion/aiAskUserQuestionAnswers.d.ts +17 -1
- package/dist/components/AIAskUserQuestion/aiAskUserQuestionAnswers.js +56 -8
- package/dist/components/AIAskUserQuestion/index.d.ts +3 -1
- package/dist/components/AIAskUserQuestion/index.js +2 -0
- package/dist/components/AIAskUserQuestion/schemas.d.ts +44 -0
- package/dist/components/AIAskUserQuestion/schemas.js +10 -3
- package/dist/components/AIChat/AIChat.svelte +10 -0
- package/dist/components/AIChat/AIChat.svelte.d.ts +2 -2
- package/dist/components/AIChat/AIChatComposerSurface.svelte +23 -5
- package/dist/components/AIChat/AIChatComposerSurface.svelte.d.ts +5 -0
- package/dist/components/AIChat/AIChatSkeleton.svelte +29 -37
- package/dist/components/AIChat/AIChatSurface.svelte +30 -2
- package/dist/components/AIChat/AIChatSurface.svelte.d.ts +1 -1
- package/dist/components/AIChat/AIChatThreadSurface.svelte +11 -1
- package/dist/components/AIChat/AIChatThreadSurface.svelte.d.ts +3 -1
- package/dist/components/AIChat/aiChat.mcp.d.ts +1 -1
- package/dist/components/AIChat/aiChat.mcp.js +31 -15
- package/dist/components/AIChat/aiChat.props.d.ts +36 -10
- package/dist/components/AIChat/aiChat.theme.d.ts +9 -0
- package/dist/components/AIChat/aiChat.theme.js +21 -4
- package/dist/components/AIChat/aiChatSkeleton.props.d.ts +5 -0
- package/dist/components/AIChat/index.d.ts +1 -1
- package/dist/components/AIComposer/AIComposer.svelte +102 -5
- package/dist/components/AIComposer/AIComposer.svelte.d.ts +1 -0
- package/dist/components/AIComposer/AIComposerFooter.svelte +54 -12
- package/dist/components/AIComposer/AIComposerFooter.svelte.d.ts +2 -0
- package/dist/components/AIComposer/AIComposerQueue.svelte +8 -3
- package/dist/components/AIComposer/aiComposer.editor.theme.js +13 -2
- package/dist/components/AIComposer/aiComposer.mcp.d.ts +1 -1
- package/dist/components/AIComposer/aiComposer.mcp.js +15 -7
- package/dist/components/AIComposer/aiComposer.props.d.ts +27 -7
- package/dist/components/AIComposer/aiComposer.theme.d.ts +42 -3
- package/dist/components/AIComposer/aiComposer.theme.js +37 -5
- package/dist/components/AIComposer/aiComposerFileController.svelte.d.ts +20 -0
- package/dist/components/AIComposer/aiComposerFileController.svelte.js +75 -9
- package/dist/components/AIComposer/aiComposerSourceAdapter.js +22 -4
- package/dist/components/AIComposer/aiComposerSubmitController.svelte.d.ts +12 -0
- package/dist/components/AIComposer/aiComposerSubmitController.svelte.js +16 -6
- package/dist/components/AIContext/AIContext.svelte +7 -3
- package/dist/components/AIContext/aiContext.mcp.d.ts +1 -1
- package/dist/components/AIContext/aiContext.mcp.js +1 -1
- package/dist/components/AIContext/aiContext.props.d.ts +4 -1
- package/dist/components/AIContext/aiContext.theme.d.ts +3 -0
- package/dist/components/AIContext/aiContext.theme.js +7 -2
- package/dist/components/AIConversation/AIConversation.svelte.d.ts +2 -2
- package/dist/components/AIFilePreview/aiFilePreview.theme.js +1 -1
- package/dist/components/AIMarker/AIMarker.svelte +2 -0
- package/dist/components/AIMarker/aiMarker.mcp.d.ts +1 -1
- package/dist/components/AIMarker/aiMarker.mcp.js +2 -0
- package/dist/components/AIMarker/aiMarker.props.d.ts +3 -0
- package/dist/components/AIMarker/aiMarker.theme.js +2 -2
- package/dist/components/AIMessage/AIMessage.svelte +38 -16
- package/dist/components/AIMessage/aiMessage.mcp.d.ts +1 -1
- package/dist/components/AIMessage/aiMessage.mcp.js +20 -6
- package/dist/components/AIMessage/aiMessage.props.d.ts +18 -2
- package/dist/components/AIMessage/aiMessage.theme.d.ts +51 -6
- package/dist/components/AIMessage/aiMessage.theme.js +91 -32
- package/dist/components/AIMessageActions/AIMessageActions.svelte +19 -9
- package/dist/components/AIMessageActions/aiMessageActions.mcp.d.ts +1 -1
- package/dist/components/AIMessageActions/aiMessageActions.mcp.js +11 -3
- package/dist/components/AIMessageActions/aiMessageActions.theme.js +36 -9
- package/dist/components/AIModelSelector/AIModelSelector.svelte +25 -10
- package/dist/components/AIModelSelector/aiModelSelector.mcp.d.ts +1 -1
- package/dist/components/AIModelSelector/aiModelSelector.mcp.js +1 -1
- package/dist/components/AIModelSelector/aiModelSelector.theme.d.ts +3 -0
- package/dist/components/AIModelSelector/aiModelSelector.theme.js +7 -3
- package/dist/components/AIReasoning/AIReasoning.svelte +135 -38
- package/dist/components/AIReasoning/aiReasoning.mcp.d.ts +1 -1
- package/dist/components/AIReasoning/aiReasoning.mcp.js +11 -5
- package/dist/components/AIReasoning/aiReasoning.props.d.ts +15 -4
- package/dist/components/AIReasoning/aiReasoning.theme.d.ts +45 -0
- package/dist/components/AIReasoning/aiReasoning.theme.js +47 -7
- package/dist/components/AISuggestion/AISuggestion.svelte +2 -1
- package/dist/components/AISuggestion/AISuggestions.svelte +2 -1
- package/dist/components/AISuggestion/aiSuggestion.mcp.d.ts +1 -1
- package/dist/components/AISuggestion/aiSuggestion.mcp.js +8 -1
- package/dist/components/AISuggestion/aiSuggestion.props.d.ts +4 -1
- package/dist/components/AISuggestion/aiSuggestion.theme.js +1 -1
- package/dist/components/AISuggestion/aiSuggestions.props.d.ts +7 -0
- package/dist/components/AIThread/AIThread.svelte +378 -95
- package/dist/components/AIThread/AIThreadAskUserQuestion.svelte +1 -0
- package/dist/components/AIThread/AIThreadItems.svelte +266 -64
- package/dist/components/AIThread/AIThreadItems.svelte.d.ts +7 -3
- package/dist/components/AIThread/AIThreadMarker.svelte +8 -1
- package/dist/components/AIThread/AIThreadMarker.svelte.d.ts +1 -0
- package/dist/components/AIThread/aiThread.mcp.d.ts +1 -1
- package/dist/components/AIThread/aiThread.mcp.js +34 -20
- package/dist/components/AIThread/aiThread.props.d.ts +73 -8
- package/dist/components/AIThread/aiThread.theme.d.ts +78 -0
- package/dist/components/AIThread/aiThread.theme.js +108 -9
- package/dist/components/AIThread/index.d.ts +1 -1
- package/dist/components/AIThread/threadAskUserQuestion.d.ts +4 -1
- package/dist/components/AIThread/threadAskUserQuestion.js +8 -4
- package/dist/components/AIThread/threadRenderItems.d.ts +74 -3
- package/dist/components/AIThread/threadRenderItems.js +265 -77
- package/dist/components/AIThread/threadScrollController.d.ts +0 -8
- package/dist/components/AIThread/threadScrollController.js +2 -39
- package/dist/components/AIThread/threadTools.d.ts +11 -0
- package/dist/components/AIThread/threadTools.js +79 -0
- package/dist/components/AIThreadToc/AIThreadToc.svelte +188 -18
- package/dist/components/AIThreadToc/AIThreadTocPreview.svelte +25 -2
- package/dist/components/AIThreadToc/AIThreadTocPreview.svelte.d.ts +3 -0
- package/dist/components/AIThreadToc/aiThreadToc.d.ts +4 -2
- package/dist/components/AIThreadToc/aiThreadToc.js +17 -5
- package/dist/components/AIThreadToc/aiThreadToc.mcp.d.ts +1 -1
- package/dist/components/AIThreadToc/aiThreadToc.mcp.js +13 -3
- package/dist/components/AIThreadToc/aiThreadToc.props.d.ts +11 -0
- package/dist/components/AIThreadToc/aiThreadToc.theme.d.ts +3 -0
- package/dist/components/AIThreadToc/aiThreadToc.theme.js +15 -6
- package/dist/components/AITool/AITool.svelte +56 -21
- package/dist/components/AITool/AIToolCallList.svelte +79 -29
- package/dist/components/AITool/AIToolCallList.svelte.d.ts +6 -2
- package/dist/components/AITool/AIToolStatusMark.svelte +52 -0
- package/dist/components/AITool/AIToolStatusMark.svelte.d.ts +14 -0
- package/dist/components/AITool/AIToolValueSection.svelte +126 -28
- package/dist/components/AITool/AIToolValueSection.svelte.d.ts +6 -2
- package/dist/components/AITool/AIToolValueTree.svelte +11 -16
- package/dist/components/AITool/AIToolValueTree.svelte.d.ts +2 -3
- package/dist/components/AITool/aiTool.mcp.d.ts +1 -1
- package/dist/components/AITool/aiTool.mcp.js +36 -8
- package/dist/components/AITool/aiTool.props.d.ts +52 -6
- package/dist/components/AITool/aiTool.theme.d.ts +117 -39
- package/dist/components/AITool/aiTool.theme.js +144 -140
- package/dist/components/AITool/aiToolClock.svelte.d.ts +18 -0
- package/dist/components/AITool/aiToolClock.svelte.js +62 -0
- package/dist/components/AITool/aiToolPrimitiveThemes.d.ts +0 -2
- package/dist/components/AITool/aiToolPrimitiveThemes.js +0 -10
- package/dist/components/AITool/index.d.ts +2 -1
- package/dist/components/AITool/index.js +1 -0
- package/dist/components/AITool/toolRendering.d.ts +33 -1
- package/dist/components/AITool/toolRendering.js +179 -15
- package/dist/components/AITool/toolValueTree.d.ts +14 -1
- package/dist/components/AITool/toolValueTree.js +126 -27
- package/dist/components/Accordion/Accordion.svelte +109 -109
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -1
- package/dist/components/Accordion/AccordionPanel.svelte +64 -0
- package/dist/components/Accordion/AccordionPanel.svelte.d.ts +20 -0
- package/dist/components/Accordion/accordion.attributes.d.ts +24 -0
- package/dist/components/Accordion/accordion.attributes.js +20 -0
- package/dist/components/Accordion/accordion.mcp.d.ts +1 -1
- package/dist/components/Accordion/accordion.mcp.js +78 -22
- package/dist/components/Accordion/accordion.props.d.ts +54 -10
- package/dist/components/Accordion/accordion.theme.d.ts +3 -0
- package/dist/components/Accordion/accordion.theme.js +4 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/AudioPlayer/audioPlayerVolumeControl.slider.theme.d.ts +31 -1
- package/dist/components/Avatar/Avatar.svelte +60 -10
- package/dist/components/Avatar/AvatarGroup.svelte +9 -0
- package/dist/components/Avatar/avatar.mcp.d.ts +1 -1
- package/dist/components/Avatar/avatar.mcp.js +13 -5
- package/dist/components/Avatar/avatar.props.d.ts +28 -1
- package/dist/components/Avatar/avatar.theme.js +3 -3
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/breadcrumbs.mcp.d.ts +1 -1
- package/dist/components/Breadcrumbs/breadcrumbs.mcp.js +1 -1
- package/dist/components/Button/Button.svelte +35 -15
- package/dist/components/Button/button.mcp.d.ts +1 -1
- package/dist/components/Button/button.mcp.js +8 -4
- package/dist/components/Button/button.props.d.ts +23 -8
- package/dist/components/Button/button.theme.d.ts +12 -0
- package/dist/components/Button/button.theme.js +17 -4
- package/dist/components/ButtonGroup/buttonGroup.mcp.d.ts +1 -1
- package/dist/components/ButtonGroup/buttonGroup.mcp.js +1 -1
- package/dist/components/ButtonGroup/buttonGroup.props.d.ts +4 -1
- package/dist/components/Collapsible/Collapsible.svelte +125 -19
- package/dist/components/Collapsible/collapsible.attributes.d.ts +21 -0
- package/dist/components/Collapsible/collapsible.attributes.js +17 -0
- package/dist/components/Collapsible/collapsible.mcp.d.ts +1 -1
- package/dist/components/Collapsible/collapsible.mcp.js +62 -12
- package/dist/components/Collapsible/collapsible.props.d.ts +39 -8
- package/dist/components/Collapsible/collapsible.theme.js +3 -1
- package/dist/components/Collapsible/index.d.ts +1 -0
- package/dist/components/Collapsible/index.js +1 -0
- package/dist/components/Command/Command.svelte +56 -14
- package/dist/components/Command/command.mcp.d.ts +1 -1
- package/dist/components/Command/command.mcp.js +12 -6
- package/dist/components/Command/command.props.d.ts +39 -6
- package/dist/components/Command/command.state.svelte.d.ts +40 -11
- package/dist/components/Command/command.state.svelte.js +75 -28
- package/dist/components/Command/command.theme.js +4 -3
- package/dist/components/Confirmation/Confirmation.svelte +72 -31
- package/dist/components/Confirmation/confirmation.mcp.d.ts +1 -1
- package/dist/components/Confirmation/confirmation.mcp.js +5 -4
- package/dist/components/ContextMenu/ContextMenu.svelte +126 -16
- package/dist/components/ContextMenu/contextMenu.mcp.d.ts +1 -1
- package/dist/components/ContextMenu/contextMenu.mcp.js +10 -7
- package/dist/components/ContextMenu/contextMenu.props.d.ts +13 -4
- package/dist/components/ContextMenu/contextMenu.theme.d.ts +3 -3
- package/dist/components/ContextMenu/contextMenu.theme.js +3 -2
- package/dist/components/DataTable/DataTable.svelte +4 -9
- package/dist/components/DataTable/DataTableEditor.svelte +5 -0
- package/dist/components/DataTable/DataTableFilter.svelte +1 -0
- package/dist/components/DataTable/DataTableToolbar.svelte +1 -0
- package/dist/components/DataTable/dataTable.mcp.d.ts +1 -1
- package/dist/components/DataTable/dataTable.mcp.js +4 -2
- package/dist/components/DataTable/dataTable.theme.d.ts +0 -3
- package/dist/components/DataTable/dataTable.theme.js +9 -6
- package/dist/components/Dialog/Dialog.svelte +120 -35
- package/dist/components/Dialog/Dialog.svelte.d.ts +1 -1
- package/dist/components/Dialog/DialogBackdrop.svelte +21 -1
- package/dist/components/Dialog/dialog.api.d.ts +65 -0
- package/dist/components/Dialog/dialog.api.js +1 -0
- package/dist/components/Dialog/dialog.attributes.d.ts +23 -0
- package/dist/components/Dialog/dialog.attributes.js +19 -0
- package/dist/components/Dialog/dialog.indent.d.ts +6 -0
- package/dist/components/Dialog/dialog.indent.js +16 -0
- package/dist/components/Dialog/dialog.mcp.d.ts +1 -1
- package/dist/components/Dialog/dialog.mcp.js +195 -22
- package/dist/components/Dialog/dialog.props.d.ts +102 -19
- package/dist/components/Dialog/dialog.snap.d.ts +40 -0
- package/dist/components/Dialog/dialog.snap.js +78 -0
- package/dist/components/Dialog/dialog.state.svelte.d.ts +122 -10
- package/dist/components/Dialog/dialog.state.svelte.js +525 -66
- package/dist/components/Dialog/dialog.theme.d.ts +48 -0
- package/dist/components/Dialog/dialog.theme.js +32 -9
- package/dist/components/Dialog/index.d.ts +4 -1
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/DocumentViewer/DocumentSearchControl.svelte +5 -3
- package/dist/components/DocumentViewer/documentOutput.js +2 -1
- package/dist/components/FloatingWindow/FloatingWindow.svelte +20 -32
- package/dist/components/FloatingWindow/FloatingWindow.svelte.d.ts +1 -1
- package/dist/components/FloatingWindow/floatingWindow.mcp.d.ts +1 -1
- package/dist/components/FloatingWindow/floatingWindow.mcp.js +3 -3
- package/dist/components/FloatingWindow/floatingWindow.props.d.ts +9 -4
- package/dist/components/FloatingWindow/floatingWindow.state.svelte.d.ts +8 -2
- package/dist/components/FloatingWindow/floatingWindow.state.svelte.js +18 -7
- package/dist/components/Form/Ask/Ask.svelte +9 -13
- package/dist/components/Form/Ask/ask.mcp.d.ts +1 -1
- package/dist/components/Form/Ask/ask.mcp.js +1 -1
- package/dist/components/Form/Ask/ask.props.d.ts +1 -1
- package/dist/components/Form/Autocomplete/Autocomplete.svelte +418 -0
- package/dist/components/Form/Autocomplete/Autocomplete.svelte.d.ts +4 -0
- package/dist/components/Form/Autocomplete/autocomplete.items.d.ts +30 -0
- package/dist/components/Form/Autocomplete/autocomplete.items.js +64 -0
- package/dist/components/Form/Autocomplete/autocomplete.mcp.d.ts +1 -0
- package/dist/components/Form/Autocomplete/autocomplete.mcp.js +134 -0
- package/dist/components/Form/Autocomplete/autocomplete.props.d.ts +146 -0
- package/dist/components/Form/Autocomplete/autocomplete.props.js +1 -0
- package/dist/components/Form/Autocomplete/autocomplete.theme.d.ts +213 -0
- package/dist/components/Form/Autocomplete/autocomplete.theme.js +119 -0
- package/dist/components/Form/Autocomplete/index.d.ts +3 -0
- package/dist/components/Form/Autocomplete/index.js +2 -0
- package/dist/components/Form/Calendar/CalendarInput.svelte +9 -0
- package/dist/components/Form/Calendar/CalendarMonthYearPicker.svelte +3 -0
- package/dist/components/Form/Calendar/CalendarPrimitive.svelte +5 -0
- package/dist/components/Form/Calendar/calendar.mcp.d.ts +1 -1
- package/dist/components/Form/Calendar/calendar.mcp.js +2 -1
- package/dist/components/Form/Calendar/calendarInput.props.d.ts +2 -0
- package/dist/components/Form/Calendar/useCalendar.svelte.d.ts +3 -0
- package/dist/components/Form/Calendar/useCalendar.svelte.js +3 -0
- package/dist/components/Form/Checkbox/Checkbox.svelte +17 -2
- package/dist/components/Form/Checkbox/checkbox.mcp.d.ts +1 -1
- package/dist/components/Form/Checkbox/checkbox.mcp.js +11 -1
- package/dist/components/Form/Checkbox/checkbox.props.d.ts +12 -1
- package/dist/components/Form/CheckboxesInput/CheckboxLine.svelte +69 -32
- package/dist/components/Form/CheckboxesInput/CheckboxLine.svelte.d.ts +10 -2
- package/dist/components/Form/CheckboxesInput/CheckboxesInput.svelte +123 -74
- package/dist/components/Form/CheckboxesInput/CheckboxesInput.svelte.d.ts +12 -12
- package/dist/components/Form/CheckboxesInput/checkboxesInput.mcp.d.ts +1 -1
- package/dist/components/Form/CheckboxesInput/checkboxesInput.mcp.js +11 -7
- package/dist/components/Form/CheckboxesInput/checkboxesInput.props.d.ts +25 -9
- package/dist/components/Form/CheckboxesInput/checkboxesInput.theme.d.ts +12 -0
- package/dist/components/Form/CheckboxesInput/checkboxesInput.theme.js +9 -4
- package/dist/components/Form/CheckboxesInput/choiceEnter.d.ts +11 -0
- package/dist/components/Form/CheckboxesInput/choiceEnter.js +27 -0
- package/dist/components/Form/ColorInput/ColorInput.svelte +12 -3
- package/dist/components/Form/ColorInput/colorInput.mcp.d.ts +1 -1
- package/dist/components/Form/ColorInput/colorInput.mcp.js +1 -0
- package/dist/components/Form/ColorPicker/ColorPicker.svelte +11 -2
- package/dist/components/Form/ColorPicker/ColorPickerInput.svelte +9 -0
- package/dist/components/Form/ColorPicker/colorPicker.mcp.d.ts +1 -1
- package/dist/components/Form/ColorPicker/colorPicker.mcp.js +1 -0
- package/dist/components/Form/ColorPicker/colorPicker.props.d.ts +2 -0
- package/dist/components/Form/ColorPicker/colorPicker.state.svelte.d.ts +4 -0
- package/dist/components/Form/ColorPicker/colorPicker.state.svelte.js +12 -8
- package/dist/components/Form/Combobox/Combobox.svelte +145 -185
- package/dist/components/Form/Combobox/Combobox.svelte.d.ts +1 -1
- package/dist/components/Form/Combobox/ComboboxPopup.svelte +128 -0
- package/dist/components/Form/Combobox/ComboboxPopup.svelte.d.ts +28 -0
- package/dist/components/Form/Combobox/combobox.attributes.d.ts +34 -0
- package/dist/components/Form/Combobox/combobox.attributes.js +25 -0
- package/dist/components/Form/Combobox/combobox.items.d.ts +28 -0
- package/dist/components/Form/Combobox/combobox.items.js +68 -0
- package/dist/components/Form/Combobox/combobox.mcp.d.ts +1 -1
- package/dist/components/Form/Combobox/combobox.mcp.js +104 -13
- package/dist/components/Form/Combobox/combobox.props.d.ts +113 -19
- package/dist/components/Form/Combobox/combobox.state.svelte.d.ts +137 -0
- package/dist/components/Form/Combobox/combobox.state.svelte.js +375 -0
- package/dist/components/Form/Combobox/combobox.theme.d.ts +63 -0
- package/dist/components/Form/Combobox/combobox.theme.js +37 -1
- package/dist/components/Form/Combobox/index.d.ts +2 -1
- package/dist/components/Form/Combobox/index.js +1 -0
- package/dist/components/Form/DateInput/DateInput.svelte +11 -3
- package/dist/components/Form/DateInput/dateInput.mcp.d.ts +1 -1
- package/dist/components/Form/DateInput/dateInput.mcp.js +5 -0
- package/dist/components/Form/DateSelector/DateSelector.svelte +5 -2
- package/dist/components/Form/DateSelector/DateSelectorInput.svelte +9 -0
- package/dist/components/Form/DateSelector/dateSelector.mcp.d.ts +1 -1
- package/dist/components/Form/DateSelector/dateSelector.mcp.js +2 -2
- package/dist/components/Form/DateSelector/dateSelector.props.d.ts +2 -0
- package/dist/components/Form/Field/Field.svelte +258 -32
- package/dist/components/Form/Field/Field.svelte.d.ts +15 -6
- package/dist/components/Form/Field/FieldGroup.svelte +29 -0
- package/dist/components/Form/Field/FieldGroup.svelte.d.ts +11 -0
- package/dist/components/Form/Field/FieldHiddenInputs.svelte +187 -0
- package/dist/components/Form/Field/FieldHiddenInputs.svelte.d.ts +26 -0
- package/dist/components/Form/Field/field.d.ts +75 -10
- package/dist/components/Form/Field/field.mcp.d.ts +1 -1
- package/dist/components/Form/Field/field.mcp.js +158 -18
- package/dist/components/Form/Field/field.messages.d.ts +47 -0
- package/dist/components/Form/Field/field.messages.js +64 -0
- package/dist/components/Form/Field/field.state.svelte.d.ts +117 -40
- package/dist/components/Form/Field/field.state.svelte.js +525 -16
- package/dist/components/Form/Field/field.theme.d.ts +46 -0
- package/dist/components/Form/Field/field.theme.js +33 -0
- package/dist/components/Form/Field/fieldHiddenInputs.props.d.ts +61 -0
- package/dist/components/Form/Field/fieldHiddenInputs.props.js +1 -0
- package/dist/components/Form/Field/fieldNativeForm.svelte.d.ts +14 -0
- package/dist/components/Form/Field/fieldNativeForm.svelte.js +113 -0
- package/dist/components/Form/Field/index.d.ts +5 -2
- package/dist/components/Form/Field/index.js +1 -0
- package/dist/components/Form/Field/schemas.js +7 -2
- package/dist/components/Form/File/FileInput.svelte +24 -3
- package/dist/components/Form/File/fileInput.mcp.d.ts +1 -1
- package/dist/components/Form/File/fileInput.mcp.js +1 -0
- package/dist/components/Form/Form/Form.svelte +49 -15
- package/dist/components/Form/Form/FormActions.svelte +3 -1
- package/dist/components/Form/Form/FormActions.svelte.d.ts +42 -2
- package/dist/components/Form/Form/FormFieldRenderer.svelte +96 -12
- package/dist/components/Form/Form/FormFieldRenderer.svelte.d.ts +3 -2
- package/dist/components/Form/Form/FormInputRenderer.svelte +7 -0
- package/dist/components/Form/Form/form.d.ts +84 -11
- package/dist/components/Form/Form/form.mcp.d.ts +1 -1
- package/dist/components/Form/Form/form.mcp.js +178 -12
- package/dist/components/Form/Form/form.props.d.ts +32 -1
- package/dist/components/Form/Form/form.registry.d.ts +28 -0
- package/dist/components/Form/Form/form.registry.js +59 -0
- package/dist/components/Form/Form/form.state.svelte.d.ts +1186 -420
- package/dist/components/Form/Form/form.state.svelte.js +322 -28
- package/dist/components/Form/Form/index.d.ts +4 -1
- package/dist/components/Form/Form/index.js +1 -0
- package/dist/components/Form/Form/visibility.d.ts +3130 -1863
- package/dist/components/Form/KeyValueInput/KeyValueInput.svelte +22 -10
- package/dist/components/Form/KeyValueInput/keyValueInput.mcp.d.ts +1 -1
- package/dist/components/Form/KeyValueInput/keyValueInput.mcp.js +1 -0
- package/dist/components/Form/MultiStepForm/MultiStepForm.svelte +12 -5
- package/dist/components/Form/MultiStepForm/multiStepForm.mcp.d.ts +1 -1
- package/dist/components/Form/MultiStepForm/multiStepForm.mcp.js +5 -3
- package/dist/components/Form/MultiStepForm/multiStepForm.props.d.ts +5 -0
- package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.d.ts +1050 -408
- package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.js +48 -24
- package/dist/components/Form/NumberInput/NumberInput.svelte +365 -46
- package/dist/components/Form/NumberInput/index.d.ts +1 -1
- package/dist/components/Form/NumberInput/numberInput.mcp.d.ts +1 -1
- package/dist/components/Form/NumberInput/numberInput.mcp.js +55 -30
- package/dist/components/Form/NumberInput/numberInput.props.d.ts +64 -4
- package/dist/components/Form/PasswordInput/Password.svelte +28 -1
- package/dist/components/Form/PasswordInput/index.d.ts +1 -1
- package/dist/components/Form/PasswordInput/passwordInput.mcp.d.ts +1 -1
- package/dist/components/Form/PasswordInput/passwordInput.mcp.js +20 -2
- package/dist/components/Form/PasswordInput/passwordInput.props.d.ts +23 -0
- package/dist/components/Form/PhoneInput/PhoneInput.svelte +11 -4
- package/dist/components/Form/PhoneInput/PhoneInputCountryPicker.svelte +47 -21
- package/dist/components/Form/PhoneInput/phoneInput-cdn.js +2 -1
- package/dist/components/Form/PhoneInput/phoneInput.mcp.d.ts +1 -1
- package/dist/components/Form/PhoneInput/phoneInput.mcp.js +6 -2
- package/dist/components/Form/PhoneInput/phoneInputCountry.d.ts +9 -3
- package/dist/components/Form/PhoneInput/phoneInputCountry.js +34 -24
- package/dist/components/Form/PinInput/PinInput.svelte +44 -9
- package/dist/components/Form/PinInput/PinInputCells.svelte +22 -1
- package/dist/components/Form/PinInput/PinInputCells.svelte.d.ts +1 -0
- package/dist/components/Form/PinInput/index.d.ts +1 -1
- package/dist/components/Form/PinInput/pinInput.mcp.d.ts +1 -1
- package/dist/components/Form/PinInput/pinInput.mcp.js +29 -6
- package/dist/components/Form/PinInput/pinInput.props.d.ts +38 -4
- package/dist/components/Form/PinInput/pinInput.state.svelte.d.ts +41 -0
- package/dist/components/Form/PinInput/pinInput.state.svelte.js +227 -24
- package/dist/components/Form/PinInput/pinInput.theme.d.ts +39 -3
- package/dist/components/Form/PinInput/pinInput.theme.js +27 -1
- package/dist/components/Form/RadioInput/RadioInput.svelte +94 -32
- package/dist/components/Form/RadioInput/RadioInput.svelte.d.ts +12 -12
- package/dist/components/Form/RadioInput/radioInput.mcp.d.ts +1 -1
- package/dist/components/Form/RadioInput/radioInput.mcp.js +12 -9
- package/dist/components/Form/RadioInput/radioInput.props.d.ts +22 -6
- package/dist/components/Form/RadioInput/radioInput.theme.d.ts +12 -0
- package/dist/components/Form/RadioInput/radioInput.theme.js +10 -5
- package/dist/components/Form/RatingInput/RatingInput.svelte +13 -4
- package/dist/components/Form/RatingInput/ratingInput.mcp.d.ts +1 -1
- package/dist/components/Form/RatingInput/ratingInput.mcp.js +3 -3
- package/dist/components/Form/RatingInput/ratingInput.props.d.ts +1 -1
- package/dist/components/Form/Select/Select.svelte +186 -48
- package/dist/components/Form/Select/Select.svelte.d.ts +23 -2
- package/dist/components/Form/Select/SelectOptionRow.svelte +69 -0
- package/dist/components/Form/Select/SelectOptionRow.svelte.d.ts +18 -0
- package/dist/components/Form/Select/index.d.ts +2 -1
- package/dist/components/Form/Select/index.js +1 -0
- package/dist/components/Form/Select/select.align.d.ts +5 -0
- package/dist/components/Form/Select/select.align.js +19 -5
- package/dist/components/Form/Select/select.attributes.d.ts +36 -0
- package/dist/components/Form/Select/select.attributes.js +27 -0
- package/dist/components/Form/Select/select.mcp.d.ts +1 -1
- package/dist/components/Form/Select/select.mcp.js +103 -18
- package/dist/components/Form/Select/select.props.d.ts +87 -10
- package/dist/components/Form/Select/select.state.svelte.d.ts +108 -17
- package/dist/components/Form/Select/select.state.svelte.js +354 -59
- package/dist/components/Form/Select/select.theme.d.ts +21 -0
- package/dist/components/Form/Select/select.theme.js +22 -0
- package/dist/components/Form/Slider/Slider.svelte +54 -14
- package/dist/components/Form/Slider/SliderMarks.svelte +1 -1
- package/dist/components/Form/Slider/SliderThumb.svelte +49 -19
- package/dist/components/Form/Slider/SliderThumb.svelte.d.ts +8 -2
- package/dist/components/Form/Slider/SliderTrack.svelte +33 -12
- package/dist/components/Form/Slider/SliderTrack.svelte.d.ts +6 -2
- package/dist/components/Form/Slider/index.d.ts +1 -1
- package/dist/components/Form/Slider/slider.mcp.d.ts +1 -1
- package/dist/components/Form/Slider/slider.mcp.js +55 -11
- package/dist/components/Form/Slider/slider.props.d.ts +35 -2
- package/dist/components/Form/Slider/slider.state.svelte.d.ts +66 -5
- package/dist/components/Form/Slider/slider.state.svelte.js +273 -49
- package/dist/components/Form/Slider/slider.theme.d.ts +36 -0
- package/dist/components/Form/Slider/slider.theme.js +35 -17
- package/dist/components/Form/Switch/Switch.svelte +61 -38
- package/dist/components/Form/Switch/switch.mcp.d.ts +1 -1
- package/dist/components/Form/Switch/switch.mcp.js +25 -5
- package/dist/components/Form/Switch/switch.props.d.ts +14 -1
- package/dist/components/Form/Switch/switch.theme.d.ts +12 -0
- package/dist/components/Form/Switch/switch.theme.js +8 -3
- package/dist/components/Form/TagGroup/TagGroup.svelte +8 -0
- package/dist/components/Form/TagGroup/tagGroup.mcp.d.ts +1 -1
- package/dist/components/Form/TagGroup/tagGroup.mcp.js +1 -0
- package/dist/components/Form/TagsInput/TagsInput.svelte +277 -275
- package/dist/components/Form/TagsInput/TagsInput.svelte.d.ts +1 -1
- package/dist/components/Form/TagsInput/tagsInput.mcp.d.ts +1 -1
- package/dist/components/Form/TagsInput/tagsInput.mcp.js +31 -11
- package/dist/components/Form/TagsInput/tagsInput.props.d.ts +6 -26
- package/dist/components/Form/TagsInput/tagsInput.theme.d.ts +63 -0
- package/dist/components/Form/TagsInput/tagsInput.theme.js +37 -1
- package/dist/components/Form/TextArea/TextArea.svelte +8 -0
- package/dist/components/Form/TextArea/textArea.mcp.d.ts +1 -1
- package/dist/components/Form/TextArea/textArea.mcp.js +1 -0
- package/dist/components/Form/TextInput/TextInput.svelte +8 -1
- package/dist/components/Form/TextInput/textInput.mcp.d.ts +1 -1
- package/dist/components/Form/TextInput/textInput.mcp.js +5 -0
- package/dist/components/Form/TimeInput/TimeInput.svelte +9 -1
- package/dist/components/Form/TimeInput/timeInput.mcp.d.ts +1 -1
- package/dist/components/Form/TimeInput/timeInput.mcp.js +31 -0
- package/dist/components/Form/VoiceInput/VoiceInput.svelte +10 -2
- package/dist/components/Form/VoiceInput/voiceInput.mcp.d.ts +1 -1
- package/dist/components/Form/VoiceInput/voiceInput.mcp.js +1 -0
- package/dist/components/GanttChart/GanttDependencyControl.svelte +4 -4
- package/dist/components/HoverCard/HoverCard.svelte +100 -10
- package/dist/components/HoverCard/hoverCard.attributes.d.ts +33 -0
- package/dist/components/HoverCard/hoverCard.attributes.js +24 -0
- package/dist/components/HoverCard/hoverCard.mcp.d.ts +1 -1
- package/dist/components/HoverCard/hoverCard.mcp.js +61 -2
- package/dist/components/HoverCard/hoverCard.props.d.ts +19 -0
- package/dist/components/HoverCard/hoverCard.theme.d.ts +12 -0
- package/dist/components/HoverCard/hoverCard.theme.js +9 -2
- package/dist/components/HoverCard/index.d.ts +1 -0
- package/dist/components/HoverCard/index.js +1 -0
- package/dist/components/ImageGallery/imageGallery.state.svelte.d.ts +1 -1
- package/dist/components/ImageZoom/imageZoom.lightbox.js +40 -6
- package/dist/components/ImageZoom/imageZoom.mcp.d.ts +1 -1
- package/dist/components/ImageZoom/imageZoom.mcp.js +3 -3
- package/dist/components/ImageZoom/imageZoom.props.d.ts +10 -4
- package/dist/components/ImageZoom/imageZoom.state.svelte.d.ts +16 -4
- package/dist/components/ImageZoom/imageZoom.state.svelte.js +38 -9
- package/dist/components/Kanban/kanban.theme.js +7 -3
- package/dist/components/Layout/layoutSpacing.d.ts +2 -2
- package/dist/components/LinkPreview/LinkPreview.svelte +7 -1
- package/dist/components/LinkPreview/linkPreview.mcp.d.ts +1 -1
- package/dist/components/LinkPreview/linkPreview.mcp.js +4 -1
- package/dist/components/LinkPreview/linkPreview.props.d.ts +15 -0
- package/dist/components/LinkPreview/linkPreview.theme.d.ts +12 -0
- package/dist/components/LinkPreview/linkPreview.theme.js +9 -2
- package/dist/components/Map/maplibre-cdn.js +3 -2
- package/dist/components/Markdown/markdown.mcp.d.ts +1 -1
- package/dist/components/Markdown/markdown.mcp.js +2 -1
- package/dist/components/Markdown/markdown.theme.js +18 -9
- package/dist/components/MediaVolume/MediaVolumeControl.svelte +4 -3
- package/dist/components/Menu/Menu.svelte +3 -3
- package/dist/components/Menu/Menu.svelte.d.ts +1 -1
- package/dist/components/Menu/MenuCheckboxItem.svelte +87 -0
- package/dist/components/Menu/MenuCheckboxItem.svelte.d.ts +16 -0
- package/dist/components/Menu/MenuFloating.svelte +421 -74
- package/dist/components/Menu/MenuFloating.svelte.d.ts +1 -1
- package/dist/components/Menu/MenuMirroredIcon.svelte +9 -0
- package/dist/components/Menu/MenuMirroredIcon.svelte.d.ts +7 -0
- package/dist/components/Menu/MenuRadioGroup.svelte +102 -0
- package/dist/components/Menu/MenuRadioGroup.svelte.d.ts +18 -0
- package/dist/components/Menu/MenuSearchField.svelte +54 -0
- package/dist/components/Menu/MenuSearchField.svelte.d.ts +20 -0
- package/dist/components/Menu/MenuStacked.svelte +404 -158
- package/dist/components/Menu/MenuStacked.svelte.d.ts +1 -1
- package/dist/components/Menu/MenuStackedBackHeader.svelte +6 -1
- package/dist/components/Menu/index.d.ts +2 -1
- package/dist/components/Menu/index.js +1 -0
- package/dist/components/Menu/menu.attributes.d.ts +37 -0
- package/dist/components/Menu/menu.attributes.js +28 -0
- package/dist/components/Menu/menu.filter.svelte.d.ts +52 -0
- package/dist/components/Menu/menu.filter.svelte.js +143 -0
- package/dist/components/Menu/menu.mcp.d.ts +1 -1
- package/dist/components/Menu/menu.mcp.js +227 -17
- package/dist/components/Menu/menu.platform.d.ts +5 -0
- package/dist/components/Menu/menu.platform.js +11 -0
- package/dist/components/Menu/menu.props.d.ts +172 -9
- package/dist/components/Menu/menu.theme.d.ts +147 -0
- package/dist/components/Menu/menu.theme.js +101 -0
- package/dist/components/Menu/menuTree.d.ts +35 -1
- package/dist/components/Menu/menuTree.js +158 -1
- package/dist/components/MenuBar/menuBar.mcp.d.ts +1 -1
- package/dist/components/MenuBar/menuBar.mcp.js +4 -2
- package/dist/components/MenuBar/menuBar.state.svelte.js +28 -10
- package/dist/components/MenuOption/MenuOption.svelte +5 -1
- package/dist/components/MenuOption/menuOption.mcp.d.ts +1 -1
- package/dist/components/MenuOption/menuOption.mcp.js +8 -0
- package/dist/components/MenuOption/menuOption.props.d.ts +12 -0
- package/dist/components/MenuOption/menuOption.theme.d.ts +18 -0
- package/dist/components/MenuOption/menuOption.theme.js +24 -4
- package/dist/components/Mermaid/mermaid.mcp.d.ts +1 -1
- package/dist/components/Mermaid/mermaid.mcp.js +8 -8
- package/dist/components/Mermaid/mermaid.props.d.ts +3 -4
- package/dist/components/Mermaid/mermaid.state.svelte.d.ts +20 -19
- package/dist/components/Mermaid/mermaid.state.svelte.js +80 -243
- package/dist/components/Mermaid/mermaid.theme.js +26 -1
- package/dist/components/MetadataList/MetadataList.svelte.d.ts +1 -1
- package/dist/components/Meter/Meter.svelte +110 -24
- package/dist/components/Meter/Meter.svelte.d.ts +12 -12
- package/dist/components/Meter/meter.mcp.d.ts +1 -1
- package/dist/components/Meter/meter.mcp.js +23 -37
- package/dist/components/Meter/meter.props.d.ts +36 -44
- package/dist/components/NavigationMenu/NavigationMenu.svelte +181 -0
- package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +25 -0
- package/dist/components/NavigationMenu/NavigationMenuContent.svelte +141 -0
- package/dist/components/NavigationMenu/NavigationMenuContent.svelte.d.ts +13 -0
- package/dist/components/NavigationMenu/NavigationMenuTrigger.svelte +75 -0
- package/dist/components/NavigationMenu/NavigationMenuTrigger.svelte.d.ts +13 -0
- package/dist/components/NavigationMenu/index.d.ts +4 -0
- package/dist/components/NavigationMenu/index.js +3 -0
- package/dist/components/NavigationMenu/navigationMenu.attributes.d.ts +24 -0
- package/dist/components/NavigationMenu/navigationMenu.attributes.js +21 -0
- package/dist/components/NavigationMenu/navigationMenu.mcp.d.ts +1 -0
- package/dist/components/NavigationMenu/navigationMenu.mcp.js +138 -0
- package/dist/components/NavigationMenu/navigationMenu.props.d.ts +129 -0
- package/dist/components/NavigationMenu/navigationMenu.props.js +1 -0
- package/dist/components/NavigationMenu/navigationMenu.state.svelte.d.ts +163 -0
- package/dist/components/NavigationMenu/navigationMenu.state.svelte.js +721 -0
- package/dist/components/NavigationMenu/navigationMenu.theme.d.ts +326 -0
- package/dist/components/NavigationMenu/navigationMenu.theme.js +239 -0
- package/dist/components/Overlay/Overlay.svelte +19 -30
- package/dist/components/Overlay/index.d.ts +1 -0
- package/dist/components/Overlay/index.js +1 -0
- package/dist/components/Overlay/overlay.attributes.d.ts +16 -0
- package/dist/components/Overlay/overlay.attributes.js +14 -0
- package/dist/components/Overlay/overlay.mcp.d.ts +1 -1
- package/dist/components/Overlay/overlay.mcp.js +21 -3
- package/dist/components/Overlay/overlay.props.d.ts +8 -4
- package/dist/components/Popover/Popover.svelte +163 -52
- package/dist/components/Popover/Popover.svelte.d.ts +23 -2
- package/dist/components/Popover/PopoverSession.svelte +12 -0
- package/dist/components/Popover/PopoverSession.svelte.d.ts +7 -0
- package/dist/components/Popover/index.d.ts +10 -2
- package/dist/components/Popover/index.js +4 -1
- package/dist/components/Popover/popover.api.d.ts +83 -0
- package/dist/components/Popover/popover.api.js +1 -0
- package/dist/components/Popover/popover.attributes.d.ts +32 -0
- package/dist/components/Popover/popover.attributes.js +28 -0
- package/dist/components/Popover/popover.claims.d.ts +19 -0
- package/dist/components/Popover/popover.claims.js +45 -0
- package/dist/components/Popover/popover.mcp.d.ts +1 -1
- package/dist/components/Popover/popover.mcp.js +163 -31
- package/dist/components/Popover/popover.position.d.ts +226 -0
- package/dist/components/Popover/popover.position.js +402 -0
- package/dist/components/Popover/popover.props.d.ts +179 -24
- package/dist/components/Popover/popover.state.svelte.d.ts +169 -37
- package/dist/components/Popover/popover.state.svelte.js +1034 -194
- package/dist/components/Popover/popover.theme.d.ts +15 -0
- package/dist/components/Popover/popover.theme.js +27 -2
- package/dist/components/PopupMenu/PopupMenu.svelte +193 -22
- package/dist/components/PopupMenu/PopupMenu.svelte.d.ts +2 -2
- package/dist/components/PopupMenu/popupMenu.context.d.ts +42 -0
- package/dist/components/PopupMenu/popupMenu.context.js +52 -0
- package/dist/components/PopupMenu/popupMenu.mcp.d.ts +1 -1
- package/dist/components/PopupMenu/popupMenu.mcp.js +46 -6
- package/dist/components/PopupMenu/popupMenu.props.d.ts +29 -2
- package/dist/components/Progress/Progress.svelte +160 -0
- package/dist/components/Progress/Progress.svelte.d.ts +4 -0
- package/dist/components/Progress/index.d.ts +3 -0
- package/dist/components/Progress/index.js +2 -0
- package/dist/components/Progress/progress.mcp.d.ts +1 -0
- package/dist/components/Progress/progress.mcp.js +101 -0
- package/dist/components/Progress/progress.props.d.ts +79 -0
- package/dist/components/Progress/progress.props.js +1 -0
- package/dist/components/Progress/progress.theme.d.ts +129 -0
- package/dist/components/Progress/progress.theme.js +83 -0
- package/dist/components/ProgressCircle/ProgressCircle.svelte +51 -6
- package/dist/components/ProgressCircle/progressCircle.mcp.d.ts +1 -1
- package/dist/components/ProgressCircle/progressCircle.mcp.js +18 -4
- package/dist/components/ProgressCircle/progressCircle.props.d.ts +32 -2
- package/dist/components/ProgressCircle/progressCircle.theme.d.ts +15 -3
- package/dist/components/ProgressCircle/progressCircle.theme.js +7 -2
- package/dist/components/RichTextInput/RichTextInput.svelte +19 -1
- package/dist/components/RichTextInput/RichTextInputChrome.svelte +5 -1
- package/dist/components/RichTextInput/RichTextInputChrome.svelte.d.ts +2 -0
- package/dist/components/RichTextInput/RichTextInputViewport.svelte +3 -1
- package/dist/components/RichTextInput/RichTextInputViewport.svelte.d.ts +1 -0
- package/dist/components/RichTextInput/richTextInput.mcp.d.ts +1 -1
- package/dist/components/RichTextInput/richTextInput.mcp.js +1 -0
- package/dist/components/RichTextInput/suggestions.js +2 -0
- package/dist/components/ScrollArea/ScrollArea.svelte +166 -27
- package/dist/components/ScrollArea/index.d.ts +2 -1
- package/dist/components/ScrollArea/index.js +1 -0
- package/dist/components/ScrollArea/scrollArea.attributes.d.ts +25 -0
- package/dist/components/ScrollArea/scrollArea.attributes.js +21 -0
- package/dist/components/ScrollArea/scrollArea.mcp.d.ts +1 -1
- package/dist/components/ScrollArea/scrollArea.mcp.js +47 -3
- package/dist/components/ScrollArea/scrollArea.props.d.ts +33 -6
- package/dist/components/ScrollArea/scrollArea.svelte.d.ts +56 -12
- package/dist/components/ScrollArea/scrollArea.svelte.js +281 -71
- package/dist/components/ScrollArea/scrollArea.theme.js +5 -2
- package/dist/components/SegmentedControl/SegmentedControl.svelte +4 -3
- package/dist/components/SegmentedControl/segmentedControl.mcp.d.ts +1 -1
- package/dist/components/SegmentedControl/segmentedControl.mcp.js +3 -2
- package/dist/components/SelectionMenu/SelectionMenu.svelte +4 -2
- package/dist/components/Sidebar/SidebarAction.svelte +13 -3
- package/dist/components/Sidebar/SidebarAction.svelte.d.ts +2 -1
- package/dist/components/Sidebar/SidebarActivityBar.svelte +14 -7
- package/dist/components/Sidebar/SidebarFlyout.svelte +97 -0
- package/dist/components/Sidebar/SidebarFlyout.svelte.d.ts +32 -0
- package/dist/components/Sidebar/SidebarGroup.svelte +39 -15
- package/dist/components/Sidebar/SidebarMenuButton.svelte +6 -3
- package/dist/components/Sidebar/SidebarMenuItem.svelte +134 -31
- package/dist/components/Sidebar/SidebarMenuSubItem.svelte +30 -14
- package/dist/components/Sidebar/SidebarTreeNode.svelte +41 -61
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/Sidebar/index.js +1 -0
- package/dist/components/Sidebar/sidebar-position.d.ts +37 -2
- package/dist/components/Sidebar/sidebar-position.js +31 -2
- package/dist/components/Sidebar/sidebar.attributes.d.ts +33 -0
- package/dist/components/Sidebar/sidebar.attributes.js +29 -0
- package/dist/components/Sidebar/sidebar.mcp.d.ts +1 -1
- package/dist/components/Sidebar/sidebar.mcp.js +45 -10
- package/dist/components/Sidebar/sidebar.props.d.ts +28 -7
- package/dist/components/Sidebar/sidebar.theme.d.ts +51 -21
- package/dist/components/Sidebar/sidebar.theme.js +113 -62
- package/dist/components/Sidebar/sidebar.views.svelte.js +11 -18
- package/dist/components/Stepper/Stepper.svelte +2 -0
- package/dist/components/Stepper/stepper.mcp.d.ts +1 -1
- package/dist/components/Stepper/stepper.mcp.js +1 -0
- package/dist/components/Stepper/stepper.props.d.ts +5 -0
- package/dist/components/Stepper/stepper.state.svelte.d.ts +2 -0
- package/dist/components/Stepper/stepper.state.svelte.js +31 -12
- package/dist/components/Tabbar/Tabbar.svelte +55 -16
- package/dist/components/Tabbar/index.d.ts +1 -1
- package/dist/components/Tabbar/tabbar.mcp.d.ts +1 -1
- package/dist/components/Tabbar/tabbar.mcp.js +26 -9
- package/dist/components/Tabbar/tabbar.props.d.ts +34 -5
- package/dist/components/Tabbar/tabbar.selection.svelte.d.ts +79 -0
- package/dist/components/Tabbar/tabbar.selection.svelte.js +99 -0
- package/dist/components/TableOfContents/tableOfContents.state.svelte.js +9 -7
- package/dist/components/Tabs/Tabs.svelte +73 -16
- package/dist/components/Tabs/index.d.ts +2 -1
- package/dist/components/Tabs/tabs.direction.svelte.d.ts +25 -0
- package/dist/components/Tabs/tabs.direction.svelte.js +40 -0
- package/dist/components/Tabs/tabs.mcp.d.ts +1 -1
- package/dist/components/Tabs/tabs.mcp.js +22 -4
- package/dist/components/Tabs/tabs.props.d.ts +39 -12
- package/dist/components/Tabs/tabs.theme.js +3 -1
- package/dist/components/Theme/Theme.svelte +44 -27
- package/dist/components/Theme/helper.d.ts +16 -2
- package/dist/components/Theme/helper.js +46 -4
- package/dist/components/Theme/theme.mcp.d.ts +1 -1
- package/dist/components/Theme/theme.mcp.js +103 -0
- package/dist/components/Theme/theme.props.d.ts +16 -0
- package/dist/components/Theme/theme.state.svelte.d.ts +14 -1
- package/dist/components/Theme/theme.state.svelte.js +18 -1
- package/dist/components/Toast/Toast.svelte +184 -39
- package/dist/components/Toast/Toaster.svelte +14 -10
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/toast.mcp.d.ts +1 -1
- package/dist/components/Toast/toast.mcp.js +47 -6
- package/dist/components/Toast/toast.state.svelte.d.ts +172 -6
- package/dist/components/Toast/toast.state.svelte.js +513 -68
- package/dist/components/Toast/toast.theme.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.svelte +23 -1
- package/dist/components/ToggleButton/toggleButton.mcp.d.ts +1 -1
- package/dist/components/ToggleButton/toggleButton.mcp.js +3 -1
- package/dist/components/ToggleButton/toggleButton.props.d.ts +13 -1
- package/dist/components/ToggleButton/toggleButton.theme.d.ts +12 -0
- package/dist/components/ToggleButton/toggleButton.theme.js +15 -3
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.svelte +29 -9
- package/dist/components/ToggleButtonGroup/index.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/toggleButtonGroup.mcp.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/toggleButtonGroup.mcp.js +5 -2
- package/dist/components/ToggleButtonGroup/toggleButtonGroup.props.d.ts +19 -1
- package/dist/components/ToggleButtonGroup/toggleButtonGroup.theme.d.ts +12 -0
- package/dist/components/ToggleButtonGroup/toggleButtonGroup.theme.js +21 -2
- package/dist/components/ToggleMenu/ToggleMenu.svelte +57 -43
- package/dist/components/ToggleMenu/ToggleMenuGroup.svelte +1 -0
- package/dist/components/ToggleMenu/ToggleMenuMenu.svelte +9 -3
- package/dist/components/ToggleMenu/ToggleMenuRadioGroup.svelte +7 -2
- package/dist/components/ToggleMenu/toggleMenu.mcp.d.ts +1 -1
- package/dist/components/ToggleMenu/toggleMenu.mcp.js +3 -2
- package/dist/components/ToggleMenu/toggleMenu.props.d.ts +4 -1
- package/dist/components/Tooltip/Tooltip.svelte +4 -12
- package/dist/components/Tooltip/TooltipHost.svelte +136 -15
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tooltip/tooltip.attachment.svelte.d.ts +5 -0
- package/dist/components/Tooltip/tooltip.attachment.svelte.js +215 -33
- package/dist/components/Tooltip/tooltip.attributes.d.ts +32 -0
- package/dist/components/Tooltip/tooltip.attributes.js +28 -0
- package/dist/components/Tooltip/tooltip.mcp.d.ts +1 -1
- package/dist/components/Tooltip/tooltip.mcp.js +111 -10
- package/dist/components/Tooltip/tooltip.props.d.ts +33 -2
- package/dist/components/Tooltip/tooltip.surface.d.ts +24 -0
- package/dist/components/Tooltip/tooltip.surface.js +42 -0
- package/dist/components/Tree/TreeContextMenuSurface.svelte +16 -3
- package/dist/components/Utils/BeforeHydratation.svelte +14 -3
- package/dist/components/Utils/BeforeHydratation.svelte.d.ts +2 -0
- package/dist/components/VideoPlayer/VideoPlayer.svelte.d.ts +1 -1
- package/dist/components/VideoPlayer/VideoPlayerSettings.svelte +2 -0
- package/dist/generated/componentAliases.d.ts +3 -0
- package/dist/generated/componentAliases.js +3 -0
- package/dist/generated/componentContract.d.ts +79 -34
- package/dist/generated/componentContract.js +231 -6
- package/dist/generated/componentMcpRegistry.js +6 -0
- package/dist/i18n/ar.js +107 -3
- package/dist/i18n/context.svelte.d.ts +6 -0
- package/dist/i18n/context.svelte.js +12 -0
- package/dist/i18n/de.js +101 -3
- package/dist/i18n/en.d.ts +91 -2
- package/dist/i18n/en.js +101 -3
- package/dist/i18n/es.js +101 -3
- package/dist/i18n/fr.js +101 -3
- package/dist/i18n/ja.js +101 -3
- package/dist/i18n/pt.js +101 -3
- package/dist/i18n/zh.js +101 -3
- package/dist/tailwind/geometry.js +7 -0
- package/dist/tailwind/global.js +31 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.mcp.d.ts +1 -1
- package/dist/types/types.mcp.js +23 -0
- package/dist/utils/cspNonce.d.ts +16 -0
- package/dist/utils/cspNonce.js +39 -0
- package/dist/utils/cva/merge.d.ts +5 -1
- package/dist/utils/cva/merge.js +6 -4
- package/dist/utils/focus.d.ts +34 -0
- package/dist/utils/focus.js +93 -0
- package/dist/utils/focusHistory.d.ts +21 -0
- package/dist/utils/focusHistory.js +99 -0
- package/dist/utils/handlers.d.ts +7 -0
- package/dist/utils/handlers.js +14 -0
- package/dist/utils/hoverIntent.d.ts +42 -0
- package/dist/utils/hoverIntent.js +57 -0
- package/dist/utils/id.d.ts +7 -0
- package/dist/utils/id.js +15 -0
- package/dist/utils/layers.svelte.d.ts +32 -4
- package/dist/utils/layers.svelte.js +214 -21
- package/dist/utils/listFilter.d.ts +44 -0
- package/dist/utils/listFilter.js +130 -0
- package/dist/utils/match.d.ts +35 -0
- package/dist/utils/match.js +36 -0
- package/dist/utils/number.d.ts +126 -0
- package/dist/utils/number.js +401 -0
- package/dist/utils/openChange.d.ts +88 -0
- package/dist/utils/openChange.js +71 -0
- package/dist/utils/openLifecycle.svelte.d.ts +41 -0
- package/dist/utils/openLifecycle.svelte.js +134 -0
- package/dist/utils/pointerDrag.d.ts +10 -0
- package/dist/utils/pointerDrag.js +37 -2
- package/dist/utils/pragmaticDragAndDrop.d.ts +2 -1
- package/dist/utils/pragmaticDragAndDrop.js +8 -3
- package/dist/utils/range.d.ts +62 -0
- package/dist/utils/range.js +70 -0
- package/dist/utils/requestNativeSubmit.d.ts +17 -0
- package/dist/utils/requestNativeSubmit.js +47 -0
- package/dist/utils/safeArea.svelte.d.ts +10 -1
- package/dist/utils/safeArea.svelte.js +19 -11
- package/dist/utils/stateAttributes.d.ts +108 -0
- package/dist/utils/stateAttributes.js +78 -0
- package/dist/utils/swipeVelocity.d.ts +32 -0
- package/dist/utils/swipeVelocity.js +59 -0
- package/dist/utils/timer.svelte.d.ts +65 -2
- package/dist/utils/timer.svelte.js +159 -25
- package/dist/utils/trigger.d.ts +41 -0
- package/dist/utils/trigger.js +103 -0
- package/dist/utils/typeahead.d.ts +9 -0
- package/dist/utils/typeahead.js +21 -9
- package/dist/utils/useDndList.svelte.d.ts +1 -1
- package/dist/utils/useDndList.svelte.js +6 -23
- package/dist/utils/useFocusScope.svelte.d.ts +29 -0
- package/dist/utils/useFocusScope.svelte.js +189 -27
- package/dist/utils/useHoverAction.svelte.d.ts +44 -4
- package/dist/utils/useHoverAction.svelte.js +161 -51
- package/dist/utils/useKeyDown.svelte.d.ts +19 -2
- package/dist/utils/useKeyDown.svelte.js +19 -12
- package/dist/utils/useListNavigation.svelte.d.ts +94 -13
- package/dist/utils/useListNavigation.svelte.js +261 -35
- package/dist/utils/useLiveAnnouncer.svelte.d.ts +77 -2
- package/dist/utils/useLiveAnnouncer.svelte.js +119 -2
- package/dist/utils/useNavigation.svelte.d.ts +36 -3
- package/dist/utils/useNavigation.svelte.js +699 -332
- package/dist/utils/usePressAndHold.svelte.d.ts +38 -0
- package/dist/utils/usePressAndHold.svelte.js +191 -0
- package/dist/utils/useScrollLock.svelte.d.ts +20 -1
- package/dist/utils/useScrollLock.svelte.js +54 -13
- package/dist/utils/useSlidingIndicator.svelte.d.ts +2 -0
- package/dist/utils/useSlidingIndicator.svelte.js +27 -5
- package/dist/utils/useTabBridge.svelte.d.ts +20 -0
- package/dist/utils/useTabBridge.svelte.js +109 -0
- package/dist/utils/values.d.ts +15 -0
- package/dist/utils/values.js +49 -0
- package/package.json +31 -2
- package/dist/generated/componentMcpRegistry.d.ts +0 -142
- package/dist/utils/useDrag.svelte.d.ts +0 -11
- package/dist/utils/useDrag.svelte.js +0 -55
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const checkboxesInputDescription = "\n# CheckboxesInput Component\n\nThe CheckboxesInput component is a multi-selection input that allows users to select multiple options from a list. It provides a visually appealing interface with two display modes and supports custom labels and descriptions.\n\n## Basic Usage\n\n```svelte\n<script>\n\tlet selectedValues = $state([]);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Select your interests\"\n\titems={[\n\t\t{ value: 'coding', label: 'Coding' },\n\t\t{ value: 'design', label: 'Design' },\n\t\t{ value: 'marketing', label: 'Marketing' }\n\t]}\n\tbind:value={selectedValues}\n/>\n```\n\n## Props\n\n### Core Props\n- **items**: CheckboxOption[] (required) - Array of checkbox options\n - Each option has:\n - value: string (required) - Unique identifier for the option\n - label?: Slot - Display label (can be text or Svelte snippet)\n - description?: Slot - Optional description text\n\n- **value**: string[] (bindable) - Array of selected option values\n- **mode**: 'normal' | 'card' (default: 'normal')\n - normal: Simple checkbox list\n - card: Each option displayed as a raised card with selection ring\n\n### Field Props\n- **label**: Slot - Field label\n- **description**: Slot - Helper text below label\n- **required**: boolean (default: false) - Makes field required\n- **disabled**: boolean - Disables all checkboxes\n- **visible**: boolean - Controls field visibility\n- **name**: string - Form field name\n\n### Validation Props\n- **errors**: string[] | boolean (bindable) - Validation errors\n- **focused**: boolean (bindable) - Focus state\n- **onValidate**: (value: string[]) => string[] | boolean - Custom validation function\n\n### Styling Props\n- **class**: string - Additional CSS classes\n- **theme**: ComponentTheme - Custom theme overrides for all checkbox parts\n\n### Slot Props\nAll Field slot props are available:\n- **header**: Snippet - Custom header\n- **suffix**: Snippet - Content after input\n- **prefix**: Snippet - Content before input\n- **actions**: Snippet - Action buttons area\n- **helper**: Snippet - Helper text\n- **footer**: Snippet - Footer content\n- **error**: Snippet - Custom error display\n- **errorsContainer**: Snippet - Custom errors container\n\n## Structure\n\nThe component renders as a fieldset with the following DOM structure:\n```\n<fieldset>\n\t<Field wrapper>\n\t\t<label> <!-- For each option -->\n\t\t\t<input type=\"checkbox\" hidden />\n\t\t\t<div> <!-- Track (checkbox background) -->\n\t\t\t<div> <!-- Thumb (check mark) -->\n\t\t\t<Slot> <!-- Label -->\n\t\t\t<Slot> <!-- Description -->\n\t\t</label>\n\t</Field>\n</fieldset>\n```\n\n## Examples\n\n### Basic Checkbox List\n```svelte\n<script>\n\tlet interests = $state([]);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Interests\"\n\titems={[\n\t\t{ value: 'music', label: 'Music' },\n\t\t{ value: 'sports', label: 'Sports' },\n\t\t{ value: 'reading', label: 'Reading' },\n\t\t{ value: 'travel', label: 'Travel' }\n\t]}\n\tbind:value={interests}\n/>\n```\n\n### Card Mode\n```svelte\n<CheckboxesInput \n\tlabel=\"Select features\"\n\tmode=\"card\"\n\titems={[\n\t\t{ \n\t\t\tvalue: 'analytics', \n\t\t\tlabel: 'Analytics',\n\t\t\tdescription: 'Track user behavior and metrics'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'api', \n\t\t\tlabel: 'API Access',\n\t\t\tdescription: 'RESTful API for integrations'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'support', \n\t\t\tlabel: 'Priority Support',\n\t\t\tdescription: '24/7 dedicated support team'\n\t\t}\n\t]}\n\tbind:value={selectedFeatures}\n/>\n```\n\n### With Descriptions\n```svelte\n<CheckboxesInput \n\tlabel=\"Communication preferences\"\n\titems={[\n\t\t{ \n\t\t\tvalue: 'email', \n\t\t\tlabel: 'Email notifications',\n\t\t\tdescription: 'Receive updates via email'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'sms', \n\t\t\tlabel: 'SMS alerts',\n\t\t\tdescription: 'Text messages for urgent items'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'push', \n\t\t\tlabel: 'Push notifications',\n\t\t\tdescription: 'Browser push notifications'\n\t\t}\n\t]}\n\tbind:value={preferences}\n/>\n```\n\n### With Validation\n```svelte\n<script>\n\tlet skills = $state([]);\n\t\n\tfunction validateSkills(value) {\n\t\tif (value.length < 2) {\n\t\t\treturn ['Please select at least 2 skills'];\n\t\t}\n\t\treturn false;\n\t}\n</script>\n\n<CheckboxesInput \n\tlabel=\"Skills\"\n\trequired\n\titems={[\n\t\t{ value: 'js', label: 'JavaScript' },\n\t\t{ value: 'py', label: 'Python' },\n\t\t{ value: 'go', label: 'Go' },\n\t\t{ value: 'rust', label: 'Rust' }\n\t]}\n\tbind:value={skills}\n\tonValidate={validateSkills}\n/>\n```\n\n### In a Form\n```svelte\n<script>\n\timport { Form } from 'entasis/form';\n\t\n\tfunction handleSubmit(data) {\n\t\tconsole.log('Selected interests:', data.interests);\n\t}\n</script>\n\n<Form \n\tinputs={{\n\t\tinterests: {\n\t\t\ttype: 'checkboxes',\n\t\t\tlabel: 'Your interests',\n\t\t\trequired: true,\n\t\t\titems: [\n\t\t\t\t{ value: 'tech', label: 'Technology' },\n\t\t\t\t{ value: 'science', label: 'Science' },\n\t\t\t\t{ value: 'art', label: 'Art' },\n\t\t\t\t{ value: 'business', label: 'Business' }\n\t\t\t]\n\t\t}\n\t}}\n\tonSubmit={handleSubmit}\n/>\n```\n\n### With Custom Snippets\n```svelte\n<CheckboxesInput \n\tlabel=\"Select options\"\n\titems={[\n\t\t{ value: 'opt1', label: 'Option 1' },\n\t\t{ value: 'opt2', label: 'Option 2' }\n\t]}\n\tbind:value={selected}\n>\n\t{#snippet description()}\n\t\t<p class=\"text-sm text-muted\">Choose all that apply</p>\n\t{/snippet}\n\t\n\t{#snippet helper()}\n\t\t<p class=\"text-xs\">Selected: {selected.length}</p>\n\t{/snippet}\n</CheckboxesInput>\n```\n\n### Pre-selected Values\n```svelte\n<script>\n\tlet selected = $state(['option1', 'option3']);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Preferences\"\n\titems={[\n\t\t{ value: 'option1', label: 'Option 1' },\n\t\t{ value: 'option2', label: 'Option 2' },\n\t\t{ value: 'option3', label: 'Option 3' }\n\t]}\n\tbind:value={selected}\n/>\n```\n\n### Disabled State\n```svelte\n<CheckboxesInput \n\tlabel=\"Read-only selection\"\n\tdisabled\n\titems={items}\n\tvalue={['option1']}\n/>\n```\n\n### Complex Options with Rich Labels\n```svelte\n<script lang=\"ts\">\n\timport { Chip } from 'entasis/chip';\n\n\tlet plans = $state<string[]>([]);\n</script>\n\n{#snippet storageLabel()}\n\tExtra Storage <Chip color=\"primary\">+$5/mo</Chip>\n{/snippet}\n\n{#snippet usersLabel()}\n\tTeam Members <Chip color=\"success\">+$10/mo</Chip>\n{/snippet}\n\n<CheckboxesInput\n\tlabel=\"Select add-ons\"\n\tmode=\"card\"\n\titems={[\n\t\t{\n\t\t\tvalue: 'storage',\n\t\t\tlabel: storageLabel,\n\t\t\tdescription: '100GB additional cloud storage'\n\t\t},\n\t\t{\n\t\t\tvalue: 'users',\n\t\t\tlabel: usersLabel,\n\t\t\tdescription: 'Add up to 10 team members'\n\t\t}\n\t]}\n\tbind:value={plans}\n/>\n```\n\n## Validation\n\n- When **required** is true, at least one option must be selected\n- Custom validation via **onValidate** prop\n- Returns array of error messages or boolean\n- Errors are displayed inline below the field\n- Validation runs on change and blur\n\n## Modes\n\n### Normal Mode\n- Simple checkbox list layout\n- Compact design\n- Best for shorter lists or secondary choices\n\n### Card Mode\n- Each option displayed as a card with elevation\n- Selected cards show a primary selection ring\n- Better visual feedback\n- Ideal for feature selection or important choices\n\n## Accessibility\n\n- Uses semantic `<fieldset>` and `<legend>` elements\n- Each checkbox properly associated with its label\n- Hidden native checkbox inputs for keyboard navigation\n- Supports keyboard interaction (Space/Enter to toggle)\n- ARIA attributes for validation states\n- Error announcements for screen readers\n- Focus management within the group\n\n## Theme Customization\n\nThe CheckboxesInput component uses a theme object that can be customized using the `theme` prop or by setting a global theme.\n\n### Theme Structure\n\nThe theme object contains the following parts:\n- **root**: Main container styles\n- **checkboxesInputContainer**: Options grid container styles\n- **checkboxesInputItem**: Individual checkbox wrapper styles\n- **checkboxesInputItemTrack**: Checkbox background/track styles\n- **checkboxesInputItemThumb**: Check mark indicator styles\n- **checkboxesInputItemLabel**: Label text styles\n- **checkboxesInputItemDescription**: Description text styles\n- **checkboxesInputItemIcon**: Icon styling\n\n### Available Variants\n\n**root**:\n- base: Base classes for main container\n- Variants:\n - mode: 'card' | 'normal' - Layout mode\n\n**checkboxesInputContainer**:\n- base: Base classes for options grid container\n- Variants:\n - mode: 'card' | 'normal' - Grid layout based on mode\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItem**:\n- base: Base classes for individual checkbox wrapper\n- Variants:\n - mode: 'card' | 'normal' - Item styling based on mode\n - checked: boolean - Selected state styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemTrack**:\n- base: Base classes for checkbox track/background\n- Variants:\n - checked: boolean - Track styling when checked\n - mode: 'card' | 'normal' - Mode-based styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemThumb**:\n- base: Base classes for check mark indicator\n- Variants:\n - checked: boolean - Visibility and styling when checked\n - mode: 'card' | 'normal' - Mode-based styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemLabel**:\n- base: Base classes for label text\n\n**checkboxesInputItemDescription**:\n- base: Base classes for description text\n\n**checkboxesInputItemIcon**:\n- base: Base classes for icon styling\n\n### Usage Examples\n\n**Basic Theme Override**:\n```svelte\n<CheckboxesInput \n label=\"Options\"\n bind:value={selected}\n items={items}\n theme={{\n // The option grid lays itself out against its OWN width, not the viewport: declare the\n // container on the root and query it on the grid, so the columns follow the field's host\n // (a sidebar, a split pane, a dialog) instead of the device.\n root: { base: '@container' },\n checkboxesInputContainer: {\n base: 'grid-cols-1 @md:grid-cols-3 gap-lg'\n },\n checkboxesInputItem: {\n mode: {\n card: 'rounded-lg border-2'\n }\n }\n }}\n/>\n```\n\n**Card Mode Customization**:\n```svelte\n<CheckboxesInput \n mode=\"card\"\n label=\"Features\"\n bind:value={features}\n items={items}\n theme={{\n checkboxesInputItem: {\n checked: {\n true: 'ring-2 ring-primary bg-primary/10'\n },\n mode: {\n card: 'rounded-xl raised-3 hover:raised-4'\n }\n },\n checkboxesInputItemThumb: {\n checked: {\n true: 'bg-primary scale-100'\n }\n }\n }}\n/>\n```\n\n**Global Theme Setting**:\n```svelte\n<script>\n import { setCheckboxesInputTheme } from './index.ts';\n \n setCheckboxesInputTheme({\n root: { base: '@container' },\n checkboxesInputContainer: {\n base: 'gap-lg',\n mode: {\n card: 'grid-cols-1 @2xl:grid-cols-2'\n }\n },\n checkboxesInputItem: {\n mode: {\n card: 'rounded-lg transition-all'\n }\n }\n });\n</script>\n```\n\n## Notes\n\n- Value is always an array of strings (selected option values)\n- Empty array means no selections\n- Options are rendered in a responsive grid (1 column mobile, 2 columns desktop)\n- Check icon automatically appears when option is selected\n- Native checkbox is hidden but maintained for accessibility\n- Works seamlessly with Form component\n- Supports Svelte 5 snippets for labels and descriptions\n- Each option requires a unique `value` property\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
1
|
+
export declare const checkboxesInputDescription = "\n# CheckboxesInput Component\n\nThe CheckboxesInput component is a multi-selection input that allows users to select multiple options from a list. It provides a visually appealing interface with two display modes and supports custom labels and descriptions.\n\n## Basic Usage\n\n```svelte\n<script>\n\tlet selectedValues = $state([]);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Select your interests\"\n\titems={[\n\t\t{ value: 'coding', label: 'Coding' },\n\t\t{ value: 'design', label: 'Design' },\n\t\t{ value: 'marketing', label: 'Marketing' }\n\t]}\n\tbind:value={selectedValues}\n/>\n```\n\n## Props\n\n### Core Props\n- **items**: CheckboxOption[] (required) - Array of checkbox options\n - Each option has:\n - value: string (required) - Unique identifier for the option\n - label?: Slot - Display label (can be text or Svelte snippet)\n - description?: Slot - Optional description text\n - disabled?: boolean - The option cannot be toggled. When it is selected, a native `<form>` leaves it out of its submission (like a disabled native checkbox) while the field value, and so an entasis Form value, keeps it\n\n- **value**: string[] (bindable) - Array of selected option values. Typed from the options: with literal option values it is an array of that union, and `onValueChange` receives it\n- **selectAll**: boolean (default: false) - Adds a select-all checkbox above the options, labelled with the localized \"Select all\" (override with **selectAllLabel**). It is mixed (`aria-checked=\"mixed\"`) while some, but not all, enabled options are selected and lists the options in `aria-controls`. A click selects every enabled option, the next clears them, and the next gives back the partial selection the row started from; with no partial selection it toggles between all and none. Disabled options always keep their state. The field value stays the list of option values, so `required` and `onValidate` never see the row, and `onValueChange` fires once per click\n- **selectAllLabel**: Slot - Label of the select-all row\n- **mode**: 'normal' | 'card' (default: 'normal')\n - normal: Simple checkbox list\n - card: Each option displayed as a raised card with selection ring\n\n### Field Props\n- **label**: Slot - Field label\n- **description**: Slot - Helper text below label\n- **required**: boolean (default: false) - Makes field required\n- **disabled**: boolean - Disables all checkboxes. A disabled group is left out of the submitted Form value and skips validation\n- **readOnly**: boolean - Keeps every option focusable and announced (`aria-readonly`) while clicks and keys change nothing; the selection still validates and submits\n- **visible**: boolean - Controls field visibility\n- **name**: string - Form field name\n\n### Validation Props\n- **errors**: string[] | boolean (bindable) - Validation errors\n- **focused**: boolean (bindable) - Focus state\n- **onValidate**: (value: string[]) => string[] | boolean - Custom validation function\n\n### Styling Props\n- **class**: string - Additional CSS classes\n- **theme**: ComponentTheme - Custom theme overrides for all checkbox parts\n\n### Slot Props\nAll Field slot props are available:\n- **header**: Snippet - Custom header\n- **suffix**: Snippet - Content after input\n- **prefix**: Snippet - Content before input\n- **actions**: Snippet - Action buttons area\n- **helper**: Snippet - Helper text\n- **footer**: Snippet - Footer content\n- **error**: Snippet - Custom error display\n- **errorsContainer**: Snippet - Custom errors container\n\n## Structure\n\nThe component renders as a fieldset with the following DOM structure:\n```\n<fieldset>\n\t<Field wrapper>\n\t\t<label> <!-- For each option -->\n\t\t\t<input type=\"checkbox\" hidden />\n\t\t\t<div> <!-- Track (checkbox background) -->\n\t\t\t<div> <!-- Thumb (check mark) -->\n\t\t\t<Slot> <!-- Label -->\n\t\t\t<Slot> <!-- Description -->\n\t\t</label>\n\t</Field>\n</fieldset>\n```\n\n## Examples\n\n### Basic Checkbox List\n```svelte\n<script>\n\tlet interests = $state([]);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Interests\"\n\titems={[\n\t\t{ value: 'music', label: 'Music' },\n\t\t{ value: 'sports', label: 'Sports' },\n\t\t{ value: 'reading', label: 'Reading' },\n\t\t{ value: 'travel', label: 'Travel' }\n\t]}\n\tbind:value={interests}\n/>\n```\n\n### Card Mode\n```svelte\n<CheckboxesInput \n\tlabel=\"Select features\"\n\tmode=\"card\"\n\titems={[\n\t\t{ \n\t\t\tvalue: 'analytics', \n\t\t\tlabel: 'Analytics',\n\t\t\tdescription: 'Track user behavior and metrics'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'api', \n\t\t\tlabel: 'API Access',\n\t\t\tdescription: 'RESTful API for integrations'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'support', \n\t\t\tlabel: 'Priority Support',\n\t\t\tdescription: '24/7 dedicated support team'\n\t\t}\n\t]}\n\tbind:value={selectedFeatures}\n/>\n```\n\n### With Descriptions\n```svelte\n<CheckboxesInput \n\tlabel=\"Communication preferences\"\n\titems={[\n\t\t{ \n\t\t\tvalue: 'email', \n\t\t\tlabel: 'Email notifications',\n\t\t\tdescription: 'Receive updates via email'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'sms', \n\t\t\tlabel: 'SMS alerts',\n\t\t\tdescription: 'Text messages for urgent items'\n\t\t},\n\t\t{ \n\t\t\tvalue: 'push', \n\t\t\tlabel: 'Push notifications',\n\t\t\tdescription: 'Browser push notifications'\n\t\t}\n\t]}\n\tbind:value={preferences}\n/>\n```\n\n### With Validation\n```svelte\n<script>\n\tlet skills = $state([]);\n\t\n\tfunction validateSkills(value) {\n\t\tif (value.length < 2) {\n\t\t\treturn ['Please select at least 2 skills'];\n\t\t}\n\t\treturn false;\n\t}\n</script>\n\n<CheckboxesInput \n\tlabel=\"Skills\"\n\trequired\n\titems={[\n\t\t{ value: 'js', label: 'JavaScript' },\n\t\t{ value: 'py', label: 'Python' },\n\t\t{ value: 'go', label: 'Go' },\n\t\t{ value: 'rust', label: 'Rust' }\n\t]}\n\tbind:value={skills}\n\tonValidate={validateSkills}\n/>\n```\n\n### In a Form\n```svelte\n<script>\n\timport { Form } from 'entasis/form';\n\t\n\tfunction handleSubmit(data) {\n\t\tconsole.log('Selected interests:', data.interests);\n\t}\n</script>\n\n<Form \n\tinputs={{\n\t\tinterests: {\n\t\t\ttype: 'checkboxes',\n\t\t\tlabel: 'Your interests',\n\t\t\trequired: true,\n\t\t\titems: [\n\t\t\t\t{ value: 'tech', label: 'Technology' },\n\t\t\t\t{ value: 'science', label: 'Science' },\n\t\t\t\t{ value: 'art', label: 'Art' },\n\t\t\t\t{ value: 'business', label: 'Business' }\n\t\t\t]\n\t\t}\n\t}}\n\tonSubmit={handleSubmit}\n/>\n```\n\n### With Custom Snippets\n```svelte\n<CheckboxesInput \n\tlabel=\"Select options\"\n\titems={[\n\t\t{ value: 'opt1', label: 'Option 1' },\n\t\t{ value: 'opt2', label: 'Option 2' }\n\t]}\n\tbind:value={selected}\n>\n\t{#snippet description()}\n\t\t<p class=\"text-sm text-muted\">Choose all that apply</p>\n\t{/snippet}\n\t\n\t{#snippet helper()}\n\t\t<p class=\"text-xs\">Selected: {selected.length}</p>\n\t{/snippet}\n</CheckboxesInput>\n```\n\n### Pre-selected Values\n```svelte\n<script>\n\tlet selected = $state(['option1', 'option3']);\n</script>\n\n<CheckboxesInput \n\tlabel=\"Preferences\"\n\titems={[\n\t\t{ value: 'option1', label: 'Option 1' },\n\t\t{ value: 'option2', label: 'Option 2' },\n\t\t{ value: 'option3', label: 'Option 3' }\n\t]}\n\tbind:value={selected}\n/>\n```\n\n### Disabled State\n```svelte\n<CheckboxesInput \n\tlabel=\"Read-only selection\"\n\tdisabled\n\titems={items}\n\tvalue={['option1']}\n/>\n```\n\n### Complex Options with Rich Labels\n```svelte\n<script lang=\"ts\">\n\timport { Chip } from 'entasis/chip';\n\n\tlet plans = $state<string[]>([]);\n</script>\n\n{#snippet storageLabel()}\n\tExtra Storage <Chip color=\"primary\">+$5/mo</Chip>\n{/snippet}\n\n{#snippet usersLabel()}\n\tTeam Members <Chip color=\"success\">+$10/mo</Chip>\n{/snippet}\n\n<CheckboxesInput\n\tlabel=\"Select add-ons\"\n\tmode=\"card\"\n\titems={[\n\t\t{\n\t\t\tvalue: 'storage',\n\t\t\tlabel: storageLabel,\n\t\t\tdescription: '100GB additional cloud storage'\n\t\t},\n\t\t{\n\t\t\tvalue: 'users',\n\t\t\tlabel: usersLabel,\n\t\t\tdescription: 'Add up to 10 team members'\n\t\t}\n\t]}\n\tbind:value={plans}\n/>\n```\n\n## Validation\n\n- When **required** is true, at least one option must be selected\n- Custom validation via **onValidate** prop\n- Returns array of error messages or boolean\n- Errors are displayed inline below the field\n- Validation runs on change and blur\n\n## Modes\n\n### Normal Mode\n- Simple checkbox list layout\n- Compact design\n- Best for shorter lists or secondary choices\n\n### Card Mode\n- Each option displayed as a card with elevation\n- Selected cards show a primary selection ring\n- Better visual feedback\n- Ideal for feature selection or important choices\n\n## Accessibility\n\n- Uses semantic `<fieldset>` and `<legend>` elements\n- Each option is named by its label (`aria-labelledby`) and described by its description (`aria-describedby`), so the description is not part of the accessible name\n- Every option is a Tab stop; Space toggles it. Enter does not toggle: like a native checkbox it continues the form. Inside an entasis Form it validates the field and moves focus to the next one (the last field submits), and inside a plain `<form>` it clicks the form's default submit button\n- The submitted values are hidden inputs beside the options (never inside a button), one per selected enabled option; a required group blocks a native submit while nothing is selected\n- ARIA attributes for validation states\n- Error announcements for screen readers\n- Each option button gets an id unique to the instance (`<field id>-option-<index>`), so two fields with the same `name` or values containing spaces never produce duplicate or invalid ids\n\n## Theme Customization\n\nThe CheckboxesInput component uses a theme object that can be customized using the `theme` prop or by setting a global theme.\n\n### Theme Structure\n\nThe theme object contains the following parts:\n- **root**: Main container styles\n- **checkboxesInputContainer**: Options grid container styles\n- **checkboxesInputItem**: Individual checkbox wrapper styles\n- **checkboxesInputItemTrack**: Checkbox background/track styles\n- **checkboxesInputItemThumb**: Check mark indicator styles\n- **checkboxesInputItemLabel**: Label text styles\n- **checkboxesInputItemDescription**: Description text styles\n- **checkboxesInputItemIcon**: Icon styling\n\n### Available Variants\n\n**root**:\n- base: Base classes for main container\n- Variants:\n - mode: 'card' | 'normal' - Layout mode\n\n**checkboxesInputContainer**:\n- base: Base classes for options grid container\n- Variants:\n - mode: 'card' | 'normal' - Grid layout based on mode\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItem**:\n- base: Base classes for individual checkbox wrapper\n- Variants:\n - mode: 'card' | 'normal' - Item styling based on mode\n - checked: boolean - Selected state styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemTrack**:\n- base: Base classes for checkbox track/background\n- Variants:\n - checked: boolean - Track styling when checked\n - mode: 'card' | 'normal' - Mode-based styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemThumb**:\n- base: Base classes for check mark indicator\n- Variants:\n - checked: boolean - Visibility and styling when checked\n - mode: 'card' | 'normal' - Mode-based styling\n - disabled: boolean - Disabled state styling\n\n**checkboxesInputItemLabel**:\n- base: Base classes for label text\n\n**checkboxesInputItemDescription**:\n- base: Base classes for description text\n\n**checkboxesInputItemIcon**:\n- base: Base classes for icon styling\n\n### Usage Examples\n\n**Basic Theme Override**:\n```svelte\n<CheckboxesInput \n label=\"Options\"\n bind:value={selected}\n items={items}\n theme={{\n // The option grid lays itself out against its OWN width, not the viewport: declare the\n // container on the root and query it on the grid, so the columns follow the field's host\n // (a sidebar, a split pane, a dialog) instead of the device.\n root: { base: '@container' },\n checkboxesInputContainer: {\n base: 'grid-cols-1 @md:grid-cols-3 gap-lg'\n },\n checkboxesInputItem: {\n mode: {\n card: 'rounded-lg border-2'\n }\n }\n }}\n/>\n```\n\n**Card Mode Customization**:\n```svelte\n<CheckboxesInput \n mode=\"card\"\n label=\"Features\"\n bind:value={features}\n items={items}\n theme={{\n checkboxesInputItem: {\n checked: {\n true: 'ring-2 ring-primary bg-primary/10'\n },\n mode: {\n card: 'rounded-xl raised-3 hover:raised-4'\n }\n },\n checkboxesInputItemThumb: {\n checked: {\n true: 'bg-primary scale-100'\n }\n }\n }}\n/>\n```\n\n**Global Theme Setting**:\n```svelte\n<script>\n import { setCheckboxesInputTheme } from './index.ts';\n \n setCheckboxesInputTheme({\n root: { base: '@container' },\n checkboxesInputContainer: {\n base: 'gap-lg',\n mode: {\n card: 'grid-cols-1 @2xl:grid-cols-2'\n }\n },\n checkboxesInputItem: {\n mode: {\n card: 'rounded-lg transition-all'\n }\n }\n });\n</script>\n```\n\n## Notes\n\n- Value is always an array of strings (selected option values)\n- Empty array means no selections\n- Options are rendered in a responsive grid (1 column mobile, 2 columns desktop)\n- Check icon automatically appears when option is selected\n- Hidden native inputs sit beside the options so plain `<form>` submissions work\n- Works seamlessly with Form component\n- Supports Svelte 5 snippets for labels and descriptions\n- Each option requires a unique `value` property\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
@@ -29,8 +29,11 @@ The CheckboxesInput component is a multi-selection input that allows users to se
|
|
|
29
29
|
- value: string (required) - Unique identifier for the option
|
|
30
30
|
- label?: Slot - Display label (can be text or Svelte snippet)
|
|
31
31
|
- description?: Slot - Optional description text
|
|
32
|
+
- disabled?: boolean - The option cannot be toggled. When it is selected, a native \`<form>\` leaves it out of its submission (like a disabled native checkbox) while the field value, and so an entasis Form value, keeps it
|
|
32
33
|
|
|
33
|
-
- **value**: string[] (bindable) - Array of selected option values
|
|
34
|
+
- **value**: string[] (bindable) - Array of selected option values. Typed from the options: with literal option values it is an array of that union, and \`onValueChange\` receives it
|
|
35
|
+
- **selectAll**: boolean (default: false) - Adds a select-all checkbox above the options, labelled with the localized "Select all" (override with **selectAllLabel**). It is mixed (\`aria-checked="mixed"\`) while some, but not all, enabled options are selected and lists the options in \`aria-controls\`. A click selects every enabled option, the next clears them, and the next gives back the partial selection the row started from; with no partial selection it toggles between all and none. Disabled options always keep their state. The field value stays the list of option values, so \`required\` and \`onValidate\` never see the row, and \`onValueChange\` fires once per click
|
|
36
|
+
- **selectAllLabel**: Slot - Label of the select-all row
|
|
34
37
|
- **mode**: 'normal' | 'card' (default: 'normal')
|
|
35
38
|
- normal: Simple checkbox list
|
|
36
39
|
- card: Each option displayed as a raised card with selection ring
|
|
@@ -39,7 +42,8 @@ The CheckboxesInput component is a multi-selection input that allows users to se
|
|
|
39
42
|
- **label**: Slot - Field label
|
|
40
43
|
- **description**: Slot - Helper text below label
|
|
41
44
|
- **required**: boolean (default: false) - Makes field required
|
|
42
|
-
- **disabled**: boolean - Disables all checkboxes
|
|
45
|
+
- **disabled**: boolean - Disables all checkboxes. A disabled group is left out of the submitted Form value and skips validation
|
|
46
|
+
- **readOnly**: boolean - Keeps every option focusable and announced (\`aria-readonly\`) while clicks and keys change nothing; the selection still validates and submits
|
|
43
47
|
- **visible**: boolean - Controls field visibility
|
|
44
48
|
- **name**: string - Form field name
|
|
45
49
|
|
|
@@ -312,12 +316,12 @@ The component renders as a fieldset with the following DOM structure:
|
|
|
312
316
|
## Accessibility
|
|
313
317
|
|
|
314
318
|
- Uses semantic \`<fieldset>\` and \`<legend>\` elements
|
|
315
|
-
- Each
|
|
316
|
-
-
|
|
317
|
-
-
|
|
319
|
+
- Each option is named by its label (\`aria-labelledby\`) and described by its description (\`aria-describedby\`), so the description is not part of the accessible name
|
|
320
|
+
- Every option is a Tab stop; Space toggles it. Enter does not toggle: like a native checkbox it continues the form. Inside an entasis Form it validates the field and moves focus to the next one (the last field submits), and inside a plain \`<form>\` it clicks the form's default submit button
|
|
321
|
+
- The submitted values are hidden inputs beside the options (never inside a button), one per selected enabled option; a required group blocks a native submit while nothing is selected
|
|
318
322
|
- ARIA attributes for validation states
|
|
319
323
|
- Error announcements for screen readers
|
|
320
|
-
-
|
|
324
|
+
- Each option button gets an id unique to the instance (\`<field id>-option-<index>\`), so two fields with the same \`name\` or values containing spaces never produce duplicate or invalid ids
|
|
321
325
|
|
|
322
326
|
## Theme Customization
|
|
323
327
|
|
|
@@ -456,7 +460,7 @@ The theme object contains the following parts:
|
|
|
456
460
|
- Empty array means no selections
|
|
457
461
|
- Options are rendered in a responsive grid (1 column mobile, 2 columns desktop)
|
|
458
462
|
- Check icon automatically appears when option is selected
|
|
459
|
-
-
|
|
463
|
+
- Hidden native inputs sit beside the options so plain \`<form>\` submissions work
|
|
460
464
|
- Works seamlessly with Form component
|
|
461
465
|
- Supports Svelte 5 snippets for labels and descriptions
|
|
462
466
|
- Each option requires a unique \`value\` property
|
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import type { Slot } from '../../Slot/slot.js';
|
|
2
2
|
import type { FieldProps, InputProps } from '../Field/field.js';
|
|
3
3
|
import type { CheckboxesInputThemeProps } from './checkboxesInput.theme.js';
|
|
4
|
-
export type CheckboxOption = {
|
|
4
|
+
export type CheckboxOption<Value extends string = string> = {
|
|
5
5
|
/** Display content for the option, rendered as the option label. */
|
|
6
6
|
label?: Slot;
|
|
7
7
|
/** Unique value for the option, used as the checkbox value and selection key. */
|
|
8
|
-
value:
|
|
8
|
+
value: Value;
|
|
9
9
|
/** Supporting content rendered below the option label. */
|
|
10
10
|
description?: Slot;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Prevents toggling this individual option. A native `<form>` leaves a disabled option out of
|
|
13
|
+
* its submission, while the field value (and so an entasis Form's value) keeps it when selected.
|
|
14
|
+
*/
|
|
12
15
|
disabled?: boolean;
|
|
13
16
|
};
|
|
14
17
|
export type CheckboxMode = 'card' | 'normal';
|
|
15
|
-
export type CheckboxesInputProps<T extends CheckboxOption = CheckboxOption> = Omit<InputProps<'checkboxes'>, 'theme' | 'value' | 'defaultValue' | 'onValueChange'> & {
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
+
export type CheckboxesInputProps<T extends CheckboxOption = CheckboxOption, Value extends string = T['value']> = Omit<InputProps<'checkboxes'>, 'theme' | 'value' | 'defaultValue' | 'onValueChange'> & {
|
|
19
|
+
/**
|
|
20
|
+
* Selected option values, bindable with `bind:value`. Typed from the options' `value`s, so
|
|
21
|
+
* literal values (`items` declared `as const`, or with literal `value`s) give a union of them.
|
|
22
|
+
*/
|
|
23
|
+
value?: Value[];
|
|
18
24
|
/** Initial selected option values when `value` is omitted. */
|
|
19
|
-
defaultValue?:
|
|
25
|
+
defaultValue?: Value[];
|
|
20
26
|
/** Called when the selected option values change. */
|
|
21
|
-
onValueChange?: (value:
|
|
27
|
+
onValueChange?: (value: Value[]) => void;
|
|
22
28
|
/** Visual layout style for the checkbox group (`normal` or `card`). */
|
|
23
29
|
mode?: CheckboxMode;
|
|
24
30
|
/** Items to render as checkbox choices. */
|
|
25
|
-
items: T[];
|
|
31
|
+
items: readonly (T & CheckboxOption<Value>)[];
|
|
32
|
+
/**
|
|
33
|
+
* Adds a select-all checkbox above the options. It is mixed while some, but not all, of the
|
|
34
|
+
* enabled options are selected. A click selects every enabled option, the next clears them,
|
|
35
|
+
* and the next gives back the partial selection the row started from (with no partial
|
|
36
|
+
* selection it toggles between all and none). Disabled options keep their state, and the
|
|
37
|
+
* field value stays the list of option values.
|
|
38
|
+
*/
|
|
39
|
+
selectAll?: boolean;
|
|
40
|
+
/** Label of the select-all checkbox. Defaults to the localized "Select all". */
|
|
41
|
+
selectAllLabel?: Slot;
|
|
26
42
|
/** Theme overrides for the checkbox group and shared field parts. */
|
|
27
43
|
theme?: CheckboxesInputThemeProps & InputProps<'checkboxes'>['theme'];
|
|
28
44
|
} & Partial<Omit<FieldProps<'checkboxes'>, 'children' | 'field' | 'type' | 'theme'>>;
|
|
@@ -26,6 +26,10 @@ export declare const checkboxesInputTheme: {
|
|
|
26
26
|
true: string;
|
|
27
27
|
false: string;
|
|
28
28
|
};
|
|
29
|
+
readOnly: {
|
|
30
|
+
true: string;
|
|
31
|
+
false: string;
|
|
32
|
+
};
|
|
29
33
|
}> & import("../../../utils/cva/types.js").CVAClassProp) | undefined) => string;
|
|
30
34
|
checkboxesInputItemLabel: (props?: (import("../../../utils/cva/types.js").CVAVariantSchema<{
|
|
31
35
|
size: {
|
|
@@ -127,6 +131,10 @@ export declare const setCheckboxesInputTheme: (theme: InferComponentTheme<{
|
|
|
127
131
|
true: string;
|
|
128
132
|
false: string;
|
|
129
133
|
};
|
|
134
|
+
readOnly: {
|
|
135
|
+
true: string;
|
|
136
|
+
false: string;
|
|
137
|
+
};
|
|
130
138
|
}> & import("../../../utils/cva/types.js").CVAClassProp) | undefined) => string;
|
|
131
139
|
checkboxesInputItemLabel: (props?: (import("../../../utils/cva/types.js").CVAVariantSchema<{
|
|
132
140
|
size: {
|
|
@@ -226,6 +234,10 @@ export declare const useCheckboxesInputTheme: import("../../../utils/cva/theme.j
|
|
|
226
234
|
true: string;
|
|
227
235
|
false: string;
|
|
228
236
|
};
|
|
237
|
+
readOnly: {
|
|
238
|
+
true: string;
|
|
239
|
+
false: string;
|
|
240
|
+
};
|
|
229
241
|
}> & import("../../../utils/cva/types.js").CVAClassProp) | undefined) => string;
|
|
230
242
|
checkboxesInputItemLabel: (props?: (import("../../../utils/cva/types.js").CVAVariantSchema<{
|
|
231
243
|
size: {
|
|
@@ -11,12 +11,12 @@ const defaultCheckboxesInput = cva({
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
const defaultCheckboxesInputItem = cva({
|
|
14
|
-
base: 'relative grid w-full cursor-pointer items-start gap-xs rounded-md
|
|
14
|
+
base: 'relative grid w-full cursor-pointer items-start gap-xs rounded-md ps-layout-xl text-start transition-[color,background-color,box-shadow,opacity] outline-none focus-visible:ring-2 focus-visible:ring-focus/50',
|
|
15
15
|
variants: {
|
|
16
16
|
mode: {
|
|
17
17
|
card: 'raised bg-surface-raised py-md',
|
|
18
18
|
normal: 'py-xs',
|
|
19
|
-
control: '!inline-grid !min-h-0 !grid-cols-1 !place-items-center !gap-0 !p-0 !
|
|
19
|
+
control: '!inline-grid !min-h-0 !grid-cols-1 !place-items-center !gap-0 !p-0 !ps-0'
|
|
20
20
|
},
|
|
21
21
|
size: {
|
|
22
22
|
small: 'min-h-row-sm',
|
|
@@ -30,6 +30,11 @@ const defaultCheckboxesInputItem = cva({
|
|
|
30
30
|
disabled: {
|
|
31
31
|
true: 'cursor-not-allowed opacity-50',
|
|
32
32
|
false: ''
|
|
33
|
+
},
|
|
34
|
+
// Focusable and announced, but not changeable: no pointer cursor promising a toggle.
|
|
35
|
+
readOnly: {
|
|
36
|
+
true: 'cursor-default',
|
|
37
|
+
false: ''
|
|
33
38
|
}
|
|
34
39
|
},
|
|
35
40
|
defaultVariants: {
|
|
@@ -72,7 +77,7 @@ const defaultCheckboxesInputItemLabel = cva({
|
|
|
72
77
|
}
|
|
73
78
|
});
|
|
74
79
|
const defaultCheckboxesInputItemTrack = cva({
|
|
75
|
-
base: 'origin-center content-[""] bg-surface-raised border border-neutral-muted rounded-sm absolute
|
|
80
|
+
base: 'origin-center content-[""] bg-surface-raised border border-neutral-muted rounded-sm absolute start-2',
|
|
76
81
|
variants: {
|
|
77
82
|
checked: {
|
|
78
83
|
true: '',
|
|
@@ -98,7 +103,7 @@ const defaultCheckboxesInputItemTrack = cva({
|
|
|
98
103
|
const defaultCheckboxesInputItemThumb = cva({
|
|
99
104
|
// The check/minus icons paint with `currentColor`, so the thumb's text colour is the
|
|
100
105
|
// mark colour: `selected-contrast` against the `bg-selected` fill it gets when checked.
|
|
101
|
-
base: 'origin-center radio rounded-sm flex items-center justify-center transition-[background-color,opacity,scale] content-[""] absolute
|
|
106
|
+
base: 'origin-center radio rounded-sm flex items-center justify-center transition-[background-color,opacity,scale] content-[""] absolute start-2 scale-[85%] opacity-0 p-xs text-selected-contrast',
|
|
102
107
|
variants: {
|
|
103
108
|
checked: {
|
|
104
109
|
true: 'bg-selected scale-[100%] opacity-100',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FieldType } from '../Field/field.js';
|
|
2
|
+
import type { FieldState } from '../Field/field.state.svelte.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handles an Enter key press on a choice control's element. Enter never toggles or selects, so
|
|
5
|
+
* every Enter nobody cancelled is cancelled here (a button would click on it, and again on each
|
|
6
|
+
* auto-repeat). Only a plain press moves the form on; a repeat, an IME composition and a press
|
|
7
|
+
* with a modifier are swallowed without submitting. Returns whether the form was continued.
|
|
8
|
+
*/
|
|
9
|
+
export declare const continueFormFromChoice: <T extends FieldType>(event: KeyboardEvent & {
|
|
10
|
+
currentTarget: EventTarget & Element;
|
|
11
|
+
}, field: FieldState<T>) => boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Enter on a choice control. A native checkbox or radio does not toggle on Enter: it submits its
|
|
2
|
+
// form through the form's default button, as a text field does. Checkbox, CheckboxesInput and
|
|
3
|
+
// RadioInput are buttons, so they mirror that here: inside an entasis Form Enter moves on to the
|
|
4
|
+
// next field (the last one submits), and inside a plain <form> it requests the native submission.
|
|
5
|
+
import { requestNativeSubmit } from '../../../utils/requestNativeSubmit.js';
|
|
6
|
+
/**
|
|
7
|
+
* Handles an Enter key press on a choice control's element. Enter never toggles or selects, so
|
|
8
|
+
* every Enter nobody cancelled is cancelled here (a button would click on it, and again on each
|
|
9
|
+
* auto-repeat). Only a plain press moves the form on; a repeat, an IME composition and a press
|
|
10
|
+
* with a modifier are swallowed without submitting. Returns whether the form was continued.
|
|
11
|
+
*/
|
|
12
|
+
export const continueFormFromChoice = (event, field) => {
|
|
13
|
+
if (event.key !== 'Enter' || event.defaultPrevented)
|
|
14
|
+
return false;
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
if (event.repeat ||
|
|
17
|
+
event.isComposing ||
|
|
18
|
+
event.shiftKey ||
|
|
19
|
+
event.altKey ||
|
|
20
|
+
event.ctrlKey ||
|
|
21
|
+
event.metaKey) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (!field.form?.advanceFrom(field))
|
|
25
|
+
requestNativeSubmit(event.currentTarget);
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import FieldActionButton from '../Field/FieldActionButton.svelte';
|
|
8
8
|
import { createFieldState } from '../Field/field.state.svelte.js';
|
|
9
9
|
import Popover from '../../Popover/Popover.svelte';
|
|
10
|
-
import type {
|
|
10
|
+
import type { PopoverApi } from '../../Popover/popover.api.js';
|
|
11
11
|
import { useI18n } from '../../../i18n/context.svelte.js';
|
|
12
12
|
import type { ColorInputProps } from './colorInput.props.js';
|
|
13
13
|
import { useColorInputTheme } from './colorInput.theme.js';
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
placeholder = '',
|
|
23
23
|
theme,
|
|
24
24
|
disabled,
|
|
25
|
+
readOnly,
|
|
26
|
+
messages,
|
|
25
27
|
name,
|
|
26
28
|
onValidate,
|
|
27
29
|
onValueChange,
|
|
@@ -61,6 +63,12 @@
|
|
|
61
63
|
set disabled(v: boolean | undefined) {
|
|
62
64
|
disabled = v;
|
|
63
65
|
},
|
|
66
|
+
get readOnly() {
|
|
67
|
+
return readOnly;
|
|
68
|
+
},
|
|
69
|
+
get messages() {
|
|
70
|
+
return messages;
|
|
71
|
+
},
|
|
64
72
|
get required() {
|
|
65
73
|
return required;
|
|
66
74
|
},
|
|
@@ -175,6 +183,7 @@
|
|
|
175
183
|
<Popover
|
|
176
184
|
id={`${id}-color-popover`}
|
|
177
185
|
bind:open={isPickerOpen}
|
|
186
|
+
label={`${t.choose} ${t.color}`}
|
|
178
187
|
position="bottom-start"
|
|
179
188
|
size="normal"
|
|
180
189
|
class={classes.popover({ class: theme?.popover?.base })}
|
|
@@ -192,7 +201,7 @@
|
|
|
192
201
|
/>
|
|
193
202
|
</div>
|
|
194
203
|
|
|
195
|
-
{#snippet trigger(popover:
|
|
204
|
+
{#snippet trigger(popover: PopoverApi)}
|
|
196
205
|
{#snippet swatch()}
|
|
197
206
|
<span class={classes.swatch({ empty: isEmpty, class: theme?.swatch?.base })}>
|
|
198
207
|
{#if !isEmpty}
|
|
@@ -215,7 +224,7 @@
|
|
|
215
224
|
}
|
|
216
225
|
}}
|
|
217
226
|
{...rest}
|
|
218
|
-
{
|
|
227
|
+
anchor={popover.reference}
|
|
219
228
|
>
|
|
220
229
|
<!-- Same primitive as the password visibility toggle: the action button stretches to the
|
|
221
230
|
field's full height/padding, so the click target is much larger than the swatch itself. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const colorInputDescription = "\n# ColorInput Component\n\nThe ColorInput is a form field for picking a color. It shows a color swatch and a text input inside\nthe shared Field frame, and opens a full ColorPicker panel in a Popover. Its value is a canonical hex\nstring (`#rrggbb`, or `#rrggbbaa` when alpha < 1).\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { ColorInput } from 'entasis/color-input';\n\tlet color = $state('#6366f1');\n</script>\n\n<ColorInput label=\"Brand color\" bind:value={color} />\n```\n\n## Props\n\nExtends all Field component props plus:\n\n### Core Props\n- **value**: `string | null` (bindable) - The selected color. The canonical value is always hex:\n `#rrggbb`, or `#rrggbbaa` when alpha < 1. Any parseable CSS color (named colors, `rgb()`,\n `rgba()`, `hsl()`, `hsla()`, `#rgb`, `#rrggbb`, `#rrggbbaa`) is accepted programmatically and\n normalized to hex on commit. `null` renders the empty/neutral swatch and an empty input.\n- **format**: `'hex' | 'rgb' | 'hsl'` (bindable, default: `'hex'`) - The text representation shown\n in the input and the picker's format select. The bound `value` stays hex regardless. Bindable so a\n format change from the picker flows back out.\n\n### Display Props\n- **placeholder**: `string` - Hint text shown in the empty color input. Defaults to the selected\n format's pattern: `#rrggbb`, `rgb(r, g, b)` or `hsl(h, s%, l%)`.\n\n### Field Props (inherited)\n- **label**: string | Snippet - Field label\n- **description**: string | Snippet - Helper text\n- **required**: boolean - Mark as required (a required color must be a non-empty string)\n- **disabled**: boolean - Disable input, swatch and picker\n- **size**: 'small' | 'normal' | 'large' - Field size, forwarded to the embedded ColorPicker\n\n### Event Props\n- **onValueChange**: `(value: string) => void` - Fires on every committed change, including continuously\n while dragging in the picker. Receives the canonical hex string.\n- **onValidate**: `(value: string) => string[] | boolean` - Custom validation.\n\n### Styling Props\n- **class**: string - Additional CSS classes on the field root\n- **theme**: ColorInputTheme - Theme overrides (also accepts Field theme parts)\n- **i18n**: Partial<Messages> - Per-instance i18n overrides, also forwarded to the ColorPicker\n\n## Structure\n\n```\n<Popover>\n\t<Field>\n\t\t<Swatch /> <!-- opens the picker -->\n\t\t<Input /> <!-- shows the value in the chosen format -->\n\t</Field>\n\t<ColorPicker /> <!-- inside the popover panel -->\n</Popover>\n```\n\n## Examples\n\n### With alpha\n```svelte\n<ColorInput label=\"Overlay\" value=\"#00000080\" />\n```\n\n### RGB text representation\n```svelte\n<ColorInput label=\"Accent\" bind:value={accent} format=\"rgb\" />\n```\n\n### Required inside a Form\n```svelte\n<Form\n\tinputs={{\n\t\tcolor: { type: 'color', label: 'Theme color', required: true }\n\t}}\n/>\n```\n\n### Disabled\n```svelte\n<ColorInput label=\"Locked\" value=\"#22c55e\" disabled />\n```\n\n## Interaction\n\n- The swatch button toggles the picker popover; focusing the text input also opens it (like DateInput).\n- The text input is masked (Maskito) for the selected format: hex auto-inserts the leading `#` and\n takes up to 8 hex digits; rgb/hsl are structured templates that auto-insert the `rgb(` / `hsl(`\n prefix, the `, ` separators and hsl's `%` suffixes as digits flow in (3 digits per channel, or\n `,` to end a channel early \u2014 a missing closing `)` is completed on commit). Valid entries commit\n immediately (normalized to hex); an incomplete entry does not commit and the input text is restored\n from the canonical value on blur. Clearing the input sets the value to `null`.\n- Dragging inside the picker updates the value live. The popover does not close on pick (color picking\n is continuous); it closes on click-outside or Escape.\n- Changing the format select in the picker updates the input's text representation while keeping the\n bound value as hex.\n\n## Accessibility\n\n- The swatch sits inside a field action button (the same primitive as the password visibility\n toggle), which stretches to the field's full height for a generous hit target and carries\n `aria-haspopup=\"dialog\"`, `aria-expanded`, `aria-controls`, and a localized \"Choose Color\" label.\n- The text input carries a localized \"Color value\" label and is associated with the field label.\n- The embedded ColorPicker exposes its saturation/brightness square and hue/alpha sliders as focusable\n `role=\"slider\"` controls with full keyboard support (see the ColorPicker docs).\n\n## Theme Customization\n\nThe theme object contains the following parts:\n- **input**: The color text input element (size, disabled variants)\n- **inputContainer**: The bordered field container (size, disabled variants)\n- **popover**: The popover panel wrapping the ColorPicker\n- **swatch**: The color swatch inside the leading action button (empty variant)\n\nField theme parts (label, description, error, ...) are also accepted on the same `theme` prop.\n\n```svelte\n<ColorInput\n\tlabel=\"Brand color\"\n\tbind:value={color}\n\ttheme={{\n\t\tswatch: { base: 'rounded-full', empty: { true: 'bg-neutral-muted/50' } },\n\t\tinputContainer: { base: 'border-2' }\n\t}}\n/>\n```\n\n## Notes\n\n- The canonical `value` is always hex; use `format` only to change the input's text representation.\n- The swatch renders the color over a CSS checkerboard so colors with alpha < 1 read correctly, and\n shows a neutral muted square when the value is `null`.\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
1
|
+
export declare const colorInputDescription = "\n# ColorInput Component\n\nThe ColorInput is a form field for picking a color. It shows a color swatch and a text input inside\nthe shared Field frame, and opens a full ColorPicker panel in a Popover. Its value is a canonical hex\nstring (`#rrggbb`, or `#rrggbbaa` when alpha < 1).\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { ColorInput } from 'entasis/color-input';\n\tlet color = $state('#6366f1');\n</script>\n\n<ColorInput label=\"Brand color\" bind:value={color} />\n```\n\n## Props\n\nExtends all Field component props plus:\n\n### Core Props\n- **value**: `string | null` (bindable) - The selected color. The canonical value is always hex:\n `#rrggbb`, or `#rrggbbaa` when alpha < 1. Any parseable CSS color (named colors, `rgb()`,\n `rgba()`, `hsl()`, `hsla()`, `#rgb`, `#rrggbb`, `#rrggbbaa`) is accepted programmatically and\n normalized to hex on commit. `null` renders the empty/neutral swatch and an empty input.\n- **format**: `'hex' | 'rgb' | 'hsl'` (bindable, default: `'hex'`) - The text representation shown\n in the input and the picker's format select. The bound `value` stays hex regardless. Bindable so a\n format change from the picker flows back out.\n\n### Display Props\n- **placeholder**: `string` - Hint text shown in the empty color input. Defaults to the selected\n format's pattern: `#rrggbb`, `rgb(r, g, b)` or `hsl(h, s%, l%)`.\n\n### Field Props (inherited)\n- **label**: string | Snippet - Field label\n- **description**: string | Snippet - Helper text\n- **required**: boolean - Mark as required (a required color must be a non-empty string)\n- **disabled**: boolean - Disable input, swatch and picker\n- **readOnly**: boolean - The input stays focusable and announced as read-only and the color cannot be changed (typing or picking); the value still validates and submits\n- **size**: 'small' | 'normal' | 'large' - Field size, forwarded to the embedded ColorPicker\n\n### Event Props\n- **onValueChange**: `(value: string) => void` - Fires on every committed change, including continuously\n while dragging in the picker. Receives the canonical hex string.\n- **onValidate**: `(value: string) => string[] | boolean` - Custom validation.\n\n### Styling Props\n- **class**: string - Additional CSS classes on the field root\n- **theme**: ColorInputTheme - Theme overrides (also accepts Field theme parts)\n- **i18n**: Partial<Messages> - Per-instance i18n overrides, also forwarded to the ColorPicker\n\n## Structure\n\n```\n<Popover>\n\t<Field>\n\t\t<Swatch /> <!-- opens the picker -->\n\t\t<Input /> <!-- shows the value in the chosen format -->\n\t</Field>\n\t<ColorPicker /> <!-- inside the popover panel -->\n</Popover>\n```\n\n## Examples\n\n### With alpha\n```svelte\n<ColorInput label=\"Overlay\" value=\"#00000080\" />\n```\n\n### RGB text representation\n```svelte\n<ColorInput label=\"Accent\" bind:value={accent} format=\"rgb\" />\n```\n\n### Required inside a Form\n```svelte\n<Form\n\tinputs={{\n\t\tcolor: { type: 'color', label: 'Theme color', required: true }\n\t}}\n/>\n```\n\n### Disabled\n```svelte\n<ColorInput label=\"Locked\" value=\"#22c55e\" disabled />\n```\n\n## Interaction\n\n- The swatch button toggles the picker popover; focusing the text input also opens it (like DateInput).\n- The text input is masked (Maskito) for the selected format: hex auto-inserts the leading `#` and\n takes up to 8 hex digits; rgb/hsl are structured templates that auto-insert the `rgb(` / `hsl(`\n prefix, the `, ` separators and hsl's `%` suffixes as digits flow in (3 digits per channel, or\n `,` to end a channel early \u2014 a missing closing `)` is completed on commit). Valid entries commit\n immediately (normalized to hex); an incomplete entry does not commit and the input text is restored\n from the canonical value on blur. Clearing the input sets the value to `null`.\n- Dragging inside the picker updates the value live. The popover does not close on pick (color picking\n is continuous); it closes on click-outside or Escape.\n- Changing the format select in the picker updates the input's text representation while keeping the\n bound value as hex.\n\n## Accessibility\n\n- The swatch sits inside a field action button (the same primitive as the password visibility\n toggle), which stretches to the field's full height for a generous hit target and carries\n `aria-haspopup=\"dialog\"`, `aria-expanded`, `aria-controls`, and a localized \"Choose Color\" label.\n- The text input carries a localized \"Color value\" label and is associated with the field label.\n- The embedded ColorPicker exposes its saturation/brightness square and hue/alpha sliders as focusable\n `role=\"slider\"` controls with full keyboard support (see the ColorPicker docs).\n\n## Theme Customization\n\nThe theme object contains the following parts:\n- **input**: The color text input element (size, disabled variants)\n- **inputContainer**: The bordered field container (size, disabled variants)\n- **popover**: The popover panel wrapping the ColorPicker\n- **swatch**: The color swatch inside the leading action button (empty variant)\n\nField theme parts (label, description, error, ...) are also accepted on the same `theme` prop.\n\n```svelte\n<ColorInput\n\tlabel=\"Brand color\"\n\tbind:value={color}\n\ttheme={{\n\t\tswatch: { base: 'rounded-full', empty: { true: 'bg-neutral-muted/50' } },\n\t\tinputContainer: { base: 'border-2' }\n\t}}\n/>\n```\n\n## Notes\n\n- The canonical `value` is always hex; use `format` only to change the input's text representation.\n- The swatch renders the color over a CSS checkerboard so colors with alpha < 1 read correctly, and\n shows a neutral muted square when the value is `null`.\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
@@ -38,6 +38,7 @@ Extends all Field component props plus:
|
|
|
38
38
|
- **description**: string | Snippet - Helper text
|
|
39
39
|
- **required**: boolean - Mark as required (a required color must be a non-empty string)
|
|
40
40
|
- **disabled**: boolean - Disable input, swatch and picker
|
|
41
|
+
- **readOnly**: boolean - The input stays focusable and announced as read-only and the color cannot be changed (typing or picking); the value still validates and submits
|
|
41
42
|
- **size**: 'small' | 'normal' | 'large' - Field size, forwarded to the embedded ColorPicker
|
|
42
43
|
|
|
43
44
|
### Event Props
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
format = $bindable('hex'),
|
|
15
15
|
size = 'normal',
|
|
16
16
|
disabled = false,
|
|
17
|
+
readOnly = false,
|
|
17
18
|
onValueChange,
|
|
18
19
|
class: className,
|
|
19
20
|
theme,
|
|
@@ -44,6 +45,9 @@
|
|
|
44
45
|
get disabled() {
|
|
45
46
|
return disabled;
|
|
46
47
|
},
|
|
48
|
+
get readOnly() {
|
|
49
|
+
return readOnly;
|
|
50
|
+
},
|
|
47
51
|
onValueChange: (v) => onValueChange?.(v)
|
|
48
52
|
});
|
|
49
53
|
|
|
@@ -62,7 +66,7 @@
|
|
|
62
66
|
});
|
|
63
67
|
|
|
64
68
|
const openEyeDropper = async () => {
|
|
65
|
-
if (!eyeDropperSupported || disabled) return;
|
|
69
|
+
if (!eyeDropperSupported || disabled || readOnly) return;
|
|
66
70
|
try {
|
|
67
71
|
const EyeDropperCtor = (
|
|
68
72
|
window as unknown as {
|
|
@@ -134,6 +138,7 @@
|
|
|
134
138
|
picker.v * 100
|
|
135
139
|
)}% ${t.brightness}`}
|
|
136
140
|
aria-disabled={disabled || undefined}
|
|
141
|
+
aria-readonly={readOnly || undefined}
|
|
137
142
|
onkeydown={picker.onAreaKeydown}
|
|
138
143
|
></div>
|
|
139
144
|
</div>
|
|
@@ -143,7 +148,7 @@
|
|
|
143
148
|
<button
|
|
144
149
|
type="button"
|
|
145
150
|
class={classes.eyedropperButton({ size })}
|
|
146
|
-
disabled={disabled || !eyeDropperSupported}
|
|
151
|
+
disabled={disabled || readOnly || !eyeDropperSupported}
|
|
147
152
|
aria-label={t.pickColorFromScreen}
|
|
148
153
|
onclick={openEyeDropper}
|
|
149
154
|
>
|
|
@@ -162,6 +167,7 @@
|
|
|
162
167
|
aria-valuemax={360}
|
|
163
168
|
aria-valuenow={Math.round(picker.h)}
|
|
164
169
|
aria-disabled={disabled || undefined}
|
|
170
|
+
aria-readonly={readOnly || undefined}
|
|
165
171
|
onkeydown={picker.onHueKeydown}
|
|
166
172
|
></div>
|
|
167
173
|
</div>
|
|
@@ -181,6 +187,7 @@
|
|
|
181
187
|
aria-valuemax={100}
|
|
182
188
|
aria-valuenow={picker.alphaPercent}
|
|
183
189
|
aria-disabled={disabled || undefined}
|
|
190
|
+
aria-readonly={readOnly || undefined}
|
|
184
191
|
onkeydown={picker.onAlphaKeydown}
|
|
185
192
|
></div>
|
|
186
193
|
</div>
|
|
@@ -205,6 +212,7 @@
|
|
|
205
212
|
class={classes.input({ size })}
|
|
206
213
|
value={textValue}
|
|
207
214
|
{disabled}
|
|
215
|
+
readonly={readOnly}
|
|
208
216
|
spellcheck="false"
|
|
209
217
|
autocomplete="off"
|
|
210
218
|
autocapitalize="off"
|
|
@@ -226,6 +234,7 @@
|
|
|
226
234
|
class={classes.alphaInput({ size })}
|
|
227
235
|
value={picker.alphaPercent}
|
|
228
236
|
{disabled}
|
|
237
|
+
readonly={readOnly}
|
|
229
238
|
aria-label={`${t.alpha} ${t.percentage}`}
|
|
230
239
|
{@attach alphaMask}
|
|
231
240
|
onchange={onAlphaChange}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
focused = $bindable(false),
|
|
13
13
|
required = false,
|
|
14
14
|
disabled,
|
|
15
|
+
readOnly,
|
|
16
|
+
messages,
|
|
15
17
|
name,
|
|
16
18
|
onValidate,
|
|
17
19
|
onValueChange,
|
|
@@ -55,6 +57,12 @@
|
|
|
55
57
|
set disabled(v: boolean | undefined) {
|
|
56
58
|
disabled = v;
|
|
57
59
|
},
|
|
60
|
+
get readOnly() {
|
|
61
|
+
return readOnly;
|
|
62
|
+
},
|
|
63
|
+
get messages() {
|
|
64
|
+
return messages;
|
|
65
|
+
},
|
|
58
66
|
get required() {
|
|
59
67
|
return required;
|
|
60
68
|
},
|
|
@@ -97,6 +105,7 @@
|
|
|
97
105
|
{size}
|
|
98
106
|
{i18n}
|
|
99
107
|
disabled={field.disabled}
|
|
108
|
+
readOnly={field.readOnly}
|
|
100
109
|
theme={theme?.picker}
|
|
101
110
|
/>
|
|
102
111
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const colorPickerDescription = "\n# ColorPicker Component\n\nA standalone color picker panel (a faithful clone of the kibo-ui color picker). It is a\nself-contained rounded panel \u2014 a saturation/value square, a hue slider, an alpha slider, an\neyedropper button, and a format select with a color text input and an alpha percentage input.\n`ColorPicker` is the raw panel primitive; `ColorPickerInput` wraps it in the standard field\nchrome (label, description, errors, form registration) and extends InputProps with type 'color'.\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { ColorPicker, ColorPickerInput } from 'entasis/color-picker';\n\tlet color = $state('#6366f1');\n</script>\n\n<!-- Field variant: label/description/errors like every other form input -->\n<ColorPickerInput\n\tlabel=\"Brand color\"\n\tdescription=\"Used for buttons and links across the app\"\n\tbind:value={color}\n/>\n\n<!-- Raw panel primitive -->\n<ColorPicker bind:value={color} />\n<ColorPicker bind:value={color} format=\"rgb\" size=\"large\" />\n<ColorPicker value=\"#22c55e80\" onValueChange={(hex) => console.log(hex)} />\n<ColorPicker value=\"#000000\" disabled />\n```\n\n## ColorPickerInput (field variant)\n\nAccepts every field prop from InputProps ('color') \u2014 `label`, `description`, `name`, `required`,\n`errors`, `onValidate`, `helper`, snippets, \u2026 \u2014 plus the panel props `format` and `i18n`.\n`theme` is split: `theme.picker` for the panel parts, `theme.field` for the field wrapper.\n`bind:value` is the canonical hex string (nullable).\n\n## Props\n\n### Core Props\n- **value**: `string` (bindable, default: `'#000000'`)\n - The selected color. The canonical output is always hex: `#rrggbb`, or `#rrggbbaa` when alpha < 1.\n - Any parseable CSS color is accepted programmatically (named colors, `rgb()`, `rgba()`, `hsl()`, `hsla()`, `#rgb`, `#rrggbb`, `#rrggbbaa`).\n - Hue and saturation are preserved internally, so dragging a color to black/white or typing a gray never loses the chosen hue.\n- **format**: `'hex' | 'rgb' | 'hsl'` (bindable, default: `'hex'`)\n - Controls the text representation shown in the input. The bound `value` stays hex regardless of this.\n\n### Style Props\n- **size**: `'small' | 'normal' | 'large'` (default: `'normal'`)\n - Scales the panel width, slider heights, thumb sizes and text sizes.\n- **disabled**: `boolean` (default: `false`) - Disables every control and dims the panel.\n\n### Event Props\n- **onValueChange**: `(value: string) => void`\n - Fires on every committed change, including continuously while dragging. Receives the canonical hex string.\n\n### Advanced Props\n- **class**: `string` - Extra classes merged onto the root panel.\n- **theme**: `ColorPickerThemeProps` - Theme overrides for the panel parts.\n- **i18n**: `Partial<Messages>` - Per-instance i18n overrides merged over the global catalog.\n\n## Structure\n\nA rounded `root` panel containing, top to bottom:\n1. The `area` \u2014 a saturation/value square with a solid hue backdrop and two gradient overlays\n (`areaSaturation` white\u2192transparent left-to-right, `areaValue` transparent\u2192black top-to-bottom),\n plus a draggable circular `areaThumb`.\n2. A `controls` row \u2014 a square `eyedropperButton` and a `sliders` column with a rainbow\n `hueTrack` (0\u2013360) and a checkerboard `alphaTrack` (the `alphaGradient` overlays a pure-CSS\n checkerboard), each with a white `sliderThumb`.\n3. An `inputs` row \u2014 a native `select` (hex/rgb/hsl), the color `input`, and an\n `alphaField` wrapping the `alphaInput` (0\u2013100) and its `alphaSuffix` (`%`). The text\n input always shows the solid color (no alpha suffix); alpha lives in the % input and the\n alpha slider, so the row is identical in every format.\n\n## Interaction\n\n- The square and both sliders support click-to-jump and continuous pointer drag.\n- The color text input is masked (Maskito) for the selected format: hex auto-inserts the leading `#`\n and takes up to 8 hex digits; rgb/hsl are structured templates auto-inserting the `rgb(`/`hsl(`\n prefix, `, ` separators and hsl's `%` suffixes as digits flow in (`,` ends a channel early; a\n missing `)` is completed on commit). Entries commit on Enter or blur; an incomplete entry reverts.\n The text always shows the solid form; a typed/eyedropped color without an explicit alpha keeps the\n current alpha (pasting `rgba()`/8-digit hex still applies the pasted alpha).\n- The alpha input is masked to 0\u2013100 and commits on change; the format select only changes the text representation.\n- The eyedropper uses the native `window.EyeDropper` API and is disabled where unsupported (SSR-safe).\n\n## Accessibility\n\n- The area thumb and both slider thumbs are focusable `role=\"slider\"` elements with\n `aria-valuemin`/`aria-valuemax`/`aria-valuenow` and localized `aria-label`s.\n- Keyboard: on the square, Left/Right adjust saturation and Up/Down adjust value; on the sliders,\n arrow keys step (Shift for a larger step) and Home/End jump to min/max.\n- The eyedropper, color input, format select and alpha input all carry localized aria-labels.\n\n## Notes\n- Canonical `value` is hex; use `format` only to change the input's text representation.\n- Theme parts: `root`, `area`, `areaSaturation`, `areaValue`, `areaThumb`, `controls`,\n `eyedropperButton`, `sliders`, `hueTrack`, `alphaTrack`, `alphaGradient`, `sliderThumb`,\n `inputs`, `select`, `input`, `alphaField`, `alphaInput`, `alphaSuffix` (each with a `size` variant).\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
1
|
+
export declare const colorPickerDescription = "\n# ColorPicker Component\n\nA standalone color picker panel (a faithful clone of the kibo-ui color picker). It is a\nself-contained rounded panel \u2014 a saturation/value square, a hue slider, an alpha slider, an\neyedropper button, and a format select with a color text input and an alpha percentage input.\n`ColorPicker` is the raw panel primitive; `ColorPickerInput` wraps it in the standard field\nchrome (label, description, errors, form registration) and extends InputProps with type 'color'.\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { ColorPicker, ColorPickerInput } from 'entasis/color-picker';\n\tlet color = $state('#6366f1');\n</script>\n\n<!-- Field variant: label/description/errors like every other form input -->\n<ColorPickerInput\n\tlabel=\"Brand color\"\n\tdescription=\"Used for buttons and links across the app\"\n\tbind:value={color}\n/>\n\n<!-- Raw panel primitive -->\n<ColorPicker bind:value={color} />\n<ColorPicker bind:value={color} format=\"rgb\" size=\"large\" />\n<ColorPicker value=\"#22c55e80\" onValueChange={(hex) => console.log(hex)} />\n<ColorPicker value=\"#000000\" disabled />\n```\n\n## ColorPickerInput (field variant)\n\nAccepts every field prop from InputProps ('color') \u2014 `label`, `description`, `name`, `required`,\n`errors`, `onValidate`, `helper`, snippets, \u2026 \u2014 plus the panel props `format` and `i18n`.\n`theme` is split: `theme.picker` for the panel parts, `theme.field` for the field wrapper.\n`bind:value` is the canonical hex string (nullable).\n\n## Props\n\n### Core Props\n- **value**: `string` (bindable, default: `'#000000'`)\n - The selected color. The canonical output is always hex: `#rrggbb`, or `#rrggbbaa` when alpha < 1.\n - Any parseable CSS color is accepted programmatically (named colors, `rgb()`, `rgba()`, `hsl()`, `hsla()`, `#rgb`, `#rrggbb`, `#rrggbbaa`).\n - Hue and saturation are preserved internally, so dragging a color to black/white or typing a gray never loses the chosen hue.\n- **format**: `'hex' | 'rgb' | 'hsl'` (bindable, default: `'hex'`)\n - Controls the text representation shown in the input. The bound `value` stays hex regardless of this.\n\n### Style Props\n- **size**: `'small' | 'normal' | 'large'` (default: `'normal'`)\n - Scales the panel width, slider heights, thumb sizes and text sizes.\n- **disabled**: `boolean` (default: `false`) - Disables every control and dims the panel.\n- **readOnly**: `boolean` (default: `false`) - Keeps the controls focusable but refuses drags, keys, typed text and the eyedropper.\n\n### Event Props\n- **onValueChange**: `(value: string) => void`\n - Fires on every committed change, including continuously while dragging. Receives the canonical hex string.\n\n### Advanced Props\n- **class**: `string` - Extra classes merged onto the root panel.\n- **theme**: `ColorPickerThemeProps` - Theme overrides for the panel parts.\n- **i18n**: `Partial<Messages>` - Per-instance i18n overrides merged over the global catalog.\n\n## Structure\n\nA rounded `root` panel containing, top to bottom:\n1. The `area` \u2014 a saturation/value square with a solid hue backdrop and two gradient overlays\n (`areaSaturation` white\u2192transparent left-to-right, `areaValue` transparent\u2192black top-to-bottom),\n plus a draggable circular `areaThumb`.\n2. A `controls` row \u2014 a square `eyedropperButton` and a `sliders` column with a rainbow\n `hueTrack` (0\u2013360) and a checkerboard `alphaTrack` (the `alphaGradient` overlays a pure-CSS\n checkerboard), each with a white `sliderThumb`.\n3. An `inputs` row \u2014 a native `select` (hex/rgb/hsl), the color `input`, and an\n `alphaField` wrapping the `alphaInput` (0\u2013100) and its `alphaSuffix` (`%`). The text\n input always shows the solid color (no alpha suffix); alpha lives in the % input and the\n alpha slider, so the row is identical in every format.\n\n## Interaction\n\n- The square and both sliders support click-to-jump and continuous pointer drag.\n- The color text input is masked (Maskito) for the selected format: hex auto-inserts the leading `#`\n and takes up to 8 hex digits; rgb/hsl are structured templates auto-inserting the `rgb(`/`hsl(`\n prefix, `, ` separators and hsl's `%` suffixes as digits flow in (`,` ends a channel early; a\n missing `)` is completed on commit). Entries commit on Enter or blur; an incomplete entry reverts.\n The text always shows the solid form; a typed/eyedropped color without an explicit alpha keeps the\n current alpha (pasting `rgba()`/8-digit hex still applies the pasted alpha).\n- The alpha input is masked to 0\u2013100 and commits on change; the format select only changes the text representation.\n- The eyedropper uses the native `window.EyeDropper` API and is disabled where unsupported (SSR-safe).\n\n## Accessibility\n\n- The area thumb and both slider thumbs are focusable `role=\"slider\"` elements with\n `aria-valuemin`/`aria-valuemax`/`aria-valuenow` and localized `aria-label`s.\n- Keyboard: on the square, Left/Right adjust saturation and Up/Down adjust value; on the sliders,\n arrow keys step (Shift for a larger step) and Home/End jump to min/max.\n- The eyedropper, color input, format select and alpha input all carry localized aria-labels.\n\n## Notes\n- Canonical `value` is hex; use `format` only to change the input's text representation.\n- Theme parts: `root`, `area`, `areaSaturation`, `areaValue`, `areaThumb`, `controls`,\n `eyedropperButton`, `sliders`, `hueTrack`, `alphaTrack`, `alphaGradient`, `sliderThumb`,\n `inputs`, `select`, `input`, `alphaField`, `alphaInput`, `alphaSuffix` (each with a `size` variant).\n\n## State contract\n\n- **value**: current bindable editable value.\n- **defaultValue**: initial value used only when `value` is omitted.\n- **onValueChange**: called with the new value when the component changes it.\n\n";
|
|
@@ -50,6 +50,7 @@ Accepts every field prop from InputProps ('color') — \`label\`, \`description\
|
|
|
50
50
|
- **size**: \`'small' | 'normal' | 'large'\` (default: \`'normal'\`)
|
|
51
51
|
- Scales the panel width, slider heights, thumb sizes and text sizes.
|
|
52
52
|
- **disabled**: \`boolean\` (default: \`false\`) - Disables every control and dims the panel.
|
|
53
|
+
- **readOnly**: \`boolean\` (default: \`false\`) - Keeps the controls focusable but refuses drags, keys, typed text and the eyedropper.
|
|
53
54
|
|
|
54
55
|
### Event Props
|
|
55
56
|
- **onValueChange**: \`(value: string) => void\`
|
|
@@ -18,6 +18,8 @@ export type ColorPickerProps = WithAttachments<{
|
|
|
18
18
|
size?: Sizes;
|
|
19
19
|
/** Disables every control and dims the panel. */
|
|
20
20
|
disabled?: boolean;
|
|
21
|
+
/** Refuses edits (drag, keys, typed text, eyedropper) while the controls stay focusable. */
|
|
22
|
+
readOnly?: boolean;
|
|
21
23
|
/** Fires on every committed change, including continuously while dragging. Receives the canonical hex. */
|
|
22
24
|
onValueChange?: (value: string) => void;
|
|
23
25
|
/** Extra classes merged onto the root panel. */
|
|
@@ -10,6 +10,7 @@ type ColorPickerStateOptions = {
|
|
|
10
10
|
value?: string;
|
|
11
11
|
format?: ColorFormat;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
13
14
|
onValueChange?: (value: string) => void;
|
|
14
15
|
};
|
|
15
16
|
declare const ColorPickerState_base: new (props: ColorPickerStateOptions) => {} & ColorPickerStateOptions;
|
|
@@ -17,11 +18,14 @@ export declare class ColorPickerState extends ColorPickerState_base {
|
|
|
17
18
|
value?: string;
|
|
18
19
|
format?: ColorFormat;
|
|
19
20
|
disabled?: boolean;
|
|
21
|
+
readOnly?: boolean;
|
|
20
22
|
onValueChange?: (value: string) => void;
|
|
21
23
|
h: number;
|
|
22
24
|
s: number;
|
|
23
25
|
v: number;
|
|
24
26
|
a: number;
|
|
27
|
+
/** Disabled or read-only: no edit reaches the color. */
|
|
28
|
+
private get locked();
|
|
25
29
|
private mounted;
|
|
26
30
|
private lastEmitted;
|
|
27
31
|
private areaDrag;
|
|
@@ -62,21 +62,25 @@ export class ColorPickerState extends createBindableStateClass() {
|
|
|
62
62
|
s = $state(1);
|
|
63
63
|
v = $state(1);
|
|
64
64
|
a = $state(1);
|
|
65
|
+
/** Disabled or read-only: no edit reaches the color. */
|
|
66
|
+
get locked() {
|
|
67
|
+
return !!this.disabled || !!this.readOnly;
|
|
68
|
+
}
|
|
65
69
|
mounted = false;
|
|
66
70
|
// The last hex this component emitted; external writes equal to it are skipped to avoid re-parsing.
|
|
67
71
|
lastEmitted = undefined;
|
|
68
72
|
areaDrag = createPointerDrag({
|
|
69
|
-
disabled: () =>
|
|
73
|
+
disabled: () => this.locked,
|
|
70
74
|
onStart: (payload) => this.setSaturationValueFromPointer(payload),
|
|
71
75
|
onMove: (payload) => this.setSaturationValueFromPointer(payload)
|
|
72
76
|
});
|
|
73
77
|
hueDrag = createPointerDrag({
|
|
74
|
-
disabled: () =>
|
|
78
|
+
disabled: () => this.locked,
|
|
75
79
|
onStart: (payload) => this.setHueFromPointer(payload),
|
|
76
80
|
onMove: (payload) => this.setHueFromPointer(payload)
|
|
77
81
|
});
|
|
78
82
|
alphaDrag = createPointerDrag({
|
|
79
|
-
disabled: () =>
|
|
83
|
+
disabled: () => this.locked,
|
|
80
84
|
onStart: (payload) => this.setAlphaFromPointer(payload),
|
|
81
85
|
onMove: (payload) => this.setAlphaFromPointer(payload)
|
|
82
86
|
});
|
|
@@ -207,7 +211,7 @@ export class ColorPickerState extends createBindableStateClass() {
|
|
|
207
211
|
// reverts). Alpha-less input (the text input's solid form, the eyedropper's opaque hex) keeps
|
|
208
212
|
// the current alpha — alpha is owned by the % input and the alpha slider.
|
|
209
213
|
commitText = (input) => {
|
|
210
|
-
if (this.
|
|
214
|
+
if (this.locked)
|
|
211
215
|
return false;
|
|
212
216
|
const parsed = this.parse(input);
|
|
213
217
|
if (!parsed)
|
|
@@ -217,13 +221,13 @@ export class ColorPickerState extends createBindableStateClass() {
|
|
|
217
221
|
return true;
|
|
218
222
|
};
|
|
219
223
|
setAlphaPercent = (percent) => {
|
|
220
|
-
if (this.
|
|
224
|
+
if (this.locked)
|
|
221
225
|
return;
|
|
222
226
|
this.a = clamp01(percent / 100);
|
|
223
227
|
this.emit();
|
|
224
228
|
};
|
|
225
229
|
onAreaKeydown = (event) => {
|
|
226
|
-
if (this.
|
|
230
|
+
if (this.locked)
|
|
227
231
|
return;
|
|
228
232
|
const step = event.shiftKey ? 0.1 : 0.01;
|
|
229
233
|
let handled = true;
|
|
@@ -255,7 +259,7 @@ export class ColorPickerState extends createBindableStateClass() {
|
|
|
255
259
|
}
|
|
256
260
|
};
|
|
257
261
|
onHueKeydown = (event) => {
|
|
258
|
-
if (this.
|
|
262
|
+
if (this.locked)
|
|
259
263
|
return;
|
|
260
264
|
const step = event.shiftKey ? 10 : 1;
|
|
261
265
|
let next = this.h;
|
|
@@ -285,7 +289,7 @@ export class ColorPickerState extends createBindableStateClass() {
|
|
|
285
289
|
}
|
|
286
290
|
};
|
|
287
291
|
onAlphaKeydown = (event) => {
|
|
288
|
-
if (this.
|
|
292
|
+
if (this.locked)
|
|
289
293
|
return;
|
|
290
294
|
const step = event.shiftKey ? 0.1 : 0.01;
|
|
291
295
|
let next = this.a;
|