entasis 0.11.0 → 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 +256 -30
- package/dist/components/Form/Field/Field.svelte.d.ts +9 -0
- 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 +64 -8
- 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 +109 -3
- package/dist/components/Form/Field/field.state.svelte.js +508 -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 +47 -14
- 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 +40 -2
- package/dist/components/Form/Form/FormInputRenderer.svelte +7 -0
- package/dist/components/Form/Form/form.d.ts +35 -6
- package/dist/components/Form/Form/form.mcp.d.ts +1 -1
- package/dist/components/Form/Form/form.mcp.js +113 -13
- package/dist/components/Form/Form/form.props.d.ts +32 -1
- package/dist/components/Form/Form/form.registry.d.ts +2 -2
- package/dist/components/Form/Form/form.registry.js +1 -4
- package/dist/components/Form/Form/form.state.svelte.d.ts +1138 -413
- package/dist/components/Form/Form/form.state.svelte.js +319 -26
- package/dist/components/Form/Form/index.d.ts +3 -1
- package/dist/components/Form/Form/visibility.d.ts +3096 -1831
- 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 +1022 -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 +225 -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 dialogDescription = "\n# Dialog Component\n\nThe Dialog component (also known as Modal) displays content in a layer above the page, blocking interaction with the rest of the application until dismissed.\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\t\n</script>\n// By default Dialog comes with a button that trigger them, no need to define a callback and a $state\n<Dialog title=\"Dialog Title\">\n\tDialog content goes here\n</Dialog>\n```\n\n## Props\n\n### Core Props\n- **open**: boolean (bindable) - Controls dialog visibility\n- **defaultOpen**: boolean (default: false) - Initial state when open is not provided\n- **id**: string - Unique identifier for the dialog\n- **type**: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'alert' | 'modal' (default: 'modal')\n - fullScreen: Full screen dialog overlay\n - drawerRight: Drawer sliding in from the right\n - drawerLeft: Drawer sliding in from the left\n - drawerBottom: Drawer sliding in from the bottom\n - drawerTop: Drawer sliding in from the top\n - alert: Alert-style dialog\n - modal: Standard modal dialog\n - Supports responsive values: pass a `Partial<Record<Breakpoint, DialogType>>` record such as `{ xs: 'drawerBottom', md: 'modal' }` to vary the type per breakpoint (breakpoint is one of 'xs' | 'sm' | 'md' | 'lg' | 'xl', tracked live from the viewport; the nearest defined key at or below the active one wins)\n- **responsive**: boolean (default: true) - When the resolved type is `modal`, collapse it into a `drawerBottom` bottom sheet on mobile (viewport < 768px). The sheet inherits swipe-to-dismiss and the drag thumb. Set false to keep a centered modal on every screen size\n\n### Layout Props\n- **size**: 'small' | 'normal' | 'large' (default: 'normal')\n - small: Compact dialog size\n - normal: Standard dialog size\n - large: Larger dialog size\n\n### Event Props\n- **onOpenChange**: (open: boolean) => void - Called once for each library-requested state change\n- **onAfterOpen**: (payload: DialogState) => void - Called after the open transition finishes\n- **onAfterClose**: (payload: DialogState) => void - Called after the close transition finishes\n\n### Slot Props\n- **title**: string | Snippet<[DialogState]> - Dialog title\n- **description**: string | Snippet<[DialogState]> - Dialog description\n- **children**: Snippet<[DialogState]> - Main dialog content\n- **header**: Snippet - Custom header content\n- **footer**: Snippet - Custom footer content\n- **trigger**: Snippet | (ButtonProps & { content?: string }) - Custom trigger button\n- **closeButton**: Snippet - Custom close button\n\n### Behavior Props\n- **closeOnEscape**: boolean (default: true) - Close when Escape key is pressed\n- **closeOnClickOutside**: boolean (default: true) - Close when clicking outside dialog\n- **closable**: boolean (default: true) - Whether dialog can be closed\n- **swipeToDismiss**: boolean (default: true for drawer types) - Drag the drawer toward its edge to dismiss. Direction-aware (drawerRight drags right, drawerBottom drags down, etc.) and never hijacks inner scrolling; opt elements out with `data-no-swipe`\n- **thumb**: boolean (default: true) - Drag thumb bar shown on swipe-dismissable drawers (inner edge, orientation follows the drawer side, oversized hitbox); set false to hide. Themeable via the `thumb` theme part\n- **inset**: a spacing step or `'none'` \u2014 how far a drawer stands off the screen edge for this dialog. Defaults to the theme's `designTokens.drawerInset` (`'layout-md'`). At `'none'` the drawer is edge to edge, its edge corners square off and only the corners facing the page stay rounded\n- **swipeFrom**: 'panel' | 'handle' (default: 'panel') - Where a swipe can start: anywhere on the panel, or only the drag handles (thumb and header)\n\n### Visual Props\n- **transition**: TransitionConfig - Custom transition animation\n\n### Styling Props\n- **class**: string - Additional CSS classes\n- **theme**: ComponentTheme - Custom theme overrides\n\n## Structure\n\n```\n<DialogOverlay>\n\t<DialogContent>\n\t\t<DialogHeader>\n\t\t\t<Title />\n\t\t\t<Description />\n\t\t\t<CloseButton />\n\t\t</DialogHeader>\n\t\t<DialogBody>\n\t\t\t<Children />\n\t\t</DialogBody>\n\t\t<DialogFooter />\n\t</DialogContent>\n</DialogOverlay>\n```\n\n## Examples\n\n### More Examples\n\n### A with a custom trigger \n```svelte\n\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n</script>\n\n\n<Dialog bind:open title=\"Welcome\">\n\t<p>This is a basic dialog.</p>\n\t\n\t{#snippet trigger(dialog)}\n\t\t<Button onclick={() => dialog.open()}>Open</Button>\n\t{/snippet}\n</Dialog>\n```\n\n### A with a custom as button props \n```svelte\n\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n</script>\n\n\n<Dialog bind:open title=\"Welcome\"\ntrigger={{\ncontent:\"Click me\",\ncolor:\"secondary\",\nsize:\"small\"\n}}\n>\n\t<p>This is a basic dialog.</p>\t\n</Dialog>\n```\n\n### With Description\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n</script>\n\n<Dialog \t\n\ttitle=\"Confirm Action\"\n\tdescription=\"Are you sure you want to continue?\"\n>\n\t<p>This action cannot be undone.</p>\n</Dialog>\n```\n\n### Different Sizes\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\tlet open = $state(false);\n</script>\n\n```\n\n### Advanced Example\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n\t\n\tfunction handleConfirm() {\n\t\tconsole.log('Confirmed!');\n\t\topen = false;\n\t}\n</script>\n\n<Dialog bind:open title=\"Confirm\">\n\tAre you sure?\n\t\n\t{#snippet footer()}\n\t\t<div class=\"flex gap-2 justify-end\">\n\t\t\t<Button variant=\"ghost\" onclick={() => open = false}>\n\t\t\t\tCancel\n\t\t\t</Button>\n\t\t\t<Button color=\"danger\" onclick={handleConfirm}>\n\t\t\t\tConfirm\n\t\t\t</Button>\n\t\t</div>\n\t{/snippet}\n</Dialog>\n```\n\n### Drawer Types\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\t\n</script>\n\n<!-- Right drawer -->\n<Dialog type=\"drawerRight\" title=\"Side Drawer\">\n\tThis slides in from the right\n</Dialog>\n\n<!-- Left drawer -->\n<Dialog type=\"drawerLeft\" title=\"Left Drawer\">\n\tThis slides in from the left\n</Dialog>\n\n<!-- Bottom drawer -->\n<Dialog type=\"drawerBottom\" title=\"Bottom Drawer\">\n\tThis slides in from the bottom\n</Dialog>\n\n<!-- Full screen -->\n<Dialog type=\"fullScreen\" title=\"Full Screen\">\n\tFull screen dialog content\n</Dialog>\n```\n\n### Custom Header\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { warningIcon } from 'entasis/icons/warning';\n</script>\n\n<Dialog bind:open>\n\t{#snippet header()}\n\t\t<div class=\"flex items-center gap-2\">\n\t\t\t{@render warningIcon()}\n\t\t\t<h2>Warning</h2>\n\t\t</div>\n\t{/snippet}\n\t\n\tThis is important!\n</Dialog>\n```\n\n\n### With Lifecycle Hooks\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\tlet open = $state(false);\n</script>\n\n<Dialog \n\tbind:open\n\ttitle=\"Lifecycle\"\n\tonAfterOpen={(payload) => console.log('Dialog opened', payload)}\n\tonAfterClose={(payload) => console.log('Dialog closed', payload)}\n>\n\tWatch the console\n</Dialog>\n```\n\n## State Management\n\nThe Dialog component uses a `DialogState` instance that is passed to all slot snippets. This state object provides:\n\n- **id**: string - Dialog identifier\n- **type**: DialogType - Current dialog type\n- **size**: Size - Current dialog size\n- **open()**: () => void - Method to open the dialog\n- **close()**: () => void - Method to close the dialog\n\n## Accessibility\n\n- Initial focus goes to an `[autofocus]` / `[data-autofocus]` element inside the dialog, else the first tabbable control (the close button is skipped), else the panel itself\n- Tab and Shift+Tab are contained inside the dialog, and the rest of the page is `inert` while a modal is open\n- Focus is restored to the opener after the close transition finishes, just before `onAfterClose`\n- `aria-labelledby` links the `title` and `aria-describedby` links the `description`\n- Escape closes only the topmost open layer and an outside press dismisses the layers above the one pressed; both honour `closeOnEscape` / `closable` / `closeOnClickOutside` through the shared layer stack\n- Body scroll is locked when dialog is open\n\n## Notes\n\n- Multiple dialogs can be stacked\n- Last opened dialog receives focus\n- Background overlay prevents interaction with page\n- Scroll locking prevents background scroll\n- Transitions are customizable\n\n## Theme Customization\n\nThe Dialog 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- **motion**: Open/close transition preset, keyed by `type` (drawers fly from their edge). Takes\n `in` / `out` FSO params plus a `duration` / `easing` motion token; the `transition` prop wins\n over it\n- **root**: Dialog overlay/backdrop styles\n- **content**: Dialog content container styles\n- **thumb**: Drag thumb bar styles (type variant controls per-side placement)\n- **header**: Dialog header section styles\n- **footer**: Dialog footer section styles\n- **closeButton**: Close button styles\n- **title**: Dialog title text styles\n- **description**: Dialog description text styles\n\n### Theme Type Definition\n\n```typescript\nimport type { DialogThemeProps } from 'entasis/dialog';\n\n// Example theme customization\nconst customTheme: DialogThemeProps = {\n root: {\n base: 'z-[+50] fixed inset-0 flex',\n scroll: {\n inner: 'overflow-hidden',\n outer: 'overflow-auto'\n }\n },\n align: {\n type: {\n fullScreen: 'justify-center items-center',\n drawerRight: 'justify-end',\n drawerLeft: 'justify-start',\n drawerBottom: 'justify-center items-end',\n drawerTop: 'justify-center items-start',\n modal: 'justify-center',\n alert: 'justify-center'\n }\n },\n content: {\n size: {\n small: 'max-w-md w-full',\n normal: 'max-w-xl w-full',\n large: 'max-w-3xl w-full'\n },\n type: {\n fullScreen: 'h-full w-full max-w-full',\n drawerRight: 'rounded-r-[var(--drawer-edge-radius)] h-full',\n modal: ''\n }\n },\n header: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n },\n title: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n },\n description: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n }\n};\n```\n\n### Available Variants\n\n**root**:\n- base: Base classes for dialog overlay/backdrop\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size constraints\n - type: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'modal' | 'alert' - Dialog type/layout\n\n**content**:\n- base: Base classes for dialog content container\n- Variants:\n - size: 'small' | 'normal' | 'large' - Content max-width\n - type: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'modal' | 'alert' - Content styling based on type\n\n**header**:\n- base: Base classes for header section\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**footer**:\n- base: Base classes for footer section\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**closeButton**:\n- base: Base classes for close button\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**title**:\n- base: Base classes for title text\n- Variants:\n - size: 'small' | 'normal' | 'large' - Text size\n\n**description**:\n- base: Base classes for description text\n- Variants:\n - size: 'small' | 'normal' | 'large' - Text size\n\n### Usage Examples\n\n**Basic Theme Override**:\n```svelte\n<Dialog \n title=\"Custom Dialog\"\n theme={{\n content: {\n base: 'rounded-2xl raised-5',\n size: {\n normal: 'max-w-2xl'\n }\n },\n header: {\n base: 'border-b-2 border-primary'\n }\n }}\n>\n Custom styled dialog content\n</Dialog>\n```\n\n**Drawer Type Customization**:\n```svelte\n<Dialog \n type=\"drawerRight\"\n theme={{\n align: {\n type: {\n drawerRight: 'justify-end'\n }\n },\n backdrop: {\n base: 'bg-black/50'\n },\n content: {\n type: {\n drawerRight: 'rounded-l-xl raised-5'\n }\n }\n }}\n>\n Custom drawer styling\n</Dialog>\n```\n\n**Global Theme Setting**:\n```svelte\n<script>\n import { setDialogTheme } from './index.ts';\n \n setDialogTheme({\n root: {\n base: 'backdrop-blur-sm'\n },\n content: {\n base: 'lift-5 border-2',\n size: {\n normal: 'max-w-2xl'\n }\n },\n title: {\n base: 'text-2xl font-bold'\n }\n });\n</script>\n```\n";
|
|
1
|
+
export declare const dialogDescription = "\n# Dialog Component\n\nThe Dialog component (also known as Modal) displays content in a layer above the page, blocking interaction with the rest of the application until dismissed.\n\n## Basic Usage\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\t\n</script>\n// By default Dialog comes with a button that trigger them, no need to define a callback and a $state\n<Dialog title=\"Dialog Title\">\n\tDialog content goes here\n</Dialog>\n```\n\n## Props\n\n### Core Props\n- **open**: boolean (bindable) - Controls dialog visibility\n- **modal**: boolean (default: true) - A modal makes the page behind `inert`, locks page scroll, contains Tab, dims the page with the shared backdrop and dismisses on an outside press. `modal={false}` leaves the page interactive: no `inert`, no scroll lock, no backdrop, no Tab containment, and an outside press does not dismiss it unless `closeOnClickOutside` is set. Escape, the close button and swipes still close it (the Android Back gesture does not: it closes modal dialogs only). It renders no `aria-modal` (and `data-modal=\"false\"`), always scrolls inside its card, and does not push dialogs beneath it back\n- **defaultOpen**: boolean (default: false) - Initial state when open is not provided\n- **id**: string - Unique identifier for the dialog\n- **type**: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'alert' | 'modal' (default: 'modal')\n - fullScreen: Full screen dialog overlay\n - drawerRight: Drawer sliding in from the right\n - drawerLeft: Drawer sliding in from the left\n - drawerBottom: Drawer sliding in from the bottom\n - drawerTop: Drawer sliding in from the top\n - alert: Alert dialog for an interruption that needs an answer: renders `role=\"alertdialog\"` and ignores outside presses unless `closeOnClickOutside` is set (Escape still closes it)\n - modal: Standard modal dialog\n - Supports responsive values: pass a `Partial<Record<Breakpoint, DialogType>>` record such as `{ xs: 'drawerBottom', md: 'modal' }` to vary the type per breakpoint (breakpoint is one of 'xs' | 'sm' | 'md' | 'lg' | 'xl', tracked live from the viewport; the nearest defined key at or below the active one wins)\n- **responsive**: boolean (default: true) - When the resolved type is `modal`, collapse it into a `drawerBottom` bottom sheet on mobile (viewport < 768px). The sheet inherits swipe-to-dismiss and the drag thumb. Set false to keep a centered modal on every screen size\n\n### Layout Props\n- **size**: 'small' | 'normal' | 'large' (default: 'normal')\n - small: Compact dialog size\n - normal: Standard dialog size\n - large: Larger dialog size\n\n### Event Props\n- **onOpenChange**: (open: boolean, details: OpenChangeDetails) => void - Called before each library-requested state change, with `details.reason` (`'trigger-press'`, `'escape-key'`, `'outside-press'`, `'close-press'`, `'swipe'`, `'close-watcher'` for the Android Back gesture, `'imperative-action'`\u2026), `details.event`, `details.trigger`, `details.interaction` and `details.cancel()`. Cancelling keeps the dialog as it is (a cancelled swipe snaps back) and leaves the event untouched. Inside the callback `open` still holds the previous state. Types from `entasis/types`\n- **onAfterOpen**: (payload: DialogApi) => void - Called once per open after the open transition finishes; a dialog created open (`defaultOpen`) renders once mounted, animates in and reports it too\n- **onAfterClose**: (payload: DialogApi) => void - Called once per close after the close transition finishes\n\n### Slot Props\n- **title**: string | Snippet - Dialog title\n- **description**: string | Snippet - Dialog description\n- **children**: Snippet<[DialogApi]> - Main dialog content\n- **header**: Snippet - Custom header content\n- **footer**: Snippet - Custom footer content\n- **trigger**: Snippet<[DialogApi]> | (ButtonProps & { content?: string }) - Custom trigger button. The built-in button carries `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls`; its `onclick` runs first, and `event.preventDefault()` there keeps the dialog closed. In a snippet, `{@attach dialog.trigger}` gives any element the same contract\n- **closeButton**: Snippet | false - Custom close button, or `false` to suppress the visible one. A closable dialog whose visible button is suppressed (`false`, or a snippet that renders nothing, as the Popover mobile sheet passes) still renders a visually hidden `Close` button at the end of the panel, out of the Tab order but in the accessibility tree, so screen reader users have a control that closes it. An `alert` never gets one: its own buttons answer it. The default close button is named `Close` (translated by the i18n catalog)\n\n### Behavior Props\n- **closeOnEscape**: boolean (default: true) - Close when Escape key is pressed (and, for a modal dialog on Android, on the Back gesture)\n- **closeOnClickOutside**: boolean (default: true, false for `type=\"alert\"` and for `modal={false}`) - Close when pressing outside dialog. A press that began before the dialog opened does not count\n- **closable**: boolean (default: true) - Whether dialog can be closed\n- **focusOnClose**: boolean | HTMLElement | ((details) => HTMLElement | boolean | void) (default: true) - Where focus goes when the dialog closes. `true` returns it to the control that opened the dialog, else to the most recent element still on the page; `false` leaves focus alone; an element receives it; a function gets the change details (`reason`, `interaction`\u2026) and returns one of these, or nothing to restore as usual\n- **swipeToDismiss**: boolean (default: true for drawer types) - Drag the drawer toward its edge to dismiss. Direction-aware (drawerRight drags right, drawerBottom drags down, etc.) and never hijacks inner scrolling (including a horizontal scroller in a right-to-left layout) or a mostly sideways drag (a press that travels more across the dismiss axis than along it is spent); a quick flick dismisses even when the last move before release is nearly stationary; opt elements out with `data-no-swipe`. A mouse or pen drags a drawer only from its handles (thumb and header), so dragging over the body selects text; a finger drags from anywhere unless text is selected in the panel. A dialog above another one keeps the one beneath moving with it: its scale and fade follow the swipe's progress\n- **thumb**: boolean (default: true) - Drag thumb bar shown on swipe-dismissable drawers (inner edge, orientation follows the drawer side, oversized hitbox); set false to hide. Themeable via the `thumb` theme part\n- **inset**: a spacing step or `'none'` \u2014 how far a drawer stands off the screen edge for this dialog. Defaults to the theme's `designTokens.drawerInset` (`'layout-md'`). At `'none'` the drawer is edge to edge, its edge corners square off and only the corners facing the page stay rounded\n- **swipeFrom**: 'panel' | 'handle' (default: 'panel') - Where a finger swipe can start: anywhere on the panel, or only the drag handles (thumb and header). Mouse and pen always start from a handle\n- **snapPoints**: (number | string)[] - Where a `drawerBottom` or `drawerTop` (or a modal collapsed into a mobile sheet) can rest. A number is a fraction of the available height (above 0, at most 1), a string a CSS length (`'148px'`, `'20rem'`, `'40%'`, `'50vh'`). The panel is as tall as the largest point and shows only the active one; a drag moves it between the points, a flick (0.4 px/ms or more) carries it to the next one in the direction it was thrown, and dragging below the lowest dismisses it when swipe-to-dismiss is on (otherwise the lowest is as far as it goes). The body scrolls only at the largest point; below it, a drag anywhere moves the panel. Ignored by the other types\n- **snapPoint**: number | string (bindable) - The point the drawer rests at, one of `snapPoints`\n- **defaultSnapPoint**: number | string - The point it opens at when `snapPoint` is not bound (default: the largest)\n- **onSnapPointChange**: ({ snapPoint, details }: { snapPoint; details: OpenChangeDetails }) => void - Called before the resting point changes. `details.reason` is `'swipe'` or `'imperative-action'` (`dialog.setSnapPoint`); `details.cancel()` keeps the current point and a cancelled drag snaps back\n\n### Visual Props\n- **transition**: TransitionConfig - Custom transition animation\n\n### Styling Props\n- **class**: string - Additional CSS classes\n- **theme**: ComponentTheme - Custom theme overrides\n\n## Structure\n\n```\n<DialogOverlay>\n\t<DialogContent>\n\t\t<DialogHeader>\n\t\t\t<Title />\n\t\t\t<Description />\n\t\t\t<CloseButton />\n\t\t</DialogHeader>\n\t\t<DialogBody>\n\t\t\t<Children />\n\t\t</DialogBody>\n\t\t<DialogFooter />\n\t</DialogContent>\n</DialogOverlay>\n```\n\n## Examples\n\n### More Examples\n\n### A with a custom trigger \n```svelte\n\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n</script>\n\n\n<Dialog bind:open title=\"Welcome\">\n\t<p>This is a basic dialog.</p>\n\t\n\t<!-- {@attach dialog.trigger} opens the dialog on click (Enter/Space on a non-control) and\n\t keeps aria-haspopup / aria-expanded / aria-controls in sync; focus returns to it -->\n\t{#snippet trigger(dialog)}\n\t\t<Button {@attach dialog.trigger}>Open</Button>\n\t{/snippet}\n</Dialog>\n```\n\n### Choose where focus goes on close\n\n```svelte\n<script lang=\"ts\">\n\timport { Dialog } from 'entasis/dialog';\n\n\tlet search = $state<HTMLInputElement | null>(null);\n</script>\n\n<input bind:this={search} aria-label=\"Search\" />\n<!-- After a save, focus the search field instead of the button that opened the dialog. -->\n<Dialog\n\ttitle=\"Rename\"\n\ttrigger={{ content: 'Rename' }}\n\tfocusOnClose={(details) => (details?.reason === 'close-press' ? search : undefined)}\n>\n\t<p>New name</p>\n</Dialog>\n```\n\n### Cancel a close\n\n```svelte\n<script lang=\"ts\">\n\timport { Dialog } from 'entasis/dialog';\n\timport type { OpenChangeDetails } from 'entasis/types';\n\n\tlet draft = $state('');\n\t// Runs before the change: with a draft, only the close button closes the dialog.\n\tconst keepDraft = (open: boolean, details: OpenChangeDetails) => {\n\t\tif (!open && draft && details.reason !== 'close-press') details.cancel();\n\t};\n</script>\n\n<Dialog title=\"New message\" trigger={{ content: 'Write' }} onOpenChange={keepDraft}>\n\t<textarea aria-label=\"Message\" bind:value={draft}></textarea>\n</Dialog>\n```\n\n### Ask before closing\n\n```svelte\n<script lang=\"ts\">\n\timport { Dialog } from 'entasis/dialog';\n\timport { confirmation } from 'entasis/confirmation';\n\timport type { OpenChangeDetails } from 'entasis/types';\n\n\tlet open = $state(false);\n\tlet draft = $state('');\n\n\t// Escape, an outside press, the close button, a swipe and Android Back all arrive here.\n\tconst askBeforeClosing = (nextOpen: boolean, details: OpenChangeDetails) => {\n\t\tif (nextOpen || !draft) return;\n\t\tdetails.cancel();\n\t\tconfirmation({\n\t\t\ttitle: 'Discard this draft?',\n\t\t\tdescription: 'Your changes will be lost.',\n\t\t\tconfirm: { text: 'Discard', color: 'danger' },\n\t\t\tcancel: 'Keep editing'\n\t\t}).then(({ confirmed }) => {\n\t\t\tif (!confirmed) return;\n\t\t\tdraft = '';\n\t\t\topen = false;\n\t\t});\n\t};\n</script>\n\n<Dialog type=\"drawerRight\" title=\"New message\" bind:open onOpenChange={askBeforeClosing}>\n\t<textarea aria-label=\"Message\" bind:value={draft}></textarea>\n</Dialog>\n```\n\n### Non-modal\n\n```svelte\n<Dialog modal={false} type=\"drawerRight\" title=\"Inspector\" trigger={{ content: 'Open inspector' }}>\n\t<p>The page behind stays interactive.</p>\n</Dialog>\n```\n\n### Snap points\n\n```svelte\n<script lang=\"ts\">\n\timport { Dialog } from 'entasis/dialog';\n\n\tlet snapPoint = $state<number | string>(0.3);\n</script>\n\n<Dialog\n\ttype=\"drawerBottom\"\n\ttitle=\"Snap points\"\n\tsnapPoints={[0.3, 0.6, 1]}\n\tbind:snapPoint\n\tonSnapPointChange={({ snapPoint, details }) => console.log(snapPoint, details.reason)}\n\ttrigger={{ content: 'Open sheet' }}\n>\n\t{#snippet children(dialog)}\n\t\t<button onclick={() => dialog.setSnapPoint(1)}>Expand</button>\n\t{/snippet}\n</Dialog>\n```\n\n### A with a custom as button props \n```svelte\n\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n</script>\n\n\n<Dialog bind:open title=\"Welcome\"\ntrigger={{\ncontent:\"Click me\",\ncolor:\"secondary\",\nsize:\"small\"\n}}\n>\n\t<p>This is a basic dialog.</p>\t\n</Dialog>\n```\n\n### With Description\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n</script>\n\n<Dialog \t\n\ttitle=\"Confirm Action\"\n\tdescription=\"Are you sure you want to continue?\"\n>\n\t<p>This action cannot be undone.</p>\n</Dialog>\n```\n\n### Different Sizes\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\tlet open = $state(false);\n</script>\n\n```\n\n### Advanced Example\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { Button } from 'entasis/button';\n\t\n\tlet open = $state(false);\n\t\n\tfunction handleConfirm() {\n\t\tconsole.log('Confirmed!');\n\t\topen = false;\n\t}\n</script>\n\n<Dialog bind:open title=\"Confirm\">\n\tAre you sure?\n\t\n\t{#snippet footer()}\n\t\t<div class=\"flex gap-2 justify-end\">\n\t\t\t<Button variant=\"ghost\" onclick={() => open = false}>\n\t\t\t\tCancel\n\t\t\t</Button>\n\t\t\t<Button color=\"danger\" onclick={handleConfirm}>\n\t\t\t\tConfirm\n\t\t\t</Button>\n\t\t</div>\n\t{/snippet}\n</Dialog>\n```\n\n### Drawer Types\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\t\n</script>\n\n<!-- Right drawer -->\n<Dialog type=\"drawerRight\" title=\"Side Drawer\">\n\tThis slides in from the right\n</Dialog>\n\n<!-- Left drawer -->\n<Dialog type=\"drawerLeft\" title=\"Left Drawer\">\n\tThis slides in from the left\n</Dialog>\n\n<!-- Bottom drawer -->\n<Dialog type=\"drawerBottom\" title=\"Bottom Drawer\">\n\tThis slides in from the bottom\n</Dialog>\n\n<!-- Full screen -->\n<Dialog type=\"fullScreen\" title=\"Full Screen\">\n\tFull screen dialog content\n</Dialog>\n```\n\n### Custom Header\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\timport { warningIcon } from 'entasis/icons/warning';\n</script>\n\n<Dialog bind:open>\n\t{#snippet header()}\n\t\t<div class=\"flex items-center gap-2\">\n\t\t\t{@render warningIcon()}\n\t\t\t<h2>Warning</h2>\n\t\t</div>\n\t{/snippet}\n\t\n\tThis is important!\n</Dialog>\n```\n\n\n### With Lifecycle Hooks\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n\t\n\tlet open = $state(false);\n</script>\n\n<Dialog \n\tbind:open\n\ttitle=\"Lifecycle\"\n\tonAfterOpen={(payload) => console.log('Dialog opened', payload)}\n\tonAfterClose={(payload) => console.log('Dialog closed', payload)}\n>\n\tWatch the console\n</Dialog>\n```\n\n## State Management\n\nThe `trigger` and `children` snippets, `onAfterOpen` and `onAfterClose` receive a `DialogApi` (`import type { DialogApi } from './index.ts'`). It is a narrow handle: the class behind it stays internal, so its layer, focus scope and swipe machinery can change without breaking you. It provides:\n\n- **id**: string - Dialog identifier, which the open trigger's `aria-controls` points at\n- **isOpen**: boolean - Whether the dialog is open\n- **status**: 'closed' | 'entering' | 'open' | 'exiting' - Where the dialog is in its open/close lifecycle\n- **modal**: boolean - Whether the dialog is modal\n- **computedType**: DialogType - The type resolved for the current viewport, after the mobile sheet collapse\n- **open(details?)**, **close(details?)**, **toggle(details?)** - Request a change through `onOpenChange`; each accepts the DOM event or partial details (`{ reason, event }`), and reports `'imperative-action'` unless a trigger press is dispatching\n- **setOpen(open, details?)**: boolean - The same request with an explicit state; returns `false` when `onOpenChange` cancelled it\n- **setSnapPoint(point, details?)**: boolean - Moves a snap-point drawer to one of its `snapPoints` (or the nearest to `point`) through `onSnapPointChange`; returns `false` when it did not move\n- **currentSnapPoint**: number | string | undefined - The point the drawer rests at, as written in `snapPoints`\n- **triggerProps**: { haspopup, expanded, controls } - The trigger state in the library's semantic vocabulary, to spread on a Button; `trigger` and `reference` already write it as ARIA attributes\n- **trigger**: attachment that makes any element the dialog's trigger (`{@attach dialog.trigger}`): `reference`, plus a click that opens the dialog and, on a non-control, `role=\"button\"`, `tabindex=\"0\"` and Enter/Space activation. The element's own handler runs first; `event.preventDefault()` there stops it\n- **reference**: attachment that keeps a custom trigger's `aria-haspopup`, `aria-expanded` and `aria-controls` in sync and makes it the element focus returns to, leaving clicks to the element\n\n## Styling hooks\n\nThe root, the panel, the trigger and the shared backdrop carry state attributes, so a theme or a `class` can style each phase without reading component state.\n\nAttributes are presence attributes (set while the state holds, omitted otherwise) unless they carry a value.\n\n**Data attributes**\n- `data-open`: On the root (`role=\"dialog\"`), the panel and the shared backdrop: present while open.\n- `data-closed`: On the root, the panel and the backdrop: present while their exit transition plays (a closed dialog is not rendered).\n- `data-entering`: On the root and the panel: present while the enter transition plays.\n- `data-exiting`: On the root and the panel: present while the exit transition plays.\n- `data-type`: On the root and the panel: the type actually shown (`modal`, `drawerBottom`, ...), after responsive records and the mobile-sheet fallback resolve.\n- `data-modal`: On the root: `true` or `false`, whether the dialog is modal.\n- `data-popup-open`: On the trigger (the built-in button, or an element with `dialog.trigger` / `dialog.reference`): present while the dialog is open.\n- `data-dialog-open`: On `<html>`: present while at least one modal dialog is open.\n\n**CSS variables**\n- `--dialog-depth`: On `<html>`: how many modal dialogs are open (`1` for a single sheet), for pages that scale back behind a sheet.\n- `--drawer-inset`: On the root: the gap between a drawer and the screen edge, from the `inset` prop or the theme.\n- `--drawer-edge-radius`: On a drawer's panel: the radius of its screen-edge corners, `0` while it touches the edge.\n\nThe typed maps `dialogDataAttributes` and `dialogCssVariables` (from `entasis/dialog`) list each name with its meaning.\n\n```svelte\n<script>\n\timport { Dialog } from 'entasis/dialog';\n</script>\n\n<!-- Fade the trigger while its dialog is open -->\n<Dialog trigger={{ content: 'Open', class: 'data-popup-open:opacity-60' }} title=\"Settings\">\u2026</Dialog>\n```\n\n## Accessibility\n\n- Initial focus goes to an `[autofocus]` / `[data-autofocus]` element inside the dialog, else the first tabbable control (the close button is skipped), else the panel itself\n- Tab and Shift+Tab are contained inside the dialog, and the rest of the page is `inert` while a modal is open\n- Focus is restored to the opener after the close transition finishes, just before `onAfterClose`: the trigger that opened it, else the element focused when it opened. When that element is gone or disabled (a menu item that opened the dialog), focus goes to the last element that had it inside the dialog beneath this one, else to the most recent element still on the page. A close by Escape or from the keyboard returns focus with a visible focus ring, and in Safari a focused text field is blurred before it unmounts so the page does not jump. `focusOnClose` overrides all of this\n- When a dialog (a Confirmation, say) closes over another dialog, the one beneath keeps focus where it was and receives it back from the closing one; it does not move focus to its first field again\n- Tab moves focus inside the dialog itself instead of leaving it to the browser, so it wraps in Safari too, where Tab skips buttons by default\n- The trigger (built-in, or a snippet element with `{@attach dialog.trigger}`) carries `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls` pointing at the open dialog\n- On Android, the Back gesture closes the topmost modal dialog (not a `modal={false}` one) through a `CloseWatcher` (`reason: 'close-watcher'`), under the same rules as Escape\n- `aria-labelledby` links the `title` and `aria-describedby` links the `description`\n- The root is `role=\"dialog\"`, or `role=\"alertdialog\"` for `type=\"alert\"`, always with `aria-modal=\"true\"`\n- The root and the panel carry `data-type` with the resolved type (a responsive record or a modal collapsed into a mobile sheet reports the type actually shown), which drawer edge rounding keys on\n- A closable dialog whose visible close button is suppressed has a visually hidden `Close` button (`tabindex=\"-1\"`) at the end of the panel for a screen reader's virtual cursor; the default close button is named `Close`\n- Every way out of a dialog (Escape, an outside press, the close button, a swipe, Android Back) goes through `onOpenChange` with its `reason` before anything changes, so `details.cancel()` can hold any of them back; a cancelled swipe snaps back with no exit animation\n- Escape closes only the topmost open layer and an outside press dismisses the layers above the one pressed; both honour `closeOnEscape` / `closable` / `closeOnClickOutside` through the shared layer stack\n- Page scroll is locked while a dialog is open: `data-entasis-scroll-lock` on `<html>` (the Tailwind plugin turns it into `overflow: hidden`, so a lock another library holds is never overwritten) and `--entasis-scrollbar-width` with the hidden scrollbar's width, for `position: fixed` headers that must not jump. A page with `scrollbar-gutter: stable` gets no second gutter\n\n## Indent effect\n\nWhile at least one modal dialog is open, `<html>` carries the `data-dialog-open` attribute and the `--dialog-depth` custom property (the number of open modal dialogs, `1` for a single sheet). A page can scale back behind a sheet with plain CSS:\n\n```css\n.app-shell { transition: transform 300ms ease; transform-origin: 50% 0; }\nhtml[data-dialog-open] .app-shell { transform: scale(calc(1 - var(--dialog-depth) * 0.04)); }\n```\n\nNon-modal dialogs do not set them.\n\n## On-screen keyboard\n\nIn a `drawerBottom` (or a modal collapsed into a mobile sheet), while a text field inside the panel has focus the sheet's bottom padding grows by `--keyboard-inset` (the height the keyboard covers, published on `<html>` by the Theme), the panel shrinks to the room above the keyboard, and the field is centered once the visual viewport has stopped moving. Focus moving from one field to the next never lets the sheet drop in between. Browsers that resize the layout viewport for the keyboard (Chrome on Android only with `interactive-widget=resizes-content` in the viewport meta tag) report no inset and need no help; by default Chrome on Android reports the inset and the sheet uses it, like iOS.\n\n## Notes\n\n- Multiple dialogs can be stacked\n- Last opened dialog receives focus\n- Background overlay prevents interaction with page\n- Scroll locking prevents background scroll\n- Transitions are customizable\n\n## Theme Customization\n\nThe Dialog 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- **motion**: Open/close transition preset, keyed by `type` (drawers fly from their edge). Takes\n `in` / `out` FSO params plus a `duration` / `easing` motion token; the `transition` prop wins\n over it\n- **root**: Dialog overlay/backdrop styles\n- **content**: Dialog content container styles\n- **thumb**: Drag thumb bar styles (type variant controls per-side placement)\n- **header**: Dialog header section styles\n- **footer**: Dialog footer section styles\n- **closeButton**: Close button styles\n- **title**: Dialog title text styles\n- **description**: Dialog description text styles\n\n### Theme Type Definition\n\n```typescript\nimport type { DialogThemeProps } from 'entasis/dialog';\n\n// Example theme customization\nconst customTheme: DialogThemeProps = {\n root: {\n base: 'z-[+50] fixed inset-0 flex',\n scroll: {\n inner: 'overflow-hidden',\n outer: 'overflow-auto'\n }\n },\n align: {\n type: {\n fullScreen: 'justify-center items-center',\n drawerRight: 'justify-end',\n drawerLeft: 'justify-start',\n drawerBottom: 'justify-center items-end',\n drawerTop: 'justify-center items-start',\n modal: 'justify-center',\n alert: 'justify-center'\n }\n },\n content: {\n size: {\n small: 'max-w-md w-full',\n normal: 'max-w-xl w-full',\n large: 'max-w-3xl w-full'\n },\n type: {\n fullScreen: 'h-full w-full max-w-full',\n drawerRight: 'rounded-r-[var(--drawer-edge-radius)] h-full',\n modal: ''\n }\n },\n header: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n },\n title: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n },\n description: {\n size: {\n small: '',\n normal: '',\n large: ''\n }\n }\n};\n```\n\n### Available Variants\n\n**root**:\n- base: Base classes for dialog overlay/backdrop\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size constraints\n - type: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'modal' | 'alert' - Dialog type/layout\n\n**content**:\n- base: Base classes for dialog content container\n- Variants:\n - size: 'small' | 'normal' | 'large' - Content max-width\n - type: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'modal' | 'alert' - Content styling based on type\n\n**header**:\n- base: Base classes for header section\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**footer**:\n- base: Base classes for footer section\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**closeButton**:\n- base: Base classes for close button\n- Variants:\n - size: 'small' | 'normal' | 'large' - Size-based styling\n\n**title**:\n- base: Base classes for title text\n- Variants:\n - size: 'small' | 'normal' | 'large' - Text size\n\n**description**:\n- base: Base classes for description text\n- Variants:\n - size: 'small' | 'normal' | 'large' - Text size\n\n### Usage Examples\n\n**Basic Theme Override**:\n```svelte\n<Dialog \n title=\"Custom Dialog\"\n theme={{\n content: {\n base: 'rounded-2xl raised-5',\n size: {\n normal: 'max-w-2xl'\n }\n },\n header: {\n base: 'border-b-2 border-primary'\n }\n }}\n>\n Custom styled dialog content\n</Dialog>\n```\n\n**Drawer Type Customization**:\n```svelte\n<Dialog \n type=\"drawerRight\"\n theme={{\n align: {\n type: {\n drawerRight: 'justify-end'\n }\n },\n backdrop: {\n base: 'bg-black/50'\n },\n content: {\n type: {\n drawerRight: 'rounded-l-xl raised-5'\n }\n }\n }}\n>\n Custom drawer styling\n</Dialog>\n```\n\n**Global Theme Setting**:\n```svelte\n<script>\n import { setDialogTheme } from './index.ts';\n \n setDialogTheme({\n root: {\n base: 'backdrop-blur-sm'\n },\n content: {\n base: 'lift-5 border-2',\n size: {\n normal: 'max-w-2xl'\n }\n },\n title: {\n base: 'text-2xl font-bold'\n }\n });\n</script>\n```\n";
|
|
@@ -21,6 +21,7 @@ The Dialog component (also known as Modal) displays content in a layer above the
|
|
|
21
21
|
|
|
22
22
|
### Core Props
|
|
23
23
|
- **open**: boolean (bindable) - Controls dialog visibility
|
|
24
|
+
- **modal**: boolean (default: true) - A modal makes the page behind \`inert\`, locks page scroll, contains Tab, dims the page with the shared backdrop and dismisses on an outside press. \`modal={false}\` leaves the page interactive: no \`inert\`, no scroll lock, no backdrop, no Tab containment, and an outside press does not dismiss it unless \`closeOnClickOutside\` is set. Escape, the close button and swipes still close it (the Android Back gesture does not: it closes modal dialogs only). It renders no \`aria-modal\` (and \`data-modal="false"\`), always scrolls inside its card, and does not push dialogs beneath it back
|
|
24
25
|
- **defaultOpen**: boolean (default: false) - Initial state when open is not provided
|
|
25
26
|
- **id**: string - Unique identifier for the dialog
|
|
26
27
|
- **type**: 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'alert' | 'modal' (default: 'modal')
|
|
@@ -29,7 +30,7 @@ The Dialog component (also known as Modal) displays content in a layer above the
|
|
|
29
30
|
- drawerLeft: Drawer sliding in from the left
|
|
30
31
|
- drawerBottom: Drawer sliding in from the bottom
|
|
31
32
|
- drawerTop: Drawer sliding in from the top
|
|
32
|
-
- alert: Alert
|
|
33
|
+
- alert: Alert dialog for an interruption that needs an answer: renders \`role="alertdialog"\` and ignores outside presses unless \`closeOnClickOutside\` is set (Escape still closes it)
|
|
33
34
|
- modal: Standard modal dialog
|
|
34
35
|
- Supports responsive values: pass a \`Partial<Record<Breakpoint, DialogType>>\` record such as \`{ xs: 'drawerBottom', md: 'modal' }\` to vary the type per breakpoint (breakpoint is one of 'xs' | 'sm' | 'md' | 'lg' | 'xl', tracked live from the viewport; the nearest defined key at or below the active one wins)
|
|
35
36
|
- **responsive**: boolean (default: true) - When the resolved type is \`modal\`, collapse it into a \`drawerBottom\` bottom sheet on mobile (viewport < 768px). The sheet inherits swipe-to-dismiss and the drag thumb. Set false to keep a centered modal on every screen size
|
|
@@ -41,27 +42,32 @@ The Dialog component (also known as Modal) displays content in a layer above the
|
|
|
41
42
|
- large: Larger dialog size
|
|
42
43
|
|
|
43
44
|
### Event Props
|
|
44
|
-
- **onOpenChange**: (open: boolean) => void - Called
|
|
45
|
-
- **onAfterOpen**: (payload:
|
|
46
|
-
- **onAfterClose**: (payload:
|
|
45
|
+
- **onOpenChange**: (open: boolean, details: OpenChangeDetails) => void - Called before each library-requested state change, with \`details.reason\` (\`'trigger-press'\`, \`'escape-key'\`, \`'outside-press'\`, \`'close-press'\`, \`'swipe'\`, \`'close-watcher'\` for the Android Back gesture, \`'imperative-action'\`…), \`details.event\`, \`details.trigger\`, \`details.interaction\` and \`details.cancel()\`. Cancelling keeps the dialog as it is (a cancelled swipe snaps back) and leaves the event untouched. Inside the callback \`open\` still holds the previous state. Types from \`entasis/types\`
|
|
46
|
+
- **onAfterOpen**: (payload: DialogApi) => void - Called once per open after the open transition finishes; a dialog created open (\`defaultOpen\`) renders once mounted, animates in and reports it too
|
|
47
|
+
- **onAfterClose**: (payload: DialogApi) => void - Called once per close after the close transition finishes
|
|
47
48
|
|
|
48
49
|
### Slot Props
|
|
49
|
-
- **title**: string | Snippet
|
|
50
|
-
- **description**: string | Snippet
|
|
51
|
-
- **children**: Snippet<[
|
|
50
|
+
- **title**: string | Snippet - Dialog title
|
|
51
|
+
- **description**: string | Snippet - Dialog description
|
|
52
|
+
- **children**: Snippet<[DialogApi]> - Main dialog content
|
|
52
53
|
- **header**: Snippet - Custom header content
|
|
53
54
|
- **footer**: Snippet - Custom footer content
|
|
54
|
-
- **trigger**: Snippet | (ButtonProps & { content?: string }) - Custom trigger button
|
|
55
|
-
- **closeButton**: Snippet - Custom close button
|
|
55
|
+
- **trigger**: Snippet<[DialogApi]> | (ButtonProps & { content?: string }) - Custom trigger button. The built-in button carries \`aria-haspopup="dialog"\`, \`aria-expanded\` and \`aria-controls\`; its \`onclick\` runs first, and \`event.preventDefault()\` there keeps the dialog closed. In a snippet, \`{@attach dialog.trigger}\` gives any element the same contract
|
|
56
|
+
- **closeButton**: Snippet | false - Custom close button, or \`false\` to suppress the visible one. A closable dialog whose visible button is suppressed (\`false\`, or a snippet that renders nothing, as the Popover mobile sheet passes) still renders a visually hidden \`Close\` button at the end of the panel, out of the Tab order but in the accessibility tree, so screen reader users have a control that closes it. An \`alert\` never gets one: its own buttons answer it. The default close button is named \`Close\` (translated by the i18n catalog)
|
|
56
57
|
|
|
57
58
|
### Behavior Props
|
|
58
|
-
- **closeOnEscape**: boolean (default: true) - Close when Escape key is pressed
|
|
59
|
-
- **closeOnClickOutside**: boolean (default: true) - Close when
|
|
59
|
+
- **closeOnEscape**: boolean (default: true) - Close when Escape key is pressed (and, for a modal dialog on Android, on the Back gesture)
|
|
60
|
+
- **closeOnClickOutside**: boolean (default: true, false for \`type="alert"\` and for \`modal={false}\`) - Close when pressing outside dialog. A press that began before the dialog opened does not count
|
|
60
61
|
- **closable**: boolean (default: true) - Whether dialog can be closed
|
|
61
|
-
- **
|
|
62
|
+
- **focusOnClose**: boolean | HTMLElement | ((details) => HTMLElement | boolean | void) (default: true) - Where focus goes when the dialog closes. \`true\` returns it to the control that opened the dialog, else to the most recent element still on the page; \`false\` leaves focus alone; an element receives it; a function gets the change details (\`reason\`, \`interaction\`…) and returns one of these, or nothing to restore as usual
|
|
63
|
+
- **swipeToDismiss**: boolean (default: true for drawer types) - Drag the drawer toward its edge to dismiss. Direction-aware (drawerRight drags right, drawerBottom drags down, etc.) and never hijacks inner scrolling (including a horizontal scroller in a right-to-left layout) or a mostly sideways drag (a press that travels more across the dismiss axis than along it is spent); a quick flick dismisses even when the last move before release is nearly stationary; opt elements out with \`data-no-swipe\`. A mouse or pen drags a drawer only from its handles (thumb and header), so dragging over the body selects text; a finger drags from anywhere unless text is selected in the panel. A dialog above another one keeps the one beneath moving with it: its scale and fade follow the swipe's progress
|
|
62
64
|
- **thumb**: boolean (default: true) - Drag thumb bar shown on swipe-dismissable drawers (inner edge, orientation follows the drawer side, oversized hitbox); set false to hide. Themeable via the \`thumb\` theme part
|
|
63
65
|
- **inset**: a spacing step or \`'none'\` — how far a drawer stands off the screen edge for this dialog. Defaults to the theme's \`designTokens.drawerInset\` (\`'layout-md'\`). At \`'none'\` the drawer is edge to edge, its edge corners square off and only the corners facing the page stay rounded
|
|
64
|
-
- **swipeFrom**: 'panel' | 'handle' (default: 'panel') - Where a swipe can start: anywhere on the panel, or only the drag handles (thumb and header)
|
|
66
|
+
- **swipeFrom**: 'panel' | 'handle' (default: 'panel') - Where a finger swipe can start: anywhere on the panel, or only the drag handles (thumb and header). Mouse and pen always start from a handle
|
|
67
|
+
- **snapPoints**: (number | string)[] - Where a \`drawerBottom\` or \`drawerTop\` (or a modal collapsed into a mobile sheet) can rest. A number is a fraction of the available height (above 0, at most 1), a string a CSS length (\`'148px'\`, \`'20rem'\`, \`'40%'\`, \`'50vh'\`). The panel is as tall as the largest point and shows only the active one; a drag moves it between the points, a flick (0.4 px/ms or more) carries it to the next one in the direction it was thrown, and dragging below the lowest dismisses it when swipe-to-dismiss is on (otherwise the lowest is as far as it goes). The body scrolls only at the largest point; below it, a drag anywhere moves the panel. Ignored by the other types
|
|
68
|
+
- **snapPoint**: number | string (bindable) - The point the drawer rests at, one of \`snapPoints\`
|
|
69
|
+
- **defaultSnapPoint**: number | string - The point it opens at when \`snapPoint\` is not bound (default: the largest)
|
|
70
|
+
- **onSnapPointChange**: ({ snapPoint, details }: { snapPoint; details: OpenChangeDetails }) => void - Called before the resting point changes. \`details.reason\` is \`'swipe'\` or \`'imperative-action'\` (\`dialog.setSnapPoint\`); \`details.cancel()\` keeps the current point and a cancelled drag snaps back
|
|
65
71
|
|
|
66
72
|
### Visual Props
|
|
67
73
|
- **transition**: TransitionConfig - Custom transition animation
|
|
@@ -106,8 +112,113 @@ The Dialog component (also known as Modal) displays content in a layer above the
|
|
|
106
112
|
<Dialog bind:open title="Welcome">
|
|
107
113
|
<p>This is a basic dialog.</p>
|
|
108
114
|
|
|
115
|
+
<!-- {@attach dialog.trigger} opens the dialog on click (Enter/Space on a non-control) and
|
|
116
|
+
keeps aria-haspopup / aria-expanded / aria-controls in sync; focus returns to it -->
|
|
109
117
|
{#snippet trigger(dialog)}
|
|
110
|
-
<Button
|
|
118
|
+
<Button {@attach dialog.trigger}>Open</Button>
|
|
119
|
+
{/snippet}
|
|
120
|
+
</Dialog>
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
### Choose where focus goes on close
|
|
124
|
+
|
|
125
|
+
\`\`\`svelte
|
|
126
|
+
<script lang="ts">
|
|
127
|
+
import { Dialog } from './index.ts';
|
|
128
|
+
|
|
129
|
+
let search = $state<HTMLInputElement | null>(null);
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<input bind:this={search} aria-label="Search" />
|
|
133
|
+
<!-- After a save, focus the search field instead of the button that opened the dialog. -->
|
|
134
|
+
<Dialog
|
|
135
|
+
title="Rename"
|
|
136
|
+
trigger={{ content: 'Rename' }}
|
|
137
|
+
focusOnClose={(details) => (details?.reason === 'close-press' ? search : undefined)}
|
|
138
|
+
>
|
|
139
|
+
<p>New name</p>
|
|
140
|
+
</Dialog>
|
|
141
|
+
\`\`\`
|
|
142
|
+
|
|
143
|
+
### Cancel a close
|
|
144
|
+
|
|
145
|
+
\`\`\`svelte
|
|
146
|
+
<script lang="ts">
|
|
147
|
+
import { Dialog } from './index.ts';
|
|
148
|
+
import type { OpenChangeDetails } from '../../types/index.ts';
|
|
149
|
+
|
|
150
|
+
let draft = $state('');
|
|
151
|
+
// Runs before the change: with a draft, only the close button closes the dialog.
|
|
152
|
+
const keepDraft = (open: boolean, details: OpenChangeDetails) => {
|
|
153
|
+
if (!open && draft && details.reason !== 'close-press') details.cancel();
|
|
154
|
+
};
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<Dialog title="New message" trigger={{ content: 'Write' }} onOpenChange={keepDraft}>
|
|
158
|
+
<textarea aria-label="Message" bind:value={draft}></textarea>
|
|
159
|
+
</Dialog>
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
### Ask before closing
|
|
163
|
+
|
|
164
|
+
\`\`\`svelte
|
|
165
|
+
<script lang="ts">
|
|
166
|
+
import { Dialog } from './index.ts';
|
|
167
|
+
import { confirmation } from '../Confirmation/index.ts';
|
|
168
|
+
import type { OpenChangeDetails } from '../../types/index.ts';
|
|
169
|
+
|
|
170
|
+
let open = $state(false);
|
|
171
|
+
let draft = $state('');
|
|
172
|
+
|
|
173
|
+
// Escape, an outside press, the close button, a swipe and Android Back all arrive here.
|
|
174
|
+
const askBeforeClosing = (nextOpen: boolean, details: OpenChangeDetails) => {
|
|
175
|
+
if (nextOpen || !draft) return;
|
|
176
|
+
details.cancel();
|
|
177
|
+
confirmation({
|
|
178
|
+
title: 'Discard this draft?',
|
|
179
|
+
description: 'Your changes will be lost.',
|
|
180
|
+
confirm: { text: 'Discard', color: 'danger' },
|
|
181
|
+
cancel: 'Keep editing'
|
|
182
|
+
}).then(({ confirmed }) => {
|
|
183
|
+
if (!confirmed) return;
|
|
184
|
+
draft = '';
|
|
185
|
+
open = false;
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<Dialog type="drawerRight" title="New message" bind:open onOpenChange={askBeforeClosing}>
|
|
191
|
+
<textarea aria-label="Message" bind:value={draft}></textarea>
|
|
192
|
+
</Dialog>
|
|
193
|
+
\`\`\`
|
|
194
|
+
|
|
195
|
+
### Non-modal
|
|
196
|
+
|
|
197
|
+
\`\`\`svelte
|
|
198
|
+
<Dialog modal={false} type="drawerRight" title="Inspector" trigger={{ content: 'Open inspector' }}>
|
|
199
|
+
<p>The page behind stays interactive.</p>
|
|
200
|
+
</Dialog>
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
### Snap points
|
|
204
|
+
|
|
205
|
+
\`\`\`svelte
|
|
206
|
+
<script lang="ts">
|
|
207
|
+
import { Dialog } from './index.ts';
|
|
208
|
+
|
|
209
|
+
let snapPoint = $state<number | string>(0.3);
|
|
210
|
+
</script>
|
|
211
|
+
|
|
212
|
+
<Dialog
|
|
213
|
+
type="drawerBottom"
|
|
214
|
+
title="Snap points"
|
|
215
|
+
snapPoints={[0.3, 0.6, 1]}
|
|
216
|
+
bind:snapPoint
|
|
217
|
+
onSnapPointChange={({ snapPoint, details }) => console.log(snapPoint, details.reason)}
|
|
218
|
+
trigger={{ content: 'Open sheet' }}
|
|
219
|
+
>
|
|
220
|
+
{#snippet children(dialog)}
|
|
221
|
+
<button onclick={() => dialog.setSnapPoint(1)}>Expand</button>
|
|
111
222
|
{/snippet}
|
|
112
223
|
</Dialog>
|
|
113
224
|
\`\`\`
|
|
@@ -264,22 +375,84 @@ size:"small"
|
|
|
264
375
|
|
|
265
376
|
## State Management
|
|
266
377
|
|
|
267
|
-
The
|
|
378
|
+
The \`trigger\` and \`children\` snippets, \`onAfterOpen\` and \`onAfterClose\` receive a \`DialogApi\` (\`import type { DialogApi } from './index.ts'\`). It is a narrow handle: the class behind it stays internal, so its layer, focus scope and swipe machinery can change without breaking you. It provides:
|
|
379
|
+
|
|
380
|
+
- **id**: string - Dialog identifier, which the open trigger's \`aria-controls\` points at
|
|
381
|
+
- **isOpen**: boolean - Whether the dialog is open
|
|
382
|
+
- **status**: 'closed' | 'entering' | 'open' | 'exiting' - Where the dialog is in its open/close lifecycle
|
|
383
|
+
- **modal**: boolean - Whether the dialog is modal
|
|
384
|
+
- **computedType**: DialogType - The type resolved for the current viewport, after the mobile sheet collapse
|
|
385
|
+
- **open(details?)**, **close(details?)**, **toggle(details?)** - Request a change through \`onOpenChange\`; each accepts the DOM event or partial details (\`{ reason, event }\`), and reports \`'imperative-action'\` unless a trigger press is dispatching
|
|
386
|
+
- **setOpen(open, details?)**: boolean - The same request with an explicit state; returns \`false\` when \`onOpenChange\` cancelled it
|
|
387
|
+
- **setSnapPoint(point, details?)**: boolean - Moves a snap-point drawer to one of its \`snapPoints\` (or the nearest to \`point\`) through \`onSnapPointChange\`; returns \`false\` when it did not move
|
|
388
|
+
- **currentSnapPoint**: number | string | undefined - The point the drawer rests at, as written in \`snapPoints\`
|
|
389
|
+
- **triggerProps**: { haspopup, expanded, controls } - The trigger state in the library's semantic vocabulary, to spread on a Button; \`trigger\` and \`reference\` already write it as ARIA attributes
|
|
390
|
+
- **trigger**: attachment that makes any element the dialog's trigger (\`{@attach dialog.trigger}\`): \`reference\`, plus a click that opens the dialog and, on a non-control, \`role="button"\`, \`tabindex="0"\` and Enter/Space activation. The element's own handler runs first; \`event.preventDefault()\` there stops it
|
|
391
|
+
- **reference**: attachment that keeps a custom trigger's \`aria-haspopup\`, \`aria-expanded\` and \`aria-controls\` in sync and makes it the element focus returns to, leaving clicks to the element
|
|
392
|
+
|
|
393
|
+
## Styling hooks
|
|
394
|
+
|
|
395
|
+
The root, the panel, the trigger and the shared backdrop carry state attributes, so a theme or a \`class\` can style each phase without reading component state.
|
|
396
|
+
|
|
397
|
+
Attributes are presence attributes (set while the state holds, omitted otherwise) unless they carry a value.
|
|
268
398
|
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
399
|
+
**Data attributes**
|
|
400
|
+
- \`data-open\`: On the root (\`role="dialog"\`), the panel and the shared backdrop: present while open.
|
|
401
|
+
- \`data-closed\`: On the root, the panel and the backdrop: present while their exit transition plays (a closed dialog is not rendered).
|
|
402
|
+
- \`data-entering\`: On the root and the panel: present while the enter transition plays.
|
|
403
|
+
- \`data-exiting\`: On the root and the panel: present while the exit transition plays.
|
|
404
|
+
- \`data-type\`: On the root and the panel: the type actually shown (\`modal\`, \`drawerBottom\`, ...), after responsive records and the mobile-sheet fallback resolve.
|
|
405
|
+
- \`data-modal\`: On the root: \`true\` or \`false\`, whether the dialog is modal.
|
|
406
|
+
- \`data-popup-open\`: On the trigger (the built-in button, or an element with \`dialog.trigger\` / \`dialog.reference\`): present while the dialog is open.
|
|
407
|
+
- \`data-dialog-open\`: On \`<html>\`: present while at least one modal dialog is open.
|
|
408
|
+
|
|
409
|
+
**CSS variables**
|
|
410
|
+
- \`--dialog-depth\`: On \`<html>\`: how many modal dialogs are open (\`1\` for a single sheet), for pages that scale back behind a sheet.
|
|
411
|
+
- \`--drawer-inset\`: On the root: the gap between a drawer and the screen edge, from the \`inset\` prop or the theme.
|
|
412
|
+
- \`--drawer-edge-radius\`: On a drawer's panel: the radius of its screen-edge corners, \`0\` while it touches the edge.
|
|
413
|
+
|
|
414
|
+
The typed maps \`dialogDataAttributes\` and \`dialogCssVariables\` (from \`entasis/dialog\`) list each name with its meaning.
|
|
415
|
+
|
|
416
|
+
\`\`\`svelte
|
|
417
|
+
<script>
|
|
418
|
+
import { Dialog } from './index.ts';
|
|
419
|
+
</script>
|
|
420
|
+
|
|
421
|
+
<!-- Fade the trigger while its dialog is open -->
|
|
422
|
+
<Dialog trigger={{ content: 'Open', class: 'data-popup-open:opacity-60' }} title="Settings">…</Dialog>
|
|
423
|
+
\`\`\`
|
|
274
424
|
|
|
275
425
|
## Accessibility
|
|
276
426
|
|
|
277
427
|
- Initial focus goes to an \`[autofocus]\` / \`[data-autofocus]\` element inside the dialog, else the first tabbable control (the close button is skipped), else the panel itself
|
|
278
428
|
- Tab and Shift+Tab are contained inside the dialog, and the rest of the page is \`inert\` while a modal is open
|
|
279
|
-
- Focus is restored to the opener after the close transition finishes, just before \`onAfterClose\`
|
|
429
|
+
- Focus is restored to the opener after the close transition finishes, just before \`onAfterClose\`: the trigger that opened it, else the element focused when it opened. When that element is gone or disabled (a menu item that opened the dialog), focus goes to the last element that had it inside the dialog beneath this one, else to the most recent element still on the page. A close by Escape or from the keyboard returns focus with a visible focus ring, and in Safari a focused text field is blurred before it unmounts so the page does not jump. \`focusOnClose\` overrides all of this
|
|
430
|
+
- When a dialog (a Confirmation, say) closes over another dialog, the one beneath keeps focus where it was and receives it back from the closing one; it does not move focus to its first field again
|
|
431
|
+
- Tab moves focus inside the dialog itself instead of leaving it to the browser, so it wraps in Safari too, where Tab skips buttons by default
|
|
432
|
+
- The trigger (built-in, or a snippet element with \`{@attach dialog.trigger}\`) carries \`aria-haspopup="dialog"\`, \`aria-expanded\` and \`aria-controls\` pointing at the open dialog
|
|
433
|
+
- On Android, the Back gesture closes the topmost modal dialog (not a \`modal={false}\` one) through a \`CloseWatcher\` (\`reason: 'close-watcher'\`), under the same rules as Escape
|
|
280
434
|
- \`aria-labelledby\` links the \`title\` and \`aria-describedby\` links the \`description\`
|
|
435
|
+
- The root is \`role="dialog"\`, or \`role="alertdialog"\` for \`type="alert"\`, always with \`aria-modal="true"\`
|
|
436
|
+
- The root and the panel carry \`data-type\` with the resolved type (a responsive record or a modal collapsed into a mobile sheet reports the type actually shown), which drawer edge rounding keys on
|
|
437
|
+
- A closable dialog whose visible close button is suppressed has a visually hidden \`Close\` button (\`tabindex="-1"\`) at the end of the panel for a screen reader's virtual cursor; the default close button is named \`Close\`
|
|
438
|
+
- Every way out of a dialog (Escape, an outside press, the close button, a swipe, Android Back) goes through \`onOpenChange\` with its \`reason\` before anything changes, so \`details.cancel()\` can hold any of them back; a cancelled swipe snaps back with no exit animation
|
|
281
439
|
- Escape closes only the topmost open layer and an outside press dismisses the layers above the one pressed; both honour \`closeOnEscape\` / \`closable\` / \`closeOnClickOutside\` through the shared layer stack
|
|
282
|
-
-
|
|
440
|
+
- Page scroll is locked while a dialog is open: \`data-entasis-scroll-lock\` on \`<html>\` (the Tailwind plugin turns it into \`overflow: hidden\`, so a lock another library holds is never overwritten) and \`--entasis-scrollbar-width\` with the hidden scrollbar's width, for \`position: fixed\` headers that must not jump. A page with \`scrollbar-gutter: stable\` gets no second gutter
|
|
441
|
+
|
|
442
|
+
## Indent effect
|
|
443
|
+
|
|
444
|
+
While at least one modal dialog is open, \`<html>\` carries the \`data-dialog-open\` attribute and the \`--dialog-depth\` custom property (the number of open modal dialogs, \`1\` for a single sheet). A page can scale back behind a sheet with plain CSS:
|
|
445
|
+
|
|
446
|
+
\`\`\`css
|
|
447
|
+
.app-shell { transition: transform 300ms ease; transform-origin: 50% 0; }
|
|
448
|
+
html[data-dialog-open] .app-shell { transform: scale(calc(1 - var(--dialog-depth) * 0.04)); }
|
|
449
|
+
\`\`\`
|
|
450
|
+
|
|
451
|
+
Non-modal dialogs do not set them.
|
|
452
|
+
|
|
453
|
+
## On-screen keyboard
|
|
454
|
+
|
|
455
|
+
In a \`drawerBottom\` (or a modal collapsed into a mobile sheet), while a text field inside the panel has focus the sheet's bottom padding grows by \`--keyboard-inset\` (the height the keyboard covers, published on \`<html>\` by the Theme), the panel shrinks to the room above the keyboard, and the field is centered once the visual viewport has stopped moving. Focus moving from one field to the next never lets the sheet drop in between. Browsers that resize the layout viewport for the keyboard (Chrome on Android only with \`interactive-widget=resizes-content\` in the viewport meta tag) report no inset and need no help; by default Chrome on Android reports the inset and the sheet uses it, like iOS.
|
|
283
456
|
|
|
284
457
|
## Notes
|
|
285
458
|
|
|
@@ -1,65 +1,148 @@
|
|
|
1
1
|
import type { SpacingStep } from '../../tailwind/spacing.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { WithSlot } from '../Slot/slot.js';
|
|
4
|
-
import type {
|
|
3
|
+
import type { Slot, WithSlot } from '../Slot/slot.js';
|
|
4
|
+
import type { DialogApi } from './dialog.api.js';
|
|
5
5
|
import type { ResponsiveProps } from '../Theme/theme.js';
|
|
6
6
|
import type { Sizes } from '../../types/theme.js';
|
|
7
7
|
import type { ButtonProps } from '../Button/index.js';
|
|
8
8
|
import type { FSOProps } from '../../transitions/transition.js';
|
|
9
9
|
import type { DialogThemeProps } from './dialog.theme.js';
|
|
10
|
+
import type { OpenChangeDetails, OpenChangeHandler } from '../../utils/openChange.js';
|
|
11
|
+
import type { FocusOnClose } from '../../utils/useFocusScope.svelte.js';
|
|
10
12
|
export type DialogType = 'fullScreen' | 'drawerRight' | 'drawerLeft' | 'drawerBottom' | 'drawerTop' | 'alert' | 'modal';
|
|
13
|
+
/**
|
|
14
|
+
* A drawer snap point: how much of the drawer shows when it rests there. A number is a fraction
|
|
15
|
+
* of the available height (`0.5` is half of it), a string a CSS length (`'148px'`, `'20rem'`,
|
|
16
|
+
* `'40%'`, `'50vh'`).
|
|
17
|
+
*/
|
|
18
|
+
export type DialogSnapPoint = number | string;
|
|
11
19
|
export type DialogProps = WithSlot<{
|
|
12
20
|
/** Stable DOM id for the portaled dialog root; falls back to a generated id when omitted. */
|
|
13
21
|
id?: string;
|
|
14
22
|
/** Presentation variant (modal, alert, fullScreen, or edge drawer); supports responsive
|
|
15
|
-
* values — pass a `{ xs: 'drawerBottom', md: 'modal' }` record for per-breakpoint control.
|
|
23
|
+
* values — pass a `{ xs: 'drawerBottom', md: 'modal' }` record for per-breakpoint control.
|
|
24
|
+
* An `alert` renders `role="alertdialog"` and ignores outside presses by default. The
|
|
25
|
+
* resolved type is exposed as `data-type` on the root and the panel. */
|
|
16
26
|
type?: ResponsiveProps<DialogType>;
|
|
17
27
|
/** When the resolved type is `modal`, collapse it into a bottom-sheet drawer on mobile
|
|
18
28
|
* (viewport < 768px), inheriting swipe-to-dismiss and the drag thumb. Default `true`. */
|
|
19
29
|
responsive?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the dialog is modal (default `true`): it makes the page behind `inert`, locks page
|
|
32
|
+
* scroll, contains Tab, dims the page with the shared backdrop and dismisses on an outside
|
|
33
|
+
* press. `false` leaves the page interactive: no `inert`, no scroll lock, no backdrop, no
|
|
34
|
+
* focus containment, and an outside press does not dismiss it unless `closeOnClickOutside`
|
|
35
|
+
* is set. Escape, the close button and swipes still close it. It renders no `aria-modal`
|
|
36
|
+
* (an alert stays an `alertdialog`). A non-modal dialog always scrolls inside its card.
|
|
37
|
+
*/
|
|
38
|
+
modal?: boolean;
|
|
20
39
|
/** Controls whether the dialog is rendered; bindable for two-way control. */
|
|
21
40
|
open?: boolean;
|
|
22
41
|
/** Initial open state when `open` is not provided. */
|
|
23
42
|
defaultOpen?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Called before the dialog opens or closes, with the requested state and the change
|
|
45
|
+
* details: `reason` (`'trigger-press'`, `'escape-key'`, `'outside-press'`, `'close-press'`,
|
|
46
|
+
* `'swipe'`, `'close-watcher'` for the Android Back gesture, `'imperative-action'`…), the
|
|
47
|
+
* originating `event`, the `trigger` element, the `interaction` type and `cancel()`.
|
|
48
|
+
* Calling `details.cancel()` keeps the dialog as it is (a cancelled swipe snaps back) and
|
|
49
|
+
* leaves the event untouched. Inside the callback, `open` still holds the previous state.
|
|
50
|
+
*/
|
|
51
|
+
onOpenChange?: OpenChangeHandler;
|
|
52
|
+
/** Called once per open, after the open transition finishes (right away when none plays). */
|
|
53
|
+
onAfterOpen?: (payload: DialogApi) => void;
|
|
54
|
+
/** Called once per close, after the close transition finishes. */
|
|
55
|
+
onAfterClose?: (payload: DialogApi) => void;
|
|
30
56
|
/** Content max-width for modal and alert types; supports responsive values. */
|
|
31
57
|
size?: ResponsiveProps<Sizes>;
|
|
32
58
|
/** Where a dialog taller than the viewport scrolls: inside the card (`inner`, default) or the viewport (`outer`). */
|
|
33
59
|
scroll?: ResponsiveProps<'inner' | 'outer'>;
|
|
34
60
|
/** Fly/scale opacity transition overrides for open and close; supports responsive values. */
|
|
35
61
|
transition?: ResponsiveProps<FSOProps>;
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Where focus goes when the dialog closes. By default it returns to the control that
|
|
64
|
+
* opened the dialog (with a visible focus ring after Escape or another keyboard close);
|
|
65
|
+
* when that control is gone or disabled, to the most recent element that is still on the
|
|
66
|
+
* page. `false` leaves focus where it is, an element receives it, and a function is called
|
|
67
|
+
* with the change details (`reason`, `interaction`…) and returns one of these, or nothing
|
|
68
|
+
* to restore as usual.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
focusOnClose?: FocusOnClose;
|
|
72
|
+
/**
|
|
73
|
+
* Where a bottom or top drawer (or a mobile sheet) can rest, from the least to the most of
|
|
74
|
+
* it showing: fractions of the available height or CSS lengths. With snap points the
|
|
75
|
+
* drawer opens at `defaultSnapPoint` (the largest by default), a drag moves it between the
|
|
76
|
+
* points (a flick carries it to the next), and dragging below the lowest one dismisses it
|
|
77
|
+
* when swipe-to-dismiss is on. Its body scrolls only at the largest point. Ignored by the
|
|
78
|
+
* other types.
|
|
79
|
+
*/
|
|
80
|
+
snapPoints?: DialogSnapPoint[];
|
|
81
|
+
/**
|
|
82
|
+
* The snap point the drawer rests at: one of `snapPoints`, bindable. Without it the drawer
|
|
83
|
+
* manages its own, starting at `defaultSnapPoint`.
|
|
84
|
+
*/
|
|
85
|
+
snapPoint?: DialogSnapPoint;
|
|
86
|
+
/** The snap point the drawer opens at when `snapPoint` is not bound. Defaults to the largest. */
|
|
87
|
+
defaultSnapPoint?: DialogSnapPoint;
|
|
88
|
+
/**
|
|
89
|
+
* Called before the resting snap point changes, with `{ snapPoint, details }`: the new point
|
|
90
|
+
* and the change details (`reason` is `'swipe'` for a drag and `'imperative-action'` for
|
|
91
|
+
* `setSnapPoint`; `details.cancel()` keeps the current point and a cancelled drag snaps back).
|
|
92
|
+
*/
|
|
93
|
+
onSnapPointChange?: (payload: {
|
|
94
|
+
snapPoint: DialogSnapPoint;
|
|
95
|
+
details: OpenChangeDetails;
|
|
96
|
+
}) => void;
|
|
97
|
+
/** Snippet for main dialog body content; receives the dialog (`DialogApi`). */
|
|
98
|
+
children?: Snippet<[DialogApi]>;
|
|
99
|
+
/**
|
|
100
|
+
* Snippet or button props that render the control used to open the dialog. The built-in
|
|
101
|
+
* button carries `aria-haspopup="dialog"`, `aria-expanded` and `aria-controls`, and its
|
|
102
|
+
* `onclick` runs first: calling `event.preventDefault()` there keeps the dialog closed. A
|
|
103
|
+
* snippet trigger gets the same contract with `{@attach dialog.trigger}`; focus returns to
|
|
104
|
+
* the trigger when the dialog closes.
|
|
105
|
+
*/
|
|
106
|
+
trigger?: Snippet<[DialogApi]> | (ButtonProps & {
|
|
40
107
|
content?: string;
|
|
41
108
|
});
|
|
42
109
|
/** When true, shows a close button and allows Escape to close the dialog. */
|
|
43
110
|
closable?: boolean;
|
|
44
|
-
/** When true,
|
|
111
|
+
/** When true, pressing outside the dialog panel closes the topmost open dialog. Defaults to
|
|
112
|
+
* `true`, except for an `alert`, which ignores outside presses unless this is set. A press
|
|
113
|
+
* that began before the dialog opened does not count. */
|
|
45
114
|
closeOnClickOutside?: boolean;
|
|
46
|
-
/** When true, pressing Escape
|
|
115
|
+
/** When true, pressing Escape (and, for a modal dialog on Android, the Back gesture) closes
|
|
116
|
+
* the dialog when it is closable and topmost. */
|
|
47
117
|
closeOnEscape?: boolean;
|
|
48
118
|
/** Drag the panel toward its edge to dismiss (drawer types only). Defaults to true for drawers.
|
|
49
119
|
* Direction-aware, and never hijacks inner scrolling — a scrollable region that can still
|
|
50
|
-
* scroll along the drag axis keeps the gesture
|
|
120
|
+
* scroll along the drag axis keeps the gesture (right-to-left scrollers included), and so
|
|
121
|
+
* does a drag that travels more across the axis than along it. A flick dismisses on release
|
|
122
|
+
* speed alone. A mouse or pen drags only from the handles (the thumb and the header), so
|
|
123
|
+
* dragging over the body selects text; a finger drags from anywhere unless text is selected
|
|
124
|
+
* in the panel. Opt elements out with `data-no-swipe`. A dialog above another keeps the one
|
|
125
|
+
* beneath moving with its swipe. */
|
|
51
126
|
swipeToDismiss?: boolean;
|
|
52
127
|
/** Show the drag thumb bar on swipe-dismissable drawers; set false to hide. Default true. */
|
|
53
128
|
thumb?: boolean;
|
|
54
|
-
/** Where a swipe can start: the whole panel (`panel`, default) or only the drag
|
|
55
|
-
* (`handle` — the thumb and the header). */
|
|
129
|
+
/** Where a finger swipe can start: the whole panel (`panel`, default) or only the drag
|
|
130
|
+
* handles (`handle` — the thumb and the header). A mouse or pen always starts from a handle. */
|
|
56
131
|
swipeFrom?: 'panel' | 'handle';
|
|
57
132
|
/** How far a drawer stands off the screen edge: a spacing step or `'none'` for edge to edge.
|
|
58
133
|
* Defaults to the theme's `designTokens.drawerInset` (`'layout-md'`). At `'none'` the edge
|
|
59
134
|
* corners square off and only the corners facing the page keep their radius. */
|
|
60
135
|
inset?: SpacingStep | 'none';
|
|
136
|
+
/**
|
|
137
|
+
* Replaces the close button, or `false` to suppress the visible one. A closable dialog whose
|
|
138
|
+
* visible button is suppressed (`false`, or a snippet that renders nothing, as the Popover
|
|
139
|
+
* mobile sheet passes) still gets a visually hidden Close button at the end of the panel, so
|
|
140
|
+
* screen reader users have a control that closes it. An `alert` never gets one: its own
|
|
141
|
+
* buttons answer it.
|
|
142
|
+
*/
|
|
143
|
+
closeButton?: Slot | false;
|
|
61
144
|
/** Additional CSS classes merged onto the portaled dialog root element. */
|
|
62
145
|
class?: string;
|
|
63
146
|
/** Per-instance theme overrides for dialog layout and styling class names. */
|
|
64
147
|
theme?: DialogThemeProps;
|
|
65
|
-
}, 'title' | 'description' | 'footer' | 'header'
|
|
148
|
+
}, 'title' | 'description' | 'footer' | 'header'>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DialogSnapPoint } from './dialog.props.js';
|
|
2
|
+
/** A snap point and how much of the drawer shows when it rests there, in px. */
|
|
3
|
+
export type ResolvedSnapPoint = {
|
|
4
|
+
/** The point as the consumer wrote it; this is what `snapPoint` and `onSnapPointChange` carry. */
|
|
5
|
+
point: DialogSnapPoint;
|
|
6
|
+
/** Height of the drawer that shows at this point, in px. */
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
/** What a snap point is measured against. */
|
|
10
|
+
export type SnapContext = {
|
|
11
|
+
/** Height in px the drawer may use: the positioner's content box. */
|
|
12
|
+
available: number;
|
|
13
|
+
/** Height of the viewport in px, for `vh` lengths. */
|
|
14
|
+
viewport: number;
|
|
15
|
+
/** Font size of the root element in px, for `rem` and `em` lengths. */
|
|
16
|
+
rem: number;
|
|
17
|
+
};
|
|
18
|
+
/** Release speed in px/ms from which a drag is a flick, the same rule as dismissing a drawer. */
|
|
19
|
+
export declare const FLICK_SPEED = 0.4;
|
|
20
|
+
/**
|
|
21
|
+
* The visible height of a snap point in px, `NaN` when it is not valid. A number is a fraction of
|
|
22
|
+
* the available height (above 0, at most 1); a string is a CSS length: `px`, `rem`, `em`, `%` (of
|
|
23
|
+
* the available height) or `vh`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function snapPointHeight(point: DialogSnapPoint, context: SnapContext): number;
|
|
26
|
+
/**
|
|
27
|
+
* The snap points as px heights, from the lowest to the highest. Invalid points are dropped, a
|
|
28
|
+
* point taller than the available room is clamped to it, and points that land on the same pixel
|
|
29
|
+
* keep the first one written.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSnapPoints(points: readonly DialogSnapPoint[] | undefined, context: SnapContext): ResolvedSnapPoint[];
|
|
32
|
+
/**
|
|
33
|
+
* Where a released drag rests. `height` is how much of the drawer shows when the pointer lifts and
|
|
34
|
+
* `velocity` its speed toward dismissal in px/ms (positive shrinks the drawer). A flick (at least
|
|
35
|
+
* `FLICK_SPEED`) carries the drawer to the next point in the direction it was thrown, past the
|
|
36
|
+
* lowest one to closed; a slower release rests at the nearest point, closed counting as a point
|
|
37
|
+
* with a height of 0. Without `allowClose`, closed is never the answer. Returns the index into
|
|
38
|
+
* `heights` (ascending), or `-1` to close. A tie keeps the drawer open and as large as possible.
|
|
39
|
+
*/
|
|
40
|
+
export declare function settleSnapIndex(heights: readonly number[], height: number, velocity: number, allowClose: boolean): number;
|