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.
Files changed (839) hide show
  1. package/README.md +1 -1
  2. package/dist/attachments/disclosurePanel.svelte.d.ts +84 -0
  3. package/dist/attachments/disclosurePanel.svelte.js +277 -0
  4. package/dist/attachments/portal.d.ts +17 -1
  5. package/dist/attachments/portal.js +39 -2
  6. package/dist/attachments/spinnerOverlay.svelte.js +12 -0
  7. package/dist/attachments/transitionSize.d.ts +6 -0
  8. package/dist/attachments/transitionSize.js +30 -0
  9. package/dist/components/AIAskUserQuestion/AIAskUserQuestion.svelte +131 -17
  10. package/dist/components/AIAskUserQuestion/AIAskUserQuestionFileStep.svelte +26 -6
  11. package/dist/components/AIAskUserQuestion/AIAskUserQuestionFileStep.svelte.d.ts +6 -0
  12. package/dist/components/AIAskUserQuestion/AIAskUserQuestionFooter.svelte +27 -53
  13. package/dist/components/AIAskUserQuestion/AIAskUserQuestionFooter.svelte.d.ts +3 -4
  14. package/dist/components/AIAskUserQuestion/AIAskUserQuestionHeader.svelte +19 -16
  15. package/dist/components/AIAskUserQuestion/AIAskUserQuestionStep.svelte +180 -21
  16. package/dist/components/AIAskUserQuestion/AIAskUserQuestionStep.svelte.d.ts +9 -1
  17. package/dist/components/AIAskUserQuestion/AIAskUserQuestionSummary.svelte +56 -0
  18. package/dist/components/AIAskUserQuestion/AIAskUserQuestionSummary.svelte.d.ts +4 -0
  19. package/dist/components/AIAskUserQuestion/aiAskUserQuestion.mcp.d.ts +1 -1
  20. package/dist/components/AIAskUserQuestion/aiAskUserQuestion.mcp.js +26 -8
  21. package/dist/components/AIAskUserQuestion/aiAskUserQuestion.props.d.ts +62 -5
  22. package/dist/components/AIAskUserQuestion/aiAskUserQuestion.theme.d.ts +42 -0
  23. package/dist/components/AIAskUserQuestion/aiAskUserQuestion.theme.js +53 -12
  24. package/dist/components/AIAskUserQuestion/aiAskUserQuestionAnswers.d.ts +17 -1
  25. package/dist/components/AIAskUserQuestion/aiAskUserQuestionAnswers.js +56 -8
  26. package/dist/components/AIAskUserQuestion/index.d.ts +3 -1
  27. package/dist/components/AIAskUserQuestion/index.js +2 -0
  28. package/dist/components/AIAskUserQuestion/schemas.d.ts +44 -0
  29. package/dist/components/AIAskUserQuestion/schemas.js +10 -3
  30. package/dist/components/AIChat/AIChat.svelte +10 -0
  31. package/dist/components/AIChat/AIChat.svelte.d.ts +2 -2
  32. package/dist/components/AIChat/AIChatComposerSurface.svelte +23 -5
  33. package/dist/components/AIChat/AIChatComposerSurface.svelte.d.ts +5 -0
  34. package/dist/components/AIChat/AIChatSkeleton.svelte +29 -37
  35. package/dist/components/AIChat/AIChatSurface.svelte +30 -2
  36. package/dist/components/AIChat/AIChatSurface.svelte.d.ts +1 -1
  37. package/dist/components/AIChat/AIChatThreadSurface.svelte +11 -1
  38. package/dist/components/AIChat/AIChatThreadSurface.svelte.d.ts +3 -1
  39. package/dist/components/AIChat/aiChat.mcp.d.ts +1 -1
  40. package/dist/components/AIChat/aiChat.mcp.js +31 -15
  41. package/dist/components/AIChat/aiChat.props.d.ts +36 -10
  42. package/dist/components/AIChat/aiChat.theme.d.ts +9 -0
  43. package/dist/components/AIChat/aiChat.theme.js +21 -4
  44. package/dist/components/AIChat/aiChatSkeleton.props.d.ts +5 -0
  45. package/dist/components/AIChat/index.d.ts +1 -1
  46. package/dist/components/AIComposer/AIComposer.svelte +102 -5
  47. package/dist/components/AIComposer/AIComposer.svelte.d.ts +1 -0
  48. package/dist/components/AIComposer/AIComposerFooter.svelte +54 -12
  49. package/dist/components/AIComposer/AIComposerFooter.svelte.d.ts +2 -0
  50. package/dist/components/AIComposer/AIComposerQueue.svelte +8 -3
  51. package/dist/components/AIComposer/aiComposer.editor.theme.js +13 -2
  52. package/dist/components/AIComposer/aiComposer.mcp.d.ts +1 -1
  53. package/dist/components/AIComposer/aiComposer.mcp.js +15 -7
  54. package/dist/components/AIComposer/aiComposer.props.d.ts +27 -7
  55. package/dist/components/AIComposer/aiComposer.theme.d.ts +42 -3
  56. package/dist/components/AIComposer/aiComposer.theme.js +37 -5
  57. package/dist/components/AIComposer/aiComposerFileController.svelte.d.ts +20 -0
  58. package/dist/components/AIComposer/aiComposerFileController.svelte.js +75 -9
  59. package/dist/components/AIComposer/aiComposerSourceAdapter.js +22 -4
  60. package/dist/components/AIComposer/aiComposerSubmitController.svelte.d.ts +12 -0
  61. package/dist/components/AIComposer/aiComposerSubmitController.svelte.js +16 -6
  62. package/dist/components/AIContext/AIContext.svelte +7 -3
  63. package/dist/components/AIContext/aiContext.mcp.d.ts +1 -1
  64. package/dist/components/AIContext/aiContext.mcp.js +1 -1
  65. package/dist/components/AIContext/aiContext.props.d.ts +4 -1
  66. package/dist/components/AIContext/aiContext.theme.d.ts +3 -0
  67. package/dist/components/AIContext/aiContext.theme.js +7 -2
  68. package/dist/components/AIConversation/AIConversation.svelte.d.ts +2 -2
  69. package/dist/components/AIFilePreview/aiFilePreview.theme.js +1 -1
  70. package/dist/components/AIMarker/AIMarker.svelte +2 -0
  71. package/dist/components/AIMarker/aiMarker.mcp.d.ts +1 -1
  72. package/dist/components/AIMarker/aiMarker.mcp.js +2 -0
  73. package/dist/components/AIMarker/aiMarker.props.d.ts +3 -0
  74. package/dist/components/AIMarker/aiMarker.theme.js +2 -2
  75. package/dist/components/AIMessage/AIMessage.svelte +38 -16
  76. package/dist/components/AIMessage/aiMessage.mcp.d.ts +1 -1
  77. package/dist/components/AIMessage/aiMessage.mcp.js +20 -6
  78. package/dist/components/AIMessage/aiMessage.props.d.ts +18 -2
  79. package/dist/components/AIMessage/aiMessage.theme.d.ts +51 -6
  80. package/dist/components/AIMessage/aiMessage.theme.js +91 -32
  81. package/dist/components/AIMessageActions/AIMessageActions.svelte +19 -9
  82. package/dist/components/AIMessageActions/aiMessageActions.mcp.d.ts +1 -1
  83. package/dist/components/AIMessageActions/aiMessageActions.mcp.js +11 -3
  84. package/dist/components/AIMessageActions/aiMessageActions.theme.js +36 -9
  85. package/dist/components/AIModelSelector/AIModelSelector.svelte +25 -10
  86. package/dist/components/AIModelSelector/aiModelSelector.mcp.d.ts +1 -1
  87. package/dist/components/AIModelSelector/aiModelSelector.mcp.js +1 -1
  88. package/dist/components/AIModelSelector/aiModelSelector.theme.d.ts +3 -0
  89. package/dist/components/AIModelSelector/aiModelSelector.theme.js +7 -3
  90. package/dist/components/AIReasoning/AIReasoning.svelte +135 -38
  91. package/dist/components/AIReasoning/aiReasoning.mcp.d.ts +1 -1
  92. package/dist/components/AIReasoning/aiReasoning.mcp.js +11 -5
  93. package/dist/components/AIReasoning/aiReasoning.props.d.ts +15 -4
  94. package/dist/components/AIReasoning/aiReasoning.theme.d.ts +45 -0
  95. package/dist/components/AIReasoning/aiReasoning.theme.js +47 -7
  96. package/dist/components/AISuggestion/AISuggestion.svelte +2 -1
  97. package/dist/components/AISuggestion/AISuggestions.svelte +2 -1
  98. package/dist/components/AISuggestion/aiSuggestion.mcp.d.ts +1 -1
  99. package/dist/components/AISuggestion/aiSuggestion.mcp.js +8 -1
  100. package/dist/components/AISuggestion/aiSuggestion.props.d.ts +4 -1
  101. package/dist/components/AISuggestion/aiSuggestion.theme.js +1 -1
  102. package/dist/components/AISuggestion/aiSuggestions.props.d.ts +7 -0
  103. package/dist/components/AIThread/AIThread.svelte +378 -95
  104. package/dist/components/AIThread/AIThreadAskUserQuestion.svelte +1 -0
  105. package/dist/components/AIThread/AIThreadItems.svelte +266 -64
  106. package/dist/components/AIThread/AIThreadItems.svelte.d.ts +7 -3
  107. package/dist/components/AIThread/AIThreadMarker.svelte +8 -1
  108. package/dist/components/AIThread/AIThreadMarker.svelte.d.ts +1 -0
  109. package/dist/components/AIThread/aiThread.mcp.d.ts +1 -1
  110. package/dist/components/AIThread/aiThread.mcp.js +34 -20
  111. package/dist/components/AIThread/aiThread.props.d.ts +73 -8
  112. package/dist/components/AIThread/aiThread.theme.d.ts +78 -0
  113. package/dist/components/AIThread/aiThread.theme.js +108 -9
  114. package/dist/components/AIThread/index.d.ts +1 -1
  115. package/dist/components/AIThread/threadAskUserQuestion.d.ts +4 -1
  116. package/dist/components/AIThread/threadAskUserQuestion.js +8 -4
  117. package/dist/components/AIThread/threadRenderItems.d.ts +74 -3
  118. package/dist/components/AIThread/threadRenderItems.js +265 -77
  119. package/dist/components/AIThread/threadScrollController.d.ts +0 -8
  120. package/dist/components/AIThread/threadScrollController.js +2 -39
  121. package/dist/components/AIThread/threadTools.d.ts +11 -0
  122. package/dist/components/AIThread/threadTools.js +79 -0
  123. package/dist/components/AIThreadToc/AIThreadToc.svelte +188 -18
  124. package/dist/components/AIThreadToc/AIThreadTocPreview.svelte +25 -2
  125. package/dist/components/AIThreadToc/AIThreadTocPreview.svelte.d.ts +3 -0
  126. package/dist/components/AIThreadToc/aiThreadToc.d.ts +4 -2
  127. package/dist/components/AIThreadToc/aiThreadToc.js +17 -5
  128. package/dist/components/AIThreadToc/aiThreadToc.mcp.d.ts +1 -1
  129. package/dist/components/AIThreadToc/aiThreadToc.mcp.js +13 -3
  130. package/dist/components/AIThreadToc/aiThreadToc.props.d.ts +11 -0
  131. package/dist/components/AIThreadToc/aiThreadToc.theme.d.ts +3 -0
  132. package/dist/components/AIThreadToc/aiThreadToc.theme.js +15 -6
  133. package/dist/components/AITool/AITool.svelte +56 -21
  134. package/dist/components/AITool/AIToolCallList.svelte +79 -29
  135. package/dist/components/AITool/AIToolCallList.svelte.d.ts +6 -2
  136. package/dist/components/AITool/AIToolStatusMark.svelte +52 -0
  137. package/dist/components/AITool/AIToolStatusMark.svelte.d.ts +14 -0
  138. package/dist/components/AITool/AIToolValueSection.svelte +126 -28
  139. package/dist/components/AITool/AIToolValueSection.svelte.d.ts +6 -2
  140. package/dist/components/AITool/AIToolValueTree.svelte +11 -16
  141. package/dist/components/AITool/AIToolValueTree.svelte.d.ts +2 -3
  142. package/dist/components/AITool/aiTool.mcp.d.ts +1 -1
  143. package/dist/components/AITool/aiTool.mcp.js +36 -8
  144. package/dist/components/AITool/aiTool.props.d.ts +52 -6
  145. package/dist/components/AITool/aiTool.theme.d.ts +117 -39
  146. package/dist/components/AITool/aiTool.theme.js +144 -140
  147. package/dist/components/AITool/aiToolClock.svelte.d.ts +18 -0
  148. package/dist/components/AITool/aiToolClock.svelte.js +62 -0
  149. package/dist/components/AITool/aiToolPrimitiveThemes.d.ts +0 -2
  150. package/dist/components/AITool/aiToolPrimitiveThemes.js +0 -10
  151. package/dist/components/AITool/index.d.ts +2 -1
  152. package/dist/components/AITool/index.js +1 -0
  153. package/dist/components/AITool/toolRendering.d.ts +33 -1
  154. package/dist/components/AITool/toolRendering.js +179 -15
  155. package/dist/components/AITool/toolValueTree.d.ts +14 -1
  156. package/dist/components/AITool/toolValueTree.js +126 -27
  157. package/dist/components/Accordion/Accordion.svelte +109 -109
  158. package/dist/components/Accordion/Accordion.svelte.d.ts +0 -1
  159. package/dist/components/Accordion/AccordionPanel.svelte +64 -0
  160. package/dist/components/Accordion/AccordionPanel.svelte.d.ts +20 -0
  161. package/dist/components/Accordion/accordion.attributes.d.ts +24 -0
  162. package/dist/components/Accordion/accordion.attributes.js +20 -0
  163. package/dist/components/Accordion/accordion.mcp.d.ts +1 -1
  164. package/dist/components/Accordion/accordion.mcp.js +78 -22
  165. package/dist/components/Accordion/accordion.props.d.ts +54 -10
  166. package/dist/components/Accordion/accordion.theme.d.ts +3 -0
  167. package/dist/components/Accordion/accordion.theme.js +4 -0
  168. package/dist/components/Accordion/index.d.ts +1 -0
  169. package/dist/components/Accordion/index.js +1 -0
  170. package/dist/components/AudioPlayer/audioPlayerVolumeControl.slider.theme.d.ts +31 -1
  171. package/dist/components/Avatar/Avatar.svelte +60 -10
  172. package/dist/components/Avatar/AvatarGroup.svelte +9 -0
  173. package/dist/components/Avatar/avatar.mcp.d.ts +1 -1
  174. package/dist/components/Avatar/avatar.mcp.js +13 -5
  175. package/dist/components/Avatar/avatar.props.d.ts +28 -1
  176. package/dist/components/Avatar/avatar.theme.js +3 -3
  177. package/dist/components/Avatar/index.d.ts +1 -1
  178. package/dist/components/Breadcrumbs/breadcrumbs.mcp.d.ts +1 -1
  179. package/dist/components/Breadcrumbs/breadcrumbs.mcp.js +1 -1
  180. package/dist/components/Button/Button.svelte +35 -15
  181. package/dist/components/Button/button.mcp.d.ts +1 -1
  182. package/dist/components/Button/button.mcp.js +8 -4
  183. package/dist/components/Button/button.props.d.ts +23 -8
  184. package/dist/components/Button/button.theme.d.ts +12 -0
  185. package/dist/components/Button/button.theme.js +17 -4
  186. package/dist/components/ButtonGroup/buttonGroup.mcp.d.ts +1 -1
  187. package/dist/components/ButtonGroup/buttonGroup.mcp.js +1 -1
  188. package/dist/components/ButtonGroup/buttonGroup.props.d.ts +4 -1
  189. package/dist/components/Collapsible/Collapsible.svelte +125 -19
  190. package/dist/components/Collapsible/collapsible.attributes.d.ts +21 -0
  191. package/dist/components/Collapsible/collapsible.attributes.js +17 -0
  192. package/dist/components/Collapsible/collapsible.mcp.d.ts +1 -1
  193. package/dist/components/Collapsible/collapsible.mcp.js +62 -12
  194. package/dist/components/Collapsible/collapsible.props.d.ts +39 -8
  195. package/dist/components/Collapsible/collapsible.theme.js +3 -1
  196. package/dist/components/Collapsible/index.d.ts +1 -0
  197. package/dist/components/Collapsible/index.js +1 -0
  198. package/dist/components/Command/Command.svelte +56 -14
  199. package/dist/components/Command/command.mcp.d.ts +1 -1
  200. package/dist/components/Command/command.mcp.js +12 -6
  201. package/dist/components/Command/command.props.d.ts +39 -6
  202. package/dist/components/Command/command.state.svelte.d.ts +40 -11
  203. package/dist/components/Command/command.state.svelte.js +75 -28
  204. package/dist/components/Command/command.theme.js +4 -3
  205. package/dist/components/Confirmation/Confirmation.svelte +72 -31
  206. package/dist/components/Confirmation/confirmation.mcp.d.ts +1 -1
  207. package/dist/components/Confirmation/confirmation.mcp.js +5 -4
  208. package/dist/components/ContextMenu/ContextMenu.svelte +126 -16
  209. package/dist/components/ContextMenu/contextMenu.mcp.d.ts +1 -1
  210. package/dist/components/ContextMenu/contextMenu.mcp.js +10 -7
  211. package/dist/components/ContextMenu/contextMenu.props.d.ts +13 -4
  212. package/dist/components/ContextMenu/contextMenu.theme.d.ts +3 -3
  213. package/dist/components/ContextMenu/contextMenu.theme.js +3 -2
  214. package/dist/components/DataTable/DataTable.svelte +4 -9
  215. package/dist/components/DataTable/DataTableEditor.svelte +5 -0
  216. package/dist/components/DataTable/DataTableFilter.svelte +1 -0
  217. package/dist/components/DataTable/DataTableToolbar.svelte +1 -0
  218. package/dist/components/DataTable/dataTable.mcp.d.ts +1 -1
  219. package/dist/components/DataTable/dataTable.mcp.js +4 -2
  220. package/dist/components/DataTable/dataTable.theme.d.ts +0 -3
  221. package/dist/components/DataTable/dataTable.theme.js +9 -6
  222. package/dist/components/Dialog/Dialog.svelte +120 -35
  223. package/dist/components/Dialog/Dialog.svelte.d.ts +1 -1
  224. package/dist/components/Dialog/DialogBackdrop.svelte +21 -1
  225. package/dist/components/Dialog/dialog.api.d.ts +65 -0
  226. package/dist/components/Dialog/dialog.api.js +1 -0
  227. package/dist/components/Dialog/dialog.attributes.d.ts +23 -0
  228. package/dist/components/Dialog/dialog.attributes.js +19 -0
  229. package/dist/components/Dialog/dialog.indent.d.ts +6 -0
  230. package/dist/components/Dialog/dialog.indent.js +16 -0
  231. package/dist/components/Dialog/dialog.mcp.d.ts +1 -1
  232. package/dist/components/Dialog/dialog.mcp.js +195 -22
  233. package/dist/components/Dialog/dialog.props.d.ts +102 -19
  234. package/dist/components/Dialog/dialog.snap.d.ts +40 -0
  235. package/dist/components/Dialog/dialog.snap.js +78 -0
  236. package/dist/components/Dialog/dialog.state.svelte.d.ts +122 -10
  237. package/dist/components/Dialog/dialog.state.svelte.js +525 -66
  238. package/dist/components/Dialog/dialog.theme.d.ts +48 -0
  239. package/dist/components/Dialog/dialog.theme.js +32 -9
  240. package/dist/components/Dialog/index.d.ts +4 -1
  241. package/dist/components/Dialog/index.js +1 -0
  242. package/dist/components/DocumentViewer/DocumentSearchControl.svelte +5 -3
  243. package/dist/components/DocumentViewer/documentOutput.js +2 -1
  244. package/dist/components/FloatingWindow/FloatingWindow.svelte +20 -32
  245. package/dist/components/FloatingWindow/FloatingWindow.svelte.d.ts +1 -1
  246. package/dist/components/FloatingWindow/floatingWindow.mcp.d.ts +1 -1
  247. package/dist/components/FloatingWindow/floatingWindow.mcp.js +3 -3
  248. package/dist/components/FloatingWindow/floatingWindow.props.d.ts +9 -4
  249. package/dist/components/FloatingWindow/floatingWindow.state.svelte.d.ts +8 -2
  250. package/dist/components/FloatingWindow/floatingWindow.state.svelte.js +18 -7
  251. package/dist/components/Form/Ask/Ask.svelte +9 -13
  252. package/dist/components/Form/Ask/ask.mcp.d.ts +1 -1
  253. package/dist/components/Form/Ask/ask.mcp.js +1 -1
  254. package/dist/components/Form/Ask/ask.props.d.ts +1 -1
  255. package/dist/components/Form/Autocomplete/Autocomplete.svelte +418 -0
  256. package/dist/components/Form/Autocomplete/Autocomplete.svelte.d.ts +4 -0
  257. package/dist/components/Form/Autocomplete/autocomplete.items.d.ts +30 -0
  258. package/dist/components/Form/Autocomplete/autocomplete.items.js +64 -0
  259. package/dist/components/Form/Autocomplete/autocomplete.mcp.d.ts +1 -0
  260. package/dist/components/Form/Autocomplete/autocomplete.mcp.js +134 -0
  261. package/dist/components/Form/Autocomplete/autocomplete.props.d.ts +146 -0
  262. package/dist/components/Form/Autocomplete/autocomplete.props.js +1 -0
  263. package/dist/components/Form/Autocomplete/autocomplete.theme.d.ts +213 -0
  264. package/dist/components/Form/Autocomplete/autocomplete.theme.js +119 -0
  265. package/dist/components/Form/Autocomplete/index.d.ts +3 -0
  266. package/dist/components/Form/Autocomplete/index.js +2 -0
  267. package/dist/components/Form/Calendar/CalendarInput.svelte +9 -0
  268. package/dist/components/Form/Calendar/CalendarMonthYearPicker.svelte +3 -0
  269. package/dist/components/Form/Calendar/CalendarPrimitive.svelte +5 -0
  270. package/dist/components/Form/Calendar/calendar.mcp.d.ts +1 -1
  271. package/dist/components/Form/Calendar/calendar.mcp.js +2 -1
  272. package/dist/components/Form/Calendar/calendarInput.props.d.ts +2 -0
  273. package/dist/components/Form/Calendar/useCalendar.svelte.d.ts +3 -0
  274. package/dist/components/Form/Calendar/useCalendar.svelte.js +3 -0
  275. package/dist/components/Form/Checkbox/Checkbox.svelte +17 -2
  276. package/dist/components/Form/Checkbox/checkbox.mcp.d.ts +1 -1
  277. package/dist/components/Form/Checkbox/checkbox.mcp.js +11 -1
  278. package/dist/components/Form/Checkbox/checkbox.props.d.ts +12 -1
  279. package/dist/components/Form/CheckboxesInput/CheckboxLine.svelte +69 -32
  280. package/dist/components/Form/CheckboxesInput/CheckboxLine.svelte.d.ts +10 -2
  281. package/dist/components/Form/CheckboxesInput/CheckboxesInput.svelte +123 -74
  282. package/dist/components/Form/CheckboxesInput/CheckboxesInput.svelte.d.ts +12 -12
  283. package/dist/components/Form/CheckboxesInput/checkboxesInput.mcp.d.ts +1 -1
  284. package/dist/components/Form/CheckboxesInput/checkboxesInput.mcp.js +11 -7
  285. package/dist/components/Form/CheckboxesInput/checkboxesInput.props.d.ts +25 -9
  286. package/dist/components/Form/CheckboxesInput/checkboxesInput.theme.d.ts +12 -0
  287. package/dist/components/Form/CheckboxesInput/checkboxesInput.theme.js +9 -4
  288. package/dist/components/Form/CheckboxesInput/choiceEnter.d.ts +11 -0
  289. package/dist/components/Form/CheckboxesInput/choiceEnter.js +27 -0
  290. package/dist/components/Form/ColorInput/ColorInput.svelte +12 -3
  291. package/dist/components/Form/ColorInput/colorInput.mcp.d.ts +1 -1
  292. package/dist/components/Form/ColorInput/colorInput.mcp.js +1 -0
  293. package/dist/components/Form/ColorPicker/ColorPicker.svelte +11 -2
  294. package/dist/components/Form/ColorPicker/ColorPickerInput.svelte +9 -0
  295. package/dist/components/Form/ColorPicker/colorPicker.mcp.d.ts +1 -1
  296. package/dist/components/Form/ColorPicker/colorPicker.mcp.js +1 -0
  297. package/dist/components/Form/ColorPicker/colorPicker.props.d.ts +2 -0
  298. package/dist/components/Form/ColorPicker/colorPicker.state.svelte.d.ts +4 -0
  299. package/dist/components/Form/ColorPicker/colorPicker.state.svelte.js +12 -8
  300. package/dist/components/Form/Combobox/Combobox.svelte +145 -185
  301. package/dist/components/Form/Combobox/Combobox.svelte.d.ts +1 -1
  302. package/dist/components/Form/Combobox/ComboboxPopup.svelte +128 -0
  303. package/dist/components/Form/Combobox/ComboboxPopup.svelte.d.ts +28 -0
  304. package/dist/components/Form/Combobox/combobox.attributes.d.ts +34 -0
  305. package/dist/components/Form/Combobox/combobox.attributes.js +25 -0
  306. package/dist/components/Form/Combobox/combobox.items.d.ts +28 -0
  307. package/dist/components/Form/Combobox/combobox.items.js +68 -0
  308. package/dist/components/Form/Combobox/combobox.mcp.d.ts +1 -1
  309. package/dist/components/Form/Combobox/combobox.mcp.js +104 -13
  310. package/dist/components/Form/Combobox/combobox.props.d.ts +113 -19
  311. package/dist/components/Form/Combobox/combobox.state.svelte.d.ts +137 -0
  312. package/dist/components/Form/Combobox/combobox.state.svelte.js +375 -0
  313. package/dist/components/Form/Combobox/combobox.theme.d.ts +63 -0
  314. package/dist/components/Form/Combobox/combobox.theme.js +37 -1
  315. package/dist/components/Form/Combobox/index.d.ts +2 -1
  316. package/dist/components/Form/Combobox/index.js +1 -0
  317. package/dist/components/Form/DateInput/DateInput.svelte +11 -3
  318. package/dist/components/Form/DateInput/dateInput.mcp.d.ts +1 -1
  319. package/dist/components/Form/DateInput/dateInput.mcp.js +5 -0
  320. package/dist/components/Form/DateSelector/DateSelector.svelte +5 -2
  321. package/dist/components/Form/DateSelector/DateSelectorInput.svelte +9 -0
  322. package/dist/components/Form/DateSelector/dateSelector.mcp.d.ts +1 -1
  323. package/dist/components/Form/DateSelector/dateSelector.mcp.js +2 -2
  324. package/dist/components/Form/DateSelector/dateSelector.props.d.ts +2 -0
  325. package/dist/components/Form/Field/Field.svelte +256 -30
  326. package/dist/components/Form/Field/Field.svelte.d.ts +9 -0
  327. package/dist/components/Form/Field/FieldGroup.svelte +29 -0
  328. package/dist/components/Form/Field/FieldGroup.svelte.d.ts +11 -0
  329. package/dist/components/Form/Field/FieldHiddenInputs.svelte +187 -0
  330. package/dist/components/Form/Field/FieldHiddenInputs.svelte.d.ts +26 -0
  331. package/dist/components/Form/Field/field.d.ts +64 -8
  332. package/dist/components/Form/Field/field.mcp.d.ts +1 -1
  333. package/dist/components/Form/Field/field.mcp.js +158 -18
  334. package/dist/components/Form/Field/field.messages.d.ts +47 -0
  335. package/dist/components/Form/Field/field.messages.js +64 -0
  336. package/dist/components/Form/Field/field.state.svelte.d.ts +109 -3
  337. package/dist/components/Form/Field/field.state.svelte.js +508 -16
  338. package/dist/components/Form/Field/field.theme.d.ts +46 -0
  339. package/dist/components/Form/Field/field.theme.js +33 -0
  340. package/dist/components/Form/Field/fieldHiddenInputs.props.d.ts +61 -0
  341. package/dist/components/Form/Field/fieldHiddenInputs.props.js +1 -0
  342. package/dist/components/Form/Field/fieldNativeForm.svelte.d.ts +14 -0
  343. package/dist/components/Form/Field/fieldNativeForm.svelte.js +113 -0
  344. package/dist/components/Form/Field/index.d.ts +5 -2
  345. package/dist/components/Form/Field/index.js +1 -0
  346. package/dist/components/Form/Field/schemas.js +7 -2
  347. package/dist/components/Form/File/FileInput.svelte +24 -3
  348. package/dist/components/Form/File/fileInput.mcp.d.ts +1 -1
  349. package/dist/components/Form/File/fileInput.mcp.js +1 -0
  350. package/dist/components/Form/Form/Form.svelte +47 -14
  351. package/dist/components/Form/Form/FormActions.svelte +3 -1
  352. package/dist/components/Form/Form/FormActions.svelte.d.ts +42 -2
  353. package/dist/components/Form/Form/FormFieldRenderer.svelte +40 -2
  354. package/dist/components/Form/Form/FormInputRenderer.svelte +7 -0
  355. package/dist/components/Form/Form/form.d.ts +35 -6
  356. package/dist/components/Form/Form/form.mcp.d.ts +1 -1
  357. package/dist/components/Form/Form/form.mcp.js +113 -13
  358. package/dist/components/Form/Form/form.props.d.ts +32 -1
  359. package/dist/components/Form/Form/form.registry.d.ts +2 -2
  360. package/dist/components/Form/Form/form.registry.js +1 -4
  361. package/dist/components/Form/Form/form.state.svelte.d.ts +1138 -413
  362. package/dist/components/Form/Form/form.state.svelte.js +319 -26
  363. package/dist/components/Form/Form/index.d.ts +3 -1
  364. package/dist/components/Form/Form/visibility.d.ts +3096 -1831
  365. package/dist/components/Form/KeyValueInput/KeyValueInput.svelte +22 -10
  366. package/dist/components/Form/KeyValueInput/keyValueInput.mcp.d.ts +1 -1
  367. package/dist/components/Form/KeyValueInput/keyValueInput.mcp.js +1 -0
  368. package/dist/components/Form/MultiStepForm/MultiStepForm.svelte +12 -5
  369. package/dist/components/Form/MultiStepForm/multiStepForm.mcp.d.ts +1 -1
  370. package/dist/components/Form/MultiStepForm/multiStepForm.mcp.js +5 -3
  371. package/dist/components/Form/MultiStepForm/multiStepForm.props.d.ts +5 -0
  372. package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.d.ts +1022 -408
  373. package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.js +48 -24
  374. package/dist/components/Form/NumberInput/NumberInput.svelte +365 -46
  375. package/dist/components/Form/NumberInput/index.d.ts +1 -1
  376. package/dist/components/Form/NumberInput/numberInput.mcp.d.ts +1 -1
  377. package/dist/components/Form/NumberInput/numberInput.mcp.js +55 -30
  378. package/dist/components/Form/NumberInput/numberInput.props.d.ts +64 -4
  379. package/dist/components/Form/PasswordInput/Password.svelte +28 -1
  380. package/dist/components/Form/PasswordInput/index.d.ts +1 -1
  381. package/dist/components/Form/PasswordInput/passwordInput.mcp.d.ts +1 -1
  382. package/dist/components/Form/PasswordInput/passwordInput.mcp.js +20 -2
  383. package/dist/components/Form/PasswordInput/passwordInput.props.d.ts +23 -0
  384. package/dist/components/Form/PhoneInput/PhoneInput.svelte +11 -4
  385. package/dist/components/Form/PhoneInput/PhoneInputCountryPicker.svelte +47 -21
  386. package/dist/components/Form/PhoneInput/phoneInput-cdn.js +2 -1
  387. package/dist/components/Form/PhoneInput/phoneInput.mcp.d.ts +1 -1
  388. package/dist/components/Form/PhoneInput/phoneInput.mcp.js +6 -2
  389. package/dist/components/Form/PhoneInput/phoneInputCountry.d.ts +9 -3
  390. package/dist/components/Form/PhoneInput/phoneInputCountry.js +34 -24
  391. package/dist/components/Form/PinInput/PinInput.svelte +44 -9
  392. package/dist/components/Form/PinInput/PinInputCells.svelte +22 -1
  393. package/dist/components/Form/PinInput/PinInputCells.svelte.d.ts +1 -0
  394. package/dist/components/Form/PinInput/index.d.ts +1 -1
  395. package/dist/components/Form/PinInput/pinInput.mcp.d.ts +1 -1
  396. package/dist/components/Form/PinInput/pinInput.mcp.js +29 -6
  397. package/dist/components/Form/PinInput/pinInput.props.d.ts +38 -4
  398. package/dist/components/Form/PinInput/pinInput.state.svelte.d.ts +41 -0
  399. package/dist/components/Form/PinInput/pinInput.state.svelte.js +227 -24
  400. package/dist/components/Form/PinInput/pinInput.theme.d.ts +39 -3
  401. package/dist/components/Form/PinInput/pinInput.theme.js +27 -1
  402. package/dist/components/Form/RadioInput/RadioInput.svelte +94 -32
  403. package/dist/components/Form/RadioInput/RadioInput.svelte.d.ts +12 -12
  404. package/dist/components/Form/RadioInput/radioInput.mcp.d.ts +1 -1
  405. package/dist/components/Form/RadioInput/radioInput.mcp.js +12 -9
  406. package/dist/components/Form/RadioInput/radioInput.props.d.ts +22 -6
  407. package/dist/components/Form/RadioInput/radioInput.theme.d.ts +12 -0
  408. package/dist/components/Form/RadioInput/radioInput.theme.js +10 -5
  409. package/dist/components/Form/RatingInput/RatingInput.svelte +13 -4
  410. package/dist/components/Form/RatingInput/ratingInput.mcp.d.ts +1 -1
  411. package/dist/components/Form/RatingInput/ratingInput.mcp.js +3 -3
  412. package/dist/components/Form/RatingInput/ratingInput.props.d.ts +1 -1
  413. package/dist/components/Form/Select/Select.svelte +186 -48
  414. package/dist/components/Form/Select/Select.svelte.d.ts +23 -2
  415. package/dist/components/Form/Select/SelectOptionRow.svelte +69 -0
  416. package/dist/components/Form/Select/SelectOptionRow.svelte.d.ts +18 -0
  417. package/dist/components/Form/Select/index.d.ts +2 -1
  418. package/dist/components/Form/Select/index.js +1 -0
  419. package/dist/components/Form/Select/select.align.d.ts +5 -0
  420. package/dist/components/Form/Select/select.align.js +19 -5
  421. package/dist/components/Form/Select/select.attributes.d.ts +36 -0
  422. package/dist/components/Form/Select/select.attributes.js +27 -0
  423. package/dist/components/Form/Select/select.mcp.d.ts +1 -1
  424. package/dist/components/Form/Select/select.mcp.js +103 -18
  425. package/dist/components/Form/Select/select.props.d.ts +87 -10
  426. package/dist/components/Form/Select/select.state.svelte.d.ts +108 -17
  427. package/dist/components/Form/Select/select.state.svelte.js +354 -59
  428. package/dist/components/Form/Select/select.theme.d.ts +21 -0
  429. package/dist/components/Form/Select/select.theme.js +22 -0
  430. package/dist/components/Form/Slider/Slider.svelte +54 -14
  431. package/dist/components/Form/Slider/SliderMarks.svelte +1 -1
  432. package/dist/components/Form/Slider/SliderThumb.svelte +49 -19
  433. package/dist/components/Form/Slider/SliderThumb.svelte.d.ts +8 -2
  434. package/dist/components/Form/Slider/SliderTrack.svelte +33 -12
  435. package/dist/components/Form/Slider/SliderTrack.svelte.d.ts +6 -2
  436. package/dist/components/Form/Slider/index.d.ts +1 -1
  437. package/dist/components/Form/Slider/slider.mcp.d.ts +1 -1
  438. package/dist/components/Form/Slider/slider.mcp.js +55 -11
  439. package/dist/components/Form/Slider/slider.props.d.ts +35 -2
  440. package/dist/components/Form/Slider/slider.state.svelte.d.ts +66 -5
  441. package/dist/components/Form/Slider/slider.state.svelte.js +273 -49
  442. package/dist/components/Form/Slider/slider.theme.d.ts +36 -0
  443. package/dist/components/Form/Slider/slider.theme.js +35 -17
  444. package/dist/components/Form/Switch/Switch.svelte +61 -38
  445. package/dist/components/Form/Switch/switch.mcp.d.ts +1 -1
  446. package/dist/components/Form/Switch/switch.mcp.js +25 -5
  447. package/dist/components/Form/Switch/switch.props.d.ts +14 -1
  448. package/dist/components/Form/Switch/switch.theme.d.ts +12 -0
  449. package/dist/components/Form/Switch/switch.theme.js +8 -3
  450. package/dist/components/Form/TagGroup/TagGroup.svelte +8 -0
  451. package/dist/components/Form/TagGroup/tagGroup.mcp.d.ts +1 -1
  452. package/dist/components/Form/TagGroup/tagGroup.mcp.js +1 -0
  453. package/dist/components/Form/TagsInput/TagsInput.svelte +277 -275
  454. package/dist/components/Form/TagsInput/TagsInput.svelte.d.ts +1 -1
  455. package/dist/components/Form/TagsInput/tagsInput.mcp.d.ts +1 -1
  456. package/dist/components/Form/TagsInput/tagsInput.mcp.js +31 -11
  457. package/dist/components/Form/TagsInput/tagsInput.props.d.ts +6 -26
  458. package/dist/components/Form/TagsInput/tagsInput.theme.d.ts +63 -0
  459. package/dist/components/Form/TagsInput/tagsInput.theme.js +37 -1
  460. package/dist/components/Form/TextArea/TextArea.svelte +8 -0
  461. package/dist/components/Form/TextArea/textArea.mcp.d.ts +1 -1
  462. package/dist/components/Form/TextArea/textArea.mcp.js +1 -0
  463. package/dist/components/Form/TextInput/TextInput.svelte +8 -1
  464. package/dist/components/Form/TextInput/textInput.mcp.d.ts +1 -1
  465. package/dist/components/Form/TextInput/textInput.mcp.js +5 -0
  466. package/dist/components/Form/TimeInput/TimeInput.svelte +9 -1
  467. package/dist/components/Form/TimeInput/timeInput.mcp.d.ts +1 -1
  468. package/dist/components/Form/TimeInput/timeInput.mcp.js +31 -0
  469. package/dist/components/Form/VoiceInput/VoiceInput.svelte +10 -2
  470. package/dist/components/Form/VoiceInput/voiceInput.mcp.d.ts +1 -1
  471. package/dist/components/Form/VoiceInput/voiceInput.mcp.js +1 -0
  472. package/dist/components/GanttChart/GanttDependencyControl.svelte +4 -4
  473. package/dist/components/HoverCard/HoverCard.svelte +100 -10
  474. package/dist/components/HoverCard/hoverCard.attributes.d.ts +33 -0
  475. package/dist/components/HoverCard/hoverCard.attributes.js +24 -0
  476. package/dist/components/HoverCard/hoverCard.mcp.d.ts +1 -1
  477. package/dist/components/HoverCard/hoverCard.mcp.js +61 -2
  478. package/dist/components/HoverCard/hoverCard.props.d.ts +19 -0
  479. package/dist/components/HoverCard/hoverCard.theme.d.ts +12 -0
  480. package/dist/components/HoverCard/hoverCard.theme.js +9 -2
  481. package/dist/components/HoverCard/index.d.ts +1 -0
  482. package/dist/components/HoverCard/index.js +1 -0
  483. package/dist/components/ImageGallery/imageGallery.state.svelte.d.ts +1 -1
  484. package/dist/components/ImageZoom/imageZoom.lightbox.js +40 -6
  485. package/dist/components/ImageZoom/imageZoom.mcp.d.ts +1 -1
  486. package/dist/components/ImageZoom/imageZoom.mcp.js +3 -3
  487. package/dist/components/ImageZoom/imageZoom.props.d.ts +10 -4
  488. package/dist/components/ImageZoom/imageZoom.state.svelte.d.ts +16 -4
  489. package/dist/components/ImageZoom/imageZoom.state.svelte.js +38 -9
  490. package/dist/components/Kanban/kanban.theme.js +7 -3
  491. package/dist/components/Layout/layoutSpacing.d.ts +2 -2
  492. package/dist/components/LinkPreview/LinkPreview.svelte +7 -1
  493. package/dist/components/LinkPreview/linkPreview.mcp.d.ts +1 -1
  494. package/dist/components/LinkPreview/linkPreview.mcp.js +4 -1
  495. package/dist/components/LinkPreview/linkPreview.props.d.ts +15 -0
  496. package/dist/components/LinkPreview/linkPreview.theme.d.ts +12 -0
  497. package/dist/components/LinkPreview/linkPreview.theme.js +9 -2
  498. package/dist/components/Map/maplibre-cdn.js +3 -2
  499. package/dist/components/Markdown/markdown.mcp.d.ts +1 -1
  500. package/dist/components/Markdown/markdown.mcp.js +2 -1
  501. package/dist/components/Markdown/markdown.theme.js +18 -9
  502. package/dist/components/MediaVolume/MediaVolumeControl.svelte +4 -3
  503. package/dist/components/Menu/Menu.svelte +3 -3
  504. package/dist/components/Menu/Menu.svelte.d.ts +1 -1
  505. package/dist/components/Menu/MenuCheckboxItem.svelte +87 -0
  506. package/dist/components/Menu/MenuCheckboxItem.svelte.d.ts +16 -0
  507. package/dist/components/Menu/MenuFloating.svelte +421 -74
  508. package/dist/components/Menu/MenuFloating.svelte.d.ts +1 -1
  509. package/dist/components/Menu/MenuMirroredIcon.svelte +9 -0
  510. package/dist/components/Menu/MenuMirroredIcon.svelte.d.ts +7 -0
  511. package/dist/components/Menu/MenuRadioGroup.svelte +102 -0
  512. package/dist/components/Menu/MenuRadioGroup.svelte.d.ts +18 -0
  513. package/dist/components/Menu/MenuSearchField.svelte +54 -0
  514. package/dist/components/Menu/MenuSearchField.svelte.d.ts +20 -0
  515. package/dist/components/Menu/MenuStacked.svelte +404 -158
  516. package/dist/components/Menu/MenuStacked.svelte.d.ts +1 -1
  517. package/dist/components/Menu/MenuStackedBackHeader.svelte +6 -1
  518. package/dist/components/Menu/index.d.ts +2 -1
  519. package/dist/components/Menu/index.js +1 -0
  520. package/dist/components/Menu/menu.attributes.d.ts +37 -0
  521. package/dist/components/Menu/menu.attributes.js +28 -0
  522. package/dist/components/Menu/menu.filter.svelte.d.ts +52 -0
  523. package/dist/components/Menu/menu.filter.svelte.js +143 -0
  524. package/dist/components/Menu/menu.mcp.d.ts +1 -1
  525. package/dist/components/Menu/menu.mcp.js +227 -17
  526. package/dist/components/Menu/menu.platform.d.ts +5 -0
  527. package/dist/components/Menu/menu.platform.js +11 -0
  528. package/dist/components/Menu/menu.props.d.ts +172 -9
  529. package/dist/components/Menu/menu.theme.d.ts +147 -0
  530. package/dist/components/Menu/menu.theme.js +101 -0
  531. package/dist/components/Menu/menuTree.d.ts +35 -1
  532. package/dist/components/Menu/menuTree.js +158 -1
  533. package/dist/components/MenuBar/menuBar.mcp.d.ts +1 -1
  534. package/dist/components/MenuBar/menuBar.mcp.js +4 -2
  535. package/dist/components/MenuBar/menuBar.state.svelte.js +28 -10
  536. package/dist/components/MenuOption/MenuOption.svelte +5 -1
  537. package/dist/components/MenuOption/menuOption.mcp.d.ts +1 -1
  538. package/dist/components/MenuOption/menuOption.mcp.js +8 -0
  539. package/dist/components/MenuOption/menuOption.props.d.ts +12 -0
  540. package/dist/components/MenuOption/menuOption.theme.d.ts +18 -0
  541. package/dist/components/MenuOption/menuOption.theme.js +24 -4
  542. package/dist/components/Mermaid/mermaid.mcp.d.ts +1 -1
  543. package/dist/components/Mermaid/mermaid.mcp.js +8 -8
  544. package/dist/components/Mermaid/mermaid.props.d.ts +3 -4
  545. package/dist/components/Mermaid/mermaid.state.svelte.d.ts +20 -19
  546. package/dist/components/Mermaid/mermaid.state.svelte.js +80 -243
  547. package/dist/components/Mermaid/mermaid.theme.js +26 -1
  548. package/dist/components/MetadataList/MetadataList.svelte.d.ts +1 -1
  549. package/dist/components/Meter/Meter.svelte +110 -24
  550. package/dist/components/Meter/Meter.svelte.d.ts +12 -12
  551. package/dist/components/Meter/meter.mcp.d.ts +1 -1
  552. package/dist/components/Meter/meter.mcp.js +23 -37
  553. package/dist/components/Meter/meter.props.d.ts +36 -44
  554. package/dist/components/NavigationMenu/NavigationMenu.svelte +181 -0
  555. package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +25 -0
  556. package/dist/components/NavigationMenu/NavigationMenuContent.svelte +141 -0
  557. package/dist/components/NavigationMenu/NavigationMenuContent.svelte.d.ts +13 -0
  558. package/dist/components/NavigationMenu/NavigationMenuTrigger.svelte +75 -0
  559. package/dist/components/NavigationMenu/NavigationMenuTrigger.svelte.d.ts +13 -0
  560. package/dist/components/NavigationMenu/index.d.ts +4 -0
  561. package/dist/components/NavigationMenu/index.js +3 -0
  562. package/dist/components/NavigationMenu/navigationMenu.attributes.d.ts +24 -0
  563. package/dist/components/NavigationMenu/navigationMenu.attributes.js +21 -0
  564. package/dist/components/NavigationMenu/navigationMenu.mcp.d.ts +1 -0
  565. package/dist/components/NavigationMenu/navigationMenu.mcp.js +138 -0
  566. package/dist/components/NavigationMenu/navigationMenu.props.d.ts +129 -0
  567. package/dist/components/NavigationMenu/navigationMenu.props.js +1 -0
  568. package/dist/components/NavigationMenu/navigationMenu.state.svelte.d.ts +163 -0
  569. package/dist/components/NavigationMenu/navigationMenu.state.svelte.js +721 -0
  570. package/dist/components/NavigationMenu/navigationMenu.theme.d.ts +326 -0
  571. package/dist/components/NavigationMenu/navigationMenu.theme.js +239 -0
  572. package/dist/components/Overlay/Overlay.svelte +19 -30
  573. package/dist/components/Overlay/index.d.ts +1 -0
  574. package/dist/components/Overlay/index.js +1 -0
  575. package/dist/components/Overlay/overlay.attributes.d.ts +16 -0
  576. package/dist/components/Overlay/overlay.attributes.js +14 -0
  577. package/dist/components/Overlay/overlay.mcp.d.ts +1 -1
  578. package/dist/components/Overlay/overlay.mcp.js +21 -3
  579. package/dist/components/Overlay/overlay.props.d.ts +8 -4
  580. package/dist/components/Popover/Popover.svelte +163 -52
  581. package/dist/components/Popover/Popover.svelte.d.ts +23 -2
  582. package/dist/components/Popover/PopoverSession.svelte +12 -0
  583. package/dist/components/Popover/PopoverSession.svelte.d.ts +7 -0
  584. package/dist/components/Popover/index.d.ts +10 -2
  585. package/dist/components/Popover/index.js +4 -1
  586. package/dist/components/Popover/popover.api.d.ts +83 -0
  587. package/dist/components/Popover/popover.api.js +1 -0
  588. package/dist/components/Popover/popover.attributes.d.ts +32 -0
  589. package/dist/components/Popover/popover.attributes.js +28 -0
  590. package/dist/components/Popover/popover.claims.d.ts +19 -0
  591. package/dist/components/Popover/popover.claims.js +45 -0
  592. package/dist/components/Popover/popover.mcp.d.ts +1 -1
  593. package/dist/components/Popover/popover.mcp.js +163 -31
  594. package/dist/components/Popover/popover.position.d.ts +226 -0
  595. package/dist/components/Popover/popover.position.js +402 -0
  596. package/dist/components/Popover/popover.props.d.ts +179 -24
  597. package/dist/components/Popover/popover.state.svelte.d.ts +169 -37
  598. package/dist/components/Popover/popover.state.svelte.js +1034 -194
  599. package/dist/components/Popover/popover.theme.d.ts +15 -0
  600. package/dist/components/Popover/popover.theme.js +27 -2
  601. package/dist/components/PopupMenu/PopupMenu.svelte +193 -22
  602. package/dist/components/PopupMenu/PopupMenu.svelte.d.ts +2 -2
  603. package/dist/components/PopupMenu/popupMenu.context.d.ts +42 -0
  604. package/dist/components/PopupMenu/popupMenu.context.js +52 -0
  605. package/dist/components/PopupMenu/popupMenu.mcp.d.ts +1 -1
  606. package/dist/components/PopupMenu/popupMenu.mcp.js +46 -6
  607. package/dist/components/PopupMenu/popupMenu.props.d.ts +29 -2
  608. package/dist/components/Progress/Progress.svelte +160 -0
  609. package/dist/components/Progress/Progress.svelte.d.ts +4 -0
  610. package/dist/components/Progress/index.d.ts +3 -0
  611. package/dist/components/Progress/index.js +2 -0
  612. package/dist/components/Progress/progress.mcp.d.ts +1 -0
  613. package/dist/components/Progress/progress.mcp.js +101 -0
  614. package/dist/components/Progress/progress.props.d.ts +79 -0
  615. package/dist/components/Progress/progress.props.js +1 -0
  616. package/dist/components/Progress/progress.theme.d.ts +129 -0
  617. package/dist/components/Progress/progress.theme.js +83 -0
  618. package/dist/components/ProgressCircle/ProgressCircle.svelte +51 -6
  619. package/dist/components/ProgressCircle/progressCircle.mcp.d.ts +1 -1
  620. package/dist/components/ProgressCircle/progressCircle.mcp.js +18 -4
  621. package/dist/components/ProgressCircle/progressCircle.props.d.ts +32 -2
  622. package/dist/components/ProgressCircle/progressCircle.theme.d.ts +15 -3
  623. package/dist/components/ProgressCircle/progressCircle.theme.js +7 -2
  624. package/dist/components/RichTextInput/RichTextInput.svelte +19 -1
  625. package/dist/components/RichTextInput/RichTextInputChrome.svelte +5 -1
  626. package/dist/components/RichTextInput/RichTextInputChrome.svelte.d.ts +2 -0
  627. package/dist/components/RichTextInput/RichTextInputViewport.svelte +3 -1
  628. package/dist/components/RichTextInput/RichTextInputViewport.svelte.d.ts +1 -0
  629. package/dist/components/RichTextInput/richTextInput.mcp.d.ts +1 -1
  630. package/dist/components/RichTextInput/richTextInput.mcp.js +1 -0
  631. package/dist/components/RichTextInput/suggestions.js +2 -0
  632. package/dist/components/ScrollArea/ScrollArea.svelte +166 -27
  633. package/dist/components/ScrollArea/index.d.ts +2 -1
  634. package/dist/components/ScrollArea/index.js +1 -0
  635. package/dist/components/ScrollArea/scrollArea.attributes.d.ts +25 -0
  636. package/dist/components/ScrollArea/scrollArea.attributes.js +21 -0
  637. package/dist/components/ScrollArea/scrollArea.mcp.d.ts +1 -1
  638. package/dist/components/ScrollArea/scrollArea.mcp.js +47 -3
  639. package/dist/components/ScrollArea/scrollArea.props.d.ts +33 -6
  640. package/dist/components/ScrollArea/scrollArea.svelte.d.ts +56 -12
  641. package/dist/components/ScrollArea/scrollArea.svelte.js +281 -71
  642. package/dist/components/ScrollArea/scrollArea.theme.js +5 -2
  643. package/dist/components/SegmentedControl/SegmentedControl.svelte +4 -3
  644. package/dist/components/SegmentedControl/segmentedControl.mcp.d.ts +1 -1
  645. package/dist/components/SegmentedControl/segmentedControl.mcp.js +3 -2
  646. package/dist/components/SelectionMenu/SelectionMenu.svelte +4 -2
  647. package/dist/components/Sidebar/SidebarAction.svelte +13 -3
  648. package/dist/components/Sidebar/SidebarAction.svelte.d.ts +2 -1
  649. package/dist/components/Sidebar/SidebarActivityBar.svelte +14 -7
  650. package/dist/components/Sidebar/SidebarFlyout.svelte +97 -0
  651. package/dist/components/Sidebar/SidebarFlyout.svelte.d.ts +32 -0
  652. package/dist/components/Sidebar/SidebarGroup.svelte +39 -15
  653. package/dist/components/Sidebar/SidebarMenuButton.svelte +6 -3
  654. package/dist/components/Sidebar/SidebarMenuItem.svelte +134 -31
  655. package/dist/components/Sidebar/SidebarMenuSubItem.svelte +30 -14
  656. package/dist/components/Sidebar/SidebarTreeNode.svelte +41 -61
  657. package/dist/components/Sidebar/index.d.ts +1 -0
  658. package/dist/components/Sidebar/index.js +1 -0
  659. package/dist/components/Sidebar/sidebar-position.d.ts +37 -2
  660. package/dist/components/Sidebar/sidebar-position.js +31 -2
  661. package/dist/components/Sidebar/sidebar.attributes.d.ts +33 -0
  662. package/dist/components/Sidebar/sidebar.attributes.js +29 -0
  663. package/dist/components/Sidebar/sidebar.mcp.d.ts +1 -1
  664. package/dist/components/Sidebar/sidebar.mcp.js +45 -10
  665. package/dist/components/Sidebar/sidebar.props.d.ts +28 -7
  666. package/dist/components/Sidebar/sidebar.theme.d.ts +51 -21
  667. package/dist/components/Sidebar/sidebar.theme.js +113 -62
  668. package/dist/components/Sidebar/sidebar.views.svelte.js +11 -18
  669. package/dist/components/Stepper/Stepper.svelte +2 -0
  670. package/dist/components/Stepper/stepper.mcp.d.ts +1 -1
  671. package/dist/components/Stepper/stepper.mcp.js +1 -0
  672. package/dist/components/Stepper/stepper.props.d.ts +5 -0
  673. package/dist/components/Stepper/stepper.state.svelte.d.ts +2 -0
  674. package/dist/components/Stepper/stepper.state.svelte.js +31 -12
  675. package/dist/components/Tabbar/Tabbar.svelte +55 -16
  676. package/dist/components/Tabbar/index.d.ts +1 -1
  677. package/dist/components/Tabbar/tabbar.mcp.d.ts +1 -1
  678. package/dist/components/Tabbar/tabbar.mcp.js +26 -9
  679. package/dist/components/Tabbar/tabbar.props.d.ts +34 -5
  680. package/dist/components/Tabbar/tabbar.selection.svelte.d.ts +79 -0
  681. package/dist/components/Tabbar/tabbar.selection.svelte.js +99 -0
  682. package/dist/components/TableOfContents/tableOfContents.state.svelte.js +9 -7
  683. package/dist/components/Tabs/Tabs.svelte +73 -16
  684. package/dist/components/Tabs/index.d.ts +2 -1
  685. package/dist/components/Tabs/tabs.direction.svelte.d.ts +25 -0
  686. package/dist/components/Tabs/tabs.direction.svelte.js +40 -0
  687. package/dist/components/Tabs/tabs.mcp.d.ts +1 -1
  688. package/dist/components/Tabs/tabs.mcp.js +22 -4
  689. package/dist/components/Tabs/tabs.props.d.ts +39 -12
  690. package/dist/components/Tabs/tabs.theme.js +3 -1
  691. package/dist/components/Theme/Theme.svelte +44 -27
  692. package/dist/components/Theme/helper.d.ts +16 -2
  693. package/dist/components/Theme/helper.js +46 -4
  694. package/dist/components/Theme/theme.mcp.d.ts +1 -1
  695. package/dist/components/Theme/theme.mcp.js +103 -0
  696. package/dist/components/Theme/theme.props.d.ts +16 -0
  697. package/dist/components/Theme/theme.state.svelte.d.ts +14 -1
  698. package/dist/components/Theme/theme.state.svelte.js +18 -1
  699. package/dist/components/Toast/Toast.svelte +184 -39
  700. package/dist/components/Toast/Toaster.svelte +14 -10
  701. package/dist/components/Toast/index.d.ts +1 -0
  702. package/dist/components/Toast/toast.mcp.d.ts +1 -1
  703. package/dist/components/Toast/toast.mcp.js +47 -6
  704. package/dist/components/Toast/toast.state.svelte.d.ts +172 -6
  705. package/dist/components/Toast/toast.state.svelte.js +513 -68
  706. package/dist/components/Toast/toast.theme.js +1 -1
  707. package/dist/components/ToggleButton/ToggleButton.svelte +23 -1
  708. package/dist/components/ToggleButton/toggleButton.mcp.d.ts +1 -1
  709. package/dist/components/ToggleButton/toggleButton.mcp.js +3 -1
  710. package/dist/components/ToggleButton/toggleButton.props.d.ts +13 -1
  711. package/dist/components/ToggleButton/toggleButton.theme.d.ts +12 -0
  712. package/dist/components/ToggleButton/toggleButton.theme.js +15 -3
  713. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.svelte +29 -9
  714. package/dist/components/ToggleButtonGroup/index.d.ts +1 -1
  715. package/dist/components/ToggleButtonGroup/toggleButtonGroup.mcp.d.ts +1 -1
  716. package/dist/components/ToggleButtonGroup/toggleButtonGroup.mcp.js +5 -2
  717. package/dist/components/ToggleButtonGroup/toggleButtonGroup.props.d.ts +19 -1
  718. package/dist/components/ToggleButtonGroup/toggleButtonGroup.theme.d.ts +12 -0
  719. package/dist/components/ToggleButtonGroup/toggleButtonGroup.theme.js +21 -2
  720. package/dist/components/ToggleMenu/ToggleMenu.svelte +57 -43
  721. package/dist/components/ToggleMenu/ToggleMenuGroup.svelte +1 -0
  722. package/dist/components/ToggleMenu/ToggleMenuMenu.svelte +9 -3
  723. package/dist/components/ToggleMenu/ToggleMenuRadioGroup.svelte +7 -2
  724. package/dist/components/ToggleMenu/toggleMenu.mcp.d.ts +1 -1
  725. package/dist/components/ToggleMenu/toggleMenu.mcp.js +3 -2
  726. package/dist/components/ToggleMenu/toggleMenu.props.d.ts +4 -1
  727. package/dist/components/Tooltip/Tooltip.svelte +4 -12
  728. package/dist/components/Tooltip/TooltipHost.svelte +136 -15
  729. package/dist/components/Tooltip/index.d.ts +1 -0
  730. package/dist/components/Tooltip/index.js +1 -0
  731. package/dist/components/Tooltip/tooltip.attachment.svelte.d.ts +5 -0
  732. package/dist/components/Tooltip/tooltip.attachment.svelte.js +215 -33
  733. package/dist/components/Tooltip/tooltip.attributes.d.ts +32 -0
  734. package/dist/components/Tooltip/tooltip.attributes.js +28 -0
  735. package/dist/components/Tooltip/tooltip.mcp.d.ts +1 -1
  736. package/dist/components/Tooltip/tooltip.mcp.js +111 -10
  737. package/dist/components/Tooltip/tooltip.props.d.ts +33 -2
  738. package/dist/components/Tooltip/tooltip.surface.d.ts +24 -0
  739. package/dist/components/Tooltip/tooltip.surface.js +42 -0
  740. package/dist/components/Tree/TreeContextMenuSurface.svelte +16 -3
  741. package/dist/components/Utils/BeforeHydratation.svelte +14 -3
  742. package/dist/components/Utils/BeforeHydratation.svelte.d.ts +2 -0
  743. package/dist/components/VideoPlayer/VideoPlayer.svelte.d.ts +1 -1
  744. package/dist/components/VideoPlayer/VideoPlayerSettings.svelte +2 -0
  745. package/dist/generated/componentAliases.d.ts +3 -0
  746. package/dist/generated/componentAliases.js +3 -0
  747. package/dist/generated/componentContract.d.ts +79 -34
  748. package/dist/generated/componentContract.js +225 -6
  749. package/dist/generated/componentMcpRegistry.js +6 -0
  750. package/dist/i18n/ar.js +107 -3
  751. package/dist/i18n/context.svelte.d.ts +6 -0
  752. package/dist/i18n/context.svelte.js +12 -0
  753. package/dist/i18n/de.js +101 -3
  754. package/dist/i18n/en.d.ts +91 -2
  755. package/dist/i18n/en.js +101 -3
  756. package/dist/i18n/es.js +101 -3
  757. package/dist/i18n/fr.js +101 -3
  758. package/dist/i18n/ja.js +101 -3
  759. package/dist/i18n/pt.js +101 -3
  760. package/dist/i18n/zh.js +101 -3
  761. package/dist/tailwind/geometry.js +7 -0
  762. package/dist/tailwind/global.js +31 -0
  763. package/dist/types/index.d.ts +1 -0
  764. package/dist/types/types.mcp.d.ts +1 -1
  765. package/dist/types/types.mcp.js +23 -0
  766. package/dist/utils/cspNonce.d.ts +16 -0
  767. package/dist/utils/cspNonce.js +39 -0
  768. package/dist/utils/cva/merge.d.ts +5 -1
  769. package/dist/utils/cva/merge.js +6 -4
  770. package/dist/utils/focus.d.ts +34 -0
  771. package/dist/utils/focus.js +93 -0
  772. package/dist/utils/focusHistory.d.ts +21 -0
  773. package/dist/utils/focusHistory.js +99 -0
  774. package/dist/utils/handlers.d.ts +7 -0
  775. package/dist/utils/handlers.js +14 -0
  776. package/dist/utils/hoverIntent.d.ts +42 -0
  777. package/dist/utils/hoverIntent.js +57 -0
  778. package/dist/utils/id.d.ts +7 -0
  779. package/dist/utils/id.js +15 -0
  780. package/dist/utils/layers.svelte.d.ts +32 -4
  781. package/dist/utils/layers.svelte.js +214 -21
  782. package/dist/utils/listFilter.d.ts +44 -0
  783. package/dist/utils/listFilter.js +130 -0
  784. package/dist/utils/match.d.ts +35 -0
  785. package/dist/utils/match.js +36 -0
  786. package/dist/utils/number.d.ts +126 -0
  787. package/dist/utils/number.js +401 -0
  788. package/dist/utils/openChange.d.ts +88 -0
  789. package/dist/utils/openChange.js +71 -0
  790. package/dist/utils/openLifecycle.svelte.d.ts +41 -0
  791. package/dist/utils/openLifecycle.svelte.js +134 -0
  792. package/dist/utils/pointerDrag.d.ts +10 -0
  793. package/dist/utils/pointerDrag.js +37 -2
  794. package/dist/utils/pragmaticDragAndDrop.d.ts +2 -1
  795. package/dist/utils/pragmaticDragAndDrop.js +8 -3
  796. package/dist/utils/range.d.ts +62 -0
  797. package/dist/utils/range.js +70 -0
  798. package/dist/utils/requestNativeSubmit.d.ts +17 -0
  799. package/dist/utils/requestNativeSubmit.js +47 -0
  800. package/dist/utils/safeArea.svelte.d.ts +10 -1
  801. package/dist/utils/safeArea.svelte.js +19 -11
  802. package/dist/utils/stateAttributes.d.ts +108 -0
  803. package/dist/utils/stateAttributes.js +78 -0
  804. package/dist/utils/swipeVelocity.d.ts +32 -0
  805. package/dist/utils/swipeVelocity.js +59 -0
  806. package/dist/utils/timer.svelte.d.ts +65 -2
  807. package/dist/utils/timer.svelte.js +159 -25
  808. package/dist/utils/trigger.d.ts +41 -0
  809. package/dist/utils/trigger.js +103 -0
  810. package/dist/utils/typeahead.d.ts +9 -0
  811. package/dist/utils/typeahead.js +21 -9
  812. package/dist/utils/useDndList.svelte.d.ts +1 -1
  813. package/dist/utils/useDndList.svelte.js +6 -23
  814. package/dist/utils/useFocusScope.svelte.d.ts +29 -0
  815. package/dist/utils/useFocusScope.svelte.js +189 -27
  816. package/dist/utils/useHoverAction.svelte.d.ts +44 -4
  817. package/dist/utils/useHoverAction.svelte.js +161 -51
  818. package/dist/utils/useKeyDown.svelte.d.ts +19 -2
  819. package/dist/utils/useKeyDown.svelte.js +19 -12
  820. package/dist/utils/useListNavigation.svelte.d.ts +94 -13
  821. package/dist/utils/useListNavigation.svelte.js +261 -35
  822. package/dist/utils/useLiveAnnouncer.svelte.d.ts +77 -2
  823. package/dist/utils/useLiveAnnouncer.svelte.js +119 -2
  824. package/dist/utils/useNavigation.svelte.d.ts +36 -3
  825. package/dist/utils/useNavigation.svelte.js +699 -332
  826. package/dist/utils/usePressAndHold.svelte.d.ts +38 -0
  827. package/dist/utils/usePressAndHold.svelte.js +191 -0
  828. package/dist/utils/useScrollLock.svelte.d.ts +20 -1
  829. package/dist/utils/useScrollLock.svelte.js +54 -13
  830. package/dist/utils/useSlidingIndicator.svelte.d.ts +2 -0
  831. package/dist/utils/useSlidingIndicator.svelte.js +27 -5
  832. package/dist/utils/useTabBridge.svelte.d.ts +20 -0
  833. package/dist/utils/useTabBridge.svelte.js +109 -0
  834. package/dist/utils/values.d.ts +15 -0
  835. package/dist/utils/values.js +49 -0
  836. package/package.json +31 -2
  837. package/dist/generated/componentMcpRegistry.d.ts +0 -142
  838. package/dist/utils/useDrag.svelte.d.ts +0 -11
  839. package/dist/utils/useDrag.svelte.js +0 -55
@@ -2,10 +2,19 @@
2
2
  import { Tabbar } from '../Tabbar/index.js';
3
3
  import { Stepper } from '../Stepper/index.js';
4
4
  import { getTabValue, type TabItem } from '../Tabbar/tabbar.props.js';
5
+ import {
6
+ getDefaultTabValue,
7
+ getTabValueOrigin,
8
+ isTabDisabled,
9
+ useTabSelection
10
+ } from '../Tabbar/tabbar.selection.svelte.js';
5
11
  import { StepperState } from '../Stepper/stepper.state.svelte.js';
6
- import type { TabsProps } from './tabs.props.js';
12
+ import { untrack } from 'svelte';
13
+ import type { TabsProps, TabsValueChangeReason } from './tabs.props.js';
7
14
  import { useTabsMotion, useTabsTheme } from './tabs.theme.js';
8
15
  import { createBindableValue } from '../../utils/state.svelte.js';
16
+ import { useDirection } from '../../utils/useDirection.svelte.js';
17
+ import { useActivationDirection } from './tabs.direction.svelte.js';
9
18
 
10
19
  let {
11
20
  items,
@@ -22,24 +31,61 @@
22
31
  children: panel,
23
32
  ...attachments
24
33
  }: TabsProps<Item> = $props();
34
+ const origin = untrack(() => getTabValueOrigin(value, defaultValue));
25
35
  const valueState = createBindableValue(
26
36
  () => value,
27
37
  (next) => {
28
38
  value = next;
29
39
  },
30
- () => defaultValue ?? (items[0] === undefined ? '' : getTabValue(items[0], 0))
40
+ () => defaultValue ?? getDefaultTabValue(items)
31
41
  );
32
42
 
33
43
  const id = $props.id();
34
44
  const tabValues = $derived(items.map(getTabValue));
35
- // Stepper works in indexes; Tabs speaks values. Map both ways here, once.
36
- const activeIndex = $derived(Math.max(0, tabValues.indexOf(valueState.value)));
45
+ const emitChange = (index: number, reason: TabsValueChangeReason) => {
46
+ onValueChange?.({ value: tabValues[index], item: items[index], index, reason });
47
+ };
48
+ // One effective selection drives both the tab list and the panels, so they always show the
49
+ // same tab, or none when the value names no tab.
50
+ const selection = useTabSelection({
51
+ items: () => items,
52
+ value: () => valueState.value,
53
+ origin,
54
+ onFallback: (next, { index, reason }) => {
55
+ valueState.value = next;
56
+ if (reason) emitChange(index, reason);
57
+ }
58
+ });
59
+ const activeIndex = $derived(selection.index);
60
+ /** The value the Tabbar shows: the resolved tab's, or the raw value when none resolves. */
61
+ const activeValue = $derived(tabValues[activeIndex] ?? valueState.value);
62
+ const isSelectable = (index: number) => index in items && !isTabDisabled(items[index]);
63
+ // Stepper works in indexes; Tabs speaks values. Map both ways here, once. The `api` handle
64
+ // cannot activate a disabled tab: the request is dropped and the panels stay put.
37
65
  const setActiveIndex = (index: number) => {
66
+ if (!isSelectable(index)) return;
38
67
  const next = tabValues[index];
39
- if (next !== undefined && next !== valueState.value) valueState.value = next;
68
+ if (next !== valueState.value) valueState.value = next;
69
+ };
70
+ const handleStepChange = (index: number) => {
71
+ if (index === activeIndex) {
72
+ emitChange(index, 'user');
73
+ return;
74
+ }
75
+ // `goTo` slides before it reports; slide back to the panel of the selected tab, or to no
76
+ // panel when no tab is selected.
77
+ api?.translate();
40
78
  };
41
- const emitChange = (index: number) => {
42
- onValueChange?.({ value: tabValues[index], item: items[index], index });
79
+ // `next` and `previous` step over disabled tabs, as the arrow keys do.
80
+ const stepToEnabledTab = (stepper: StepperState<Item>, direction: 1 | -1) => {
81
+ for (let index = activeIndex + direction; index in items; index += direction) {
82
+ if (isSelectable(index)) return stepper.goTo(index);
83
+ }
84
+ };
85
+ const bindApi = (stepper: StepperState<Item>) => {
86
+ stepper.next = () => stepToEnabledTab(stepper, 1);
87
+ stepper.previous = () => stepToEnabledTab(stepper, -1);
88
+ api = stepper;
43
89
  };
44
90
 
45
91
  const classes = $derived(useTabsTheme(theme));
@@ -54,21 +100,30 @@
54
100
  tabbar?.orientation ??
55
101
  (placement === 'left' || placement === 'right' ? 'vertical' : 'horizontal')
56
102
  );
57
-
58
- function handleTabChange(nextValue: string) {
59
- emitChange(tabValues.indexOf(nextValue));
60
- }
103
+ let root = $state<HTMLElement | null>(null);
104
+ const direction = useDirection(() => root);
105
+ const activationDirection = useActivationDirection({
106
+ index: () => activeIndex,
107
+ orientation: () => effectiveTabbarOrientation,
108
+ direction
109
+ });
61
110
  </script>
62
111
 
63
- <div class={classes.root({ placement, className })} {...attachments}>
112
+ <div
113
+ bind:this={root}
114
+ class={classes.root({ placement, className })}
115
+ data-activation-direction={activationDirection.value}
116
+ {...attachments}
117
+ >
64
118
  <Tabbar
65
119
  id={`${id}-tabs`}
66
120
  controlsPanels
67
121
  fullWidth={tabbar?.fullWidth}
68
122
  label={tabbar?.label}
69
- onValueChange={handleTabChange}
123
+ onValueChange={({ value: next, reason }) => emitChange(tabValues.indexOf(next), reason)}
124
+ activateOnFocus={tabbar?.activateOnFocus}
70
125
  {items}
71
- bind:value={valueState.value}
126
+ bind:value={() => activeValue, (next) => (valueState.value = next)}
72
127
  size={tabbar?.size}
73
128
  orientation={effectiveTabbarOrientation}
74
129
  color={tabbar?.color}
@@ -81,15 +136,17 @@
81
136
  />
82
137
  <Stepper
83
138
  class={classes.content({ placement })}
84
- bind:api
139
+ bind:api={() => api, bindApi}
85
140
  {items}
86
141
  bind:value={() => activeIndex, setActiveIndex}
87
- onValueChange={({ value: index }) => emitChange(index)}
142
+ onValueChange={({ value: index }) => handleStepChange(index)}
88
143
  panelRole="tabpanel"
89
144
  panelId={(index) => `${id}-tabs-panel-${index}`}
90
145
  panelAriaLabelledby={({ index }) => `${id}-tabs-tab-${index}`}
91
146
  transition={panelTransition}
92
147
  {mount}
148
+ panelActivationDirection={(index) =>
149
+ index === activeIndex ? activationDirection.value : undefined}
93
150
  >
94
151
  {#snippet children(payload)}
95
152
  {@render panel?.(payload)}
@@ -1,3 +1,4 @@
1
1
  export { default as Tabs } from './Tabs.svelte';
2
- export type { TabsApi, TabsProps, TabsPlacement, TabsRenderPayload } from './tabs.props.js';
2
+ export type { TabsApi, TabsProps, TabsPlacement, TabsRenderPayload, TabsValueChangePayload, TabsValueChangeReason } from './tabs.props.js';
3
+ export type { TabsActivationDirection } from './tabs.direction.svelte.js';
3
4
  export { tabsTheme, setTabsTheme, useTabsTheme, type TabsTheme, type TabsThemeProps } from './tabs.theme.js';
@@ -0,0 +1,25 @@
1
+ import type { Direction } from '../../utils/useDirection.svelte.js';
2
+ /**
3
+ * Where the active tab sits relative to the previously active one, along the tab list's axis:
4
+ * `left` or `right` for a horizontal list (mirrored in a right-to-left document), `up` or `down`
5
+ * for a vertical one, and `none` before the first change or when no tab is selected.
6
+ */
7
+ export type TabsActivationDirection = 'left' | 'right' | 'up' | 'down' | 'none';
8
+ /** The direction from `previous` to `next`; `none` when either is not a tab or they are equal. */
9
+ export declare const getActivationDirection: (previous: number, next: number, orientation: "horizontal" | "vertical", direction: Direction) => TabsActivationDirection;
10
+ type ActivationDirectionOptions = {
11
+ /** The index of the selected tab; -1 when none is. */
12
+ index: () => number;
13
+ orientation: () => 'horizontal' | 'vertical';
14
+ direction: () => Direction;
15
+ };
16
+ /**
17
+ * Tracks the activation direction across selection changes. It updates before the DOM does
18
+ * (`$effect.pre`), so the attribute and the new panel arrive in the same render, for a click, a
19
+ * key, `api` navigation and a parent changing a bound `value` alike. The direction persists
20
+ * until the next change and starts as `none`.
21
+ */
22
+ export declare const useActivationDirection: (options: ActivationDirectionOptions) => {
23
+ readonly value: TabsActivationDirection;
24
+ };
25
+ export {};
@@ -0,0 +1,40 @@
1
+ import { untrack } from 'svelte';
2
+ /** The direction from `previous` to `next`; `none` when either is not a tab or they are equal. */
3
+ export const getActivationDirection = (previous, next, orientation, direction) => {
4
+ if (previous < 0 || next < 0 || previous === next)
5
+ return 'none';
6
+ const forward = next > previous;
7
+ if (orientation === 'vertical')
8
+ return forward ? 'down' : 'up';
9
+ return forward === (direction === 'ltr') ? 'right' : 'left';
10
+ };
11
+ /**
12
+ * Tracks the activation direction across selection changes. It updates before the DOM does
13
+ * (`$effect.pre`), so the attribute and the new panel arrive in the same render, for a click, a
14
+ * key, `api` navigation and a parent changing a bound `value` alike. The direction persists
15
+ * until the next change and starts as `none`.
16
+ */
17
+ export const useActivationDirection = (options) => {
18
+ // -1 until a tab is selected, so the first selection has no direction.
19
+ let previous = untrack(options.index);
20
+ let current = $state('none');
21
+ $effect.pre(() => {
22
+ const next = options.index();
23
+ const orientation = options.orientation();
24
+ const direction = options.direction();
25
+ untrack(() => {
26
+ if (next === previous)
27
+ return;
28
+ // Losing the selection keeps the last direction and the last selected tab as reference.
29
+ if (next < 0)
30
+ return;
31
+ current = getActivationDirection(previous, next, orientation, direction);
32
+ previous = next;
33
+ });
34
+ });
35
+ return {
36
+ get value() {
37
+ return current;
38
+ }
39
+ };
40
+ };
@@ -1 +1 @@
1
- export declare const tabsDescription = "\n# Tabs Component\n\nTabs combines Tabbar navigation with Stepper-powered animated panels.\n\n## Usage\n\nUse items for the tab collection and a single children snippet for the repeated panel content. The snippet receives the instance handle as api, the current item, and the zero-based index. The active tab is addressed by its string value (an item's `value`, else its string label).\n\n<script lang=\"ts\">\n\timport { Tabs } from '$lib/components/Tabs';\n\n\tconst items = [\n\t\t{ value: 'overview', label: 'Overview', title: 'Overview', body: 'A summary of the current workspace.' },\n\t\t{ value: 'activity', label: 'Activity', title: 'Activity', body: 'Recent events and changes.' },\n\t\t{ value: 'settings', label: 'Settings', title: 'Settings', body: 'Configuration for this resource.' }\n\t];\n\tlet value = $state('overview');\n</script>\n\n<Tabs {items} bind:value tabbar={{ size: 'small', color: 'secondary', fullWidth: true }}>\n\t{#snippet children({ item, index, api })}\n\t\t<section class=\"space-y-3 p-6\">\n\t\t\t<p class=\"text-sm text-neutral/70\">Panel {index + 1}</p>\n\t\t\t<h2>{item.title}</h2>\n\t\t\t<p>{item.body}</p>\n\t\t\t<button onclick={() => api.goTo(0)}>Back to overview</button>\n\t\t</section>\n\t{/snippet}\n</Tabs>\n\n## Props\n\n- items: required array of TabItem values. Each item is used by Tabbar and passed to children as item. A string item is its own value; an object item resolves to its `value`, else its string label, else its index as a string.\n- children: repeated panel renderer called with { api, item, index }.\n- value: bindable string value of the active tab (defaults to the first tab's value).\n- defaultValue: initial active tab value when value is omitted.\n- onValueChange: called once per change with { value, item, index }; not called when the current tab is re-selected or when value is changed externally.\n- placement: top, bottom, left, or right. Also drives the default tabbar orientation.\n- api: bindable TabsApi (a StepperState) for next(), previous(), and goTo(index).\n- transition: panel swap timing override (`duration` in ms, `easing`); responsive, and it beats the `motion` theme slot.\n- tabbar: props forwarded to the inner Tabbar as one object \u2014 `{ size, orientation, color, alignment, fullWidth, variant, scrollFade, label, class, theme }`. `orientation` overrides the placement-derived default.\n- mount: when a panel's content is created \u2014 `lazy` (default) on first activation and destroyed when the tab is left, `once` on first activation and kept, `eager` for every panel up front. Inactive panels are `hidden` and `inert` in every mode.\n- class: extra classes for the root.\n- theme: theme overrides for the Tabs wrapper.\n\n## Composition Rules\n\n- Render panel content through children.\n- Put per-panel differences in the item data and branch inside children when needed.\n- Use value (a string) as the public controlled state; compare against item values, not indexes.\n- Use api only when external controls need programmatic navigation.\n\n## Structure\n\nTabs renders a Tabbar next to a Stepper. Tabbar owns the clickable tab controls; Stepper owns the animated panel track.\n\n## Accessibility\n\nTabs wires the tablist to its panels: every tab has an id (`{id}-tabs-tab-{index}`), `aria-selected`, and `aria-controls`; every panel renders with role=\"tabpanel\", id `{id}-tabs-panel-{index}`, and `aria-labelledby` pointing back at its tab. Inactive panels are `hidden`, inert and out of the tab order, so only the active panel reaches the text and accessibility layers.\n\n## Theme Parts\n\n- root: wrapper around the Tabbar and panel content.\n- content: Stepper wrapper for tab panels.\n\nThe theme supports the placement variant on root and content.\n\n## Motion\n\n- **motion** theme slot: one preset (no variants) for the panel swap; the resolved\n `{ in, out }` is forwarded to the inner Stepper's `transition`, where it wins.\n- Ladder: `<Theme components={{ tabs: { motion } }}>` \u2192 `setTabsTheme({ motion })` \u2192\n `theme.motion` \u2192 the `transition` prop. Reduced motion snaps between panels.\n";
1
+ export declare const tabsDescription = "\n# Tabs Component\n\nTabs combines Tabbar navigation with Stepper-powered animated panels.\n\n## Usage\n\nUse items for the tab collection and a single children snippet for the repeated panel content. The snippet receives the instance handle as api, the current item, and the zero-based index. The active tab is addressed by its string value (an item's `value`, else its string label).\n\n<script lang=\"ts\">\n\timport { Tabs } from '$lib/components/Tabs';\n\n\tconst items = [\n\t\t{ value: 'overview', label: 'Overview', title: 'Overview', body: 'A summary of the current workspace.' },\n\t\t{ value: 'activity', label: 'Activity', title: 'Activity', body: 'Recent events and changes.' },\n\t\t{ value: 'settings', label: 'Settings', title: 'Settings', body: 'Configuration for this resource.' }\n\t];\n\tlet value = $state('overview');\n</script>\n\n<Tabs {items} bind:value tabbar={{ size: 'small', color: 'secondary', fullWidth: true }}>\n\t{#snippet children({ item, index, api })}\n\t\t<section class=\"space-y-3 p-6\">\n\t\t\t<p class=\"text-sm text-neutral/70\">Panel {index + 1}</p>\n\t\t\t<h2>{item.title}</h2>\n\t\t\t<p>{item.body}</p>\n\t\t\t<button onclick={() => api.goTo(0)}>Back to overview</button>\n\t\t</section>\n\t{/snippet}\n</Tabs>\n\n## Props\n\n- items: required array of TabItem values. Each item is used by Tabbar and passed to children as item. A string item is its own value; an object item resolves to its `value`, else its string label, else its index as a string.\n- children: repeated panel renderer called with { api, item, index }.\n- value: bindable string value of the active tab (defaults to the first enabled tab's value).\n- defaultValue: initial active tab value when value is omitted.\n- onValueChange: called once per change with { value, item, index, reason } (`TabsValueChangePayload`). `reason` (`TabsValueChangeReason`) is `user` for a click, arrow key, menu entry or api navigation, and `initial`, `disabled` or `missing` for an automatic fallback (see Selection fallback). Not called when the current tab is re-selected or when value is changed externally.\n- placement: top, bottom, left, or right. Also drives the default tabbar orientation.\n- api: bindable TabsApi (a StepperState) for next(), previous(), and goTo(index). next() and previous() step over disabled tabs, as the arrow keys do; goTo() a disabled tab does nothing.\n- transition: panel swap timing override (`duration` in ms, `easing`); responsive, and it beats the `motion` theme slot.\n- tabbar: props forwarded to the inner Tabbar as one object \u2014 `{ size, orientation, color, alignment, fullWidth, variant, scrollFade, label, activateOnFocus, class, theme }`. `orientation` overrides the placement-derived default. `activateOnFocus: false` switches to manual activation (see below).\n- mount: when a panel's content is created \u2014 `lazy` (default) on first activation and destroyed when the tab is left, `once` on first activation and kept, `eager` for every panel up front. Inactive panels are `hidden` and `inert` in every mode.\n- class: extra classes for the root.\n- theme: theme overrides for the Tabs wrapper.\n\n## Selection fallback\n\nThe tab list and the panels always show the same tab. Tabs moves the selection by itself only when the change is its own; it then renders the new tab (also during SSR), writes its value back to value and calls onValueChange with the reason:\n\n- `initial`: on mount, defaultValue named a disabled or unknown tab; the first enabled tab is selected.\n- `disabled`: the selected tab became disabled; the first enabled tab is selected.\n- `missing`: the selected tab was removed from items; its nearest enabled neighbour is selected (the tab that moved into its place first, then the one before it).\n\nOmitting value and defaultValue selects the first enabled tab and reports nothing, including when items arrive after mount. A value the parent sets (on mount or later, by binding or by another control) is never rewritten: a value naming a disabled tab shows that tab, and a value naming no tab selects no tab and shows no panel until a tab with that value appears. When every tab is disabled, nothing can be selected instead, so a value naming one of them stays selected and an unknown value shows no panel.\n\n## Manual activation\n\nBy default the arrow keys select the tab they move to. With `tabbar={{ activateOnFocus: false }}` they only move focus, and Enter, Space or a click opens the tab. Since `mount` defaults to `lazy`, selecting on focus builds and destroys a whole panel on every keypress; manual activation builds only the panel you open (APG recommends it when panels are costly).\n\n## Activation direction\n\nTabs sets `data-activation-direction` on its root and on the active panel: where the active tab sits relative to the previously active one, along the tab list's axis. The value is `left` or `right` for a horizontal list (mirrored in a right-to-left document), `up` or `down` for a vertical one (`placement` left or right), and `none` until the selection first changes. A click, a key, `api` navigation and a change of the bound `value` all set it, in the same render as the new panel. Use it to style direction-aware panel animations, for example `[data-activation-direction='right'] [role='tabpanel']:not([hidden])`. It stays until the next change.\n\n## Composition Rules\n\n- Render panel content through children.\n- Put per-panel differences in the item data and branch inside children when needed.\n- Use value (a string) as the public controlled state; compare against item values, not indexes.\n- Use api only when external controls need programmatic navigation.\n\n## Structure\n\nTabs renders a Tabbar next to a Stepper. Tabbar owns the clickable tab controls; Stepper owns the animated panel track.\n\n## Accessibility\n\nTabs wires the tablist to its panels: every tab has an id (`{id}-tabs-tab-{index}`), `aria-selected`, and `aria-controls`; every panel renders with role=\"tabpanel\", id `{id}-tabs-panel-{index}`, and `aria-labelledby` pointing back at its tab. Inactive panels are `hidden`, inert and out of the tab order, so only the active panel reaches the text and accessibility layers.\n\n## Theme Parts\n\n- root: wrapper around the Tabbar and panel content.\n- content: Stepper wrapper for tab panels.\n\nThe theme supports the placement variant on root and content.\n\n## Motion\n\n- **motion** theme slot: one preset (no variants) for the panel swap; the resolved\n `{ in, out }` is forwarded to the inner Stepper's `transition`, where it wins.\n- Ladder: `<Theme components={{ tabs: { motion } }}>` \u2192 `setTabsTheme({ motion })` \u2192\n `theme.motion` \u2192 the `transition` prop. Reduced motion snaps between panels.\n";
@@ -33,17 +33,35 @@ Use items for the tab collection and a single children snippet for the repeated
33
33
 
34
34
  - items: required array of TabItem values. Each item is used by Tabbar and passed to children as item. A string item is its own value; an object item resolves to its \`value\`, else its string label, else its index as a string.
35
35
  - children: repeated panel renderer called with { api, item, index }.
36
- - value: bindable string value of the active tab (defaults to the first tab's value).
36
+ - value: bindable string value of the active tab (defaults to the first enabled tab's value).
37
37
  - defaultValue: initial active tab value when value is omitted.
38
- - onValueChange: called once per change with { value, item, index }; not called when the current tab is re-selected or when value is changed externally.
38
+ - onValueChange: called once per change with { value, item, index, reason } (\`TabsValueChangePayload\`). \`reason\` (\`TabsValueChangeReason\`) is \`user\` for a click, arrow key, menu entry or api navigation, and \`initial\`, \`disabled\` or \`missing\` for an automatic fallback (see Selection fallback). Not called when the current tab is re-selected or when value is changed externally.
39
39
  - placement: top, bottom, left, or right. Also drives the default tabbar orientation.
40
- - api: bindable TabsApi (a StepperState) for next(), previous(), and goTo(index).
40
+ - api: bindable TabsApi (a StepperState) for next(), previous(), and goTo(index). next() and previous() step over disabled tabs, as the arrow keys do; goTo() a disabled tab does nothing.
41
41
  - transition: panel swap timing override (\`duration\` in ms, \`easing\`); responsive, and it beats the \`motion\` theme slot.
42
- - tabbar: props forwarded to the inner Tabbar as one object — \`{ size, orientation, color, alignment, fullWidth, variant, scrollFade, label, class, theme }\`. \`orientation\` overrides the placement-derived default.
42
+ - tabbar: props forwarded to the inner Tabbar as one object — \`{ size, orientation, color, alignment, fullWidth, variant, scrollFade, label, activateOnFocus, class, theme }\`. \`orientation\` overrides the placement-derived default. \`activateOnFocus: false\` switches to manual activation (see below).
43
43
  - mount: when a panel's content is created — \`lazy\` (default) on first activation and destroyed when the tab is left, \`once\` on first activation and kept, \`eager\` for every panel up front. Inactive panels are \`hidden\` and \`inert\` in every mode.
44
44
  - class: extra classes for the root.
45
45
  - theme: theme overrides for the Tabs wrapper.
46
46
 
47
+ ## Selection fallback
48
+
49
+ The tab list and the panels always show the same tab. Tabs moves the selection by itself only when the change is its own; it then renders the new tab (also during SSR), writes its value back to value and calls onValueChange with the reason:
50
+
51
+ - \`initial\`: on mount, defaultValue named a disabled or unknown tab; the first enabled tab is selected.
52
+ - \`disabled\`: the selected tab became disabled; the first enabled tab is selected.
53
+ - \`missing\`: the selected tab was removed from items; its nearest enabled neighbour is selected (the tab that moved into its place first, then the one before it).
54
+
55
+ Omitting value and defaultValue selects the first enabled tab and reports nothing, including when items arrive after mount. A value the parent sets (on mount or later, by binding or by another control) is never rewritten: a value naming a disabled tab shows that tab, and a value naming no tab selects no tab and shows no panel until a tab with that value appears. When every tab is disabled, nothing can be selected instead, so a value naming one of them stays selected and an unknown value shows no panel.
56
+
57
+ ## Manual activation
58
+
59
+ By default the arrow keys select the tab they move to. With \`tabbar={{ activateOnFocus: false }}\` they only move focus, and Enter, Space or a click opens the tab. Since \`mount\` defaults to \`lazy\`, selecting on focus builds and destroys a whole panel on every keypress; manual activation builds only the panel you open (APG recommends it when panels are costly).
60
+
61
+ ## Activation direction
62
+
63
+ Tabs sets \`data-activation-direction\` on its root and on the active panel: where the active tab sits relative to the previously active one, along the tab list's axis. The value is \`left\` or \`right\` for a horizontal list (mirrored in a right-to-left document), \`up\` or \`down\` for a vertical one (\`placement\` left or right), and \`none\` until the selection first changes. A click, a key, \`api\` navigation and a change of the bound \`value\` all set it, in the same render as the new panel. Use it to style direction-aware panel animations, for example \`[data-activation-direction='right'] [role='tabpanel']:not([hidden])\`. It stays until the next change.
64
+
47
65
  ## Composition Rules
48
66
 
49
67
  - Render panel content through children.
@@ -9,6 +9,27 @@ import type { StepperMount } from '../Stepper/stepper.props.js';
9
9
  export type TabsPlacement = 'top' | 'bottom' | 'left' | 'right';
10
10
  /** Instance handle exposed by `bind:api` and by the repeated `children` snippet. */
11
11
  export type TabsApi<Item extends TabItem = TabItem> = StepperState<Item>;
12
+ /**
13
+ * Why the active tab changed.
14
+ * - `user`: a click, an arrow key, a menu entry or the `api` handle picked the tab.
15
+ * - `initial`: on mount, `defaultValue` named a disabled or unknown tab, so the first enabled tab
16
+ * was selected instead.
17
+ * - `disabled`: the selected tab became disabled, so the first enabled tab was selected.
18
+ * - `missing`: the selected tab was removed, so the enabled tab nearest to it was selected.
19
+ */
20
+ export type TabsValueChangeReason = 'user' | 'initial' | 'disabled' | 'missing';
21
+ /** Payload of Tabs' `onValueChange`. */
22
+ export type TabsValueChangePayload<Item extends TabItem = TabItem> = {
23
+ /** The new active tab's value. */
24
+ value: string;
25
+ item: Item;
26
+ index: number;
27
+ /**
28
+ * `user` for a click, arrow key, menu entry or `api` navigation; `initial`, `disabled` or
29
+ * `missing` when Tabs moved the selection to an enabled tab by itself.
30
+ */
31
+ reason: TabsValueChangeReason;
32
+ };
12
33
  export type TabsRenderPayload<Item extends TabItem = TabItem> = {
13
34
  api: TabsApi<Item>;
14
35
  item: Item;
@@ -23,20 +44,23 @@ export type TabsProps<Item extends TabItem = TabItem> = WithAttachments<{
23
44
  /**
24
45
  * The `value` of the active tab (a string item resolves to itself; objects use `value`,
25
46
  * else their string label, else their index). Bindable.
26
- * @default the first tab's value
47
+ * A value you set is never rewritten: one naming a disabled tab shows that tab and its
48
+ * panel, and one naming no tab selects no tab and shows no panel. When the selected tab is
49
+ * removed or disabled, Tabs selects its nearest enabled neighbour or the first enabled tab,
50
+ * writes it back here and reports it through `onValueChange` with its `reason`.
51
+ * @default the first enabled tab's value
27
52
  */
28
53
  value?: string;
29
- /** Initial active tab value when `value` is omitted. */
54
+ /**
55
+ * Initial active tab value when `value` is omitted. One that names a disabled or unknown
56
+ * tab selects the first enabled tab on mount, reported with reason `initial`.
57
+ */
30
58
  defaultValue?: string;
31
59
  /**
32
- * Callback function called when the active tab changes.
33
- * Receives the new tab's value and item.
60
+ * Called once per change of the active tab with `{ value, item, index, reason }`.
61
+ * Not called when the current tab is re-selected or when `value` is changed externally.
34
62
  */
35
- onValueChange?: (payload: {
36
- value: string;
37
- item: Item;
38
- index: number;
39
- }) => void;
63
+ onValueChange?: (payload: TabsValueChangePayload<Item>) => void;
40
64
  /**
41
65
  * The placement of the tabbar relative to the content.
42
66
  * @default 'top'
@@ -52,7 +76,8 @@ export type TabsProps<Item extends TabItem = TabItem> = WithAttachments<{
52
76
  theme?: TabsThemeProps;
53
77
  /**
54
78
  * Bindable instance handle for programmatic control.
55
- * Provides methods like next(), previous(), goTo(index).
79
+ * Provides methods like next(), previous(), goTo(index). `next` and `previous` step over
80
+ * disabled tabs; `goTo` a disabled tab does nothing.
56
81
  */
57
82
  api?: TabsApi<Item>;
58
83
  /**
@@ -62,9 +87,11 @@ export type TabsProps<Item extends TabItem = TabItem> = WithAttachments<{
62
87
  transition?: ResponsiveProps<FSOProps>;
63
88
  /**
64
89
  * Props forwarded to the inner Tabbar. `orientation` falls back to the value implied by
65
- * `placement` (vertical for `left`/`right`).
90
+ * `placement` (vertical for `left`/`right`). `activateOnFocus: false` switches to manual
91
+ * activation: the arrow keys only move focus, and Enter, Space or a click opens the tab, so
92
+ * arrowing across the list does not mount every lazy panel on the way.
66
93
  */
67
- tabbar?: Pick<TabbarProps, 'size' | 'orientation' | 'color' | 'alignment' | 'class' | 'theme' | 'fullWidth' | 'label' | 'variant' | 'scrollFade'>;
94
+ tabbar?: Pick<TabbarProps, 'size' | 'orientation' | 'color' | 'alignment' | 'class' | 'theme' | 'fullWidth' | 'label' | 'variant' | 'scrollFade' | 'activateOnFocus'>;
68
95
  /**
69
96
  * When each panel's content is created.
70
97
  * `lazy` creates a panel the first time it is activated and destroys it when it is left,
@@ -15,8 +15,10 @@ const defaultTabs = cva({
15
15
  placement: 'top'
16
16
  }
17
17
  });
18
+ // `my-md` keeps panel content off the tab list. It is a margin, not padding: the Stepper positions
19
+ // its panel track from the padding box, so padding on it would offset the panels.
18
20
  const defaultTabsContent = cva({
19
- base: 'w-full flex-full',
21
+ base: 'my-md w-full flex-full',
20
22
  variants: {
21
23
  placement: {
22
24
  top: 'w-full',
@@ -5,7 +5,7 @@
5
5
  import BeforeHydratation from '../Utils/BeforeHydratation.svelte';
6
6
  import { Theme as SvelteTheme } from 'svelte-themes';
7
7
  import { ThemeState } from './theme.state.svelte.js';
8
- import { compileThemeBlockingScript } from './helper.js';
8
+ import { compileThemeBlockingScript, compileViewportScript, disableAnimation } from './helper.js';
9
9
  import TooltipHost from '../Tooltip/TooltipHost.svelte';
10
10
  import DialogBackdrop from '../Dialog/DialogBackdrop.svelte';
11
11
  import type { ThemeProps } from './theme.props.js';
@@ -14,6 +14,8 @@
14
14
  import { compileThemeDesignTokens, type ThemeDesignTokens } from './theme.designTokens.js';
15
15
  import { mergeMotionTokens } from '../../tailwind/scales.js';
16
16
  import { REDUCED_MOTION_ATTRIBUTE, REDUCED_MOTION_QUERY } from '../../utils/motion.svelte.js';
17
+ import { untrack } from 'svelte';
18
+ import { installFocusHistory } from '../../utils/focusHistory.js';
17
19
 
18
20
  let {
19
21
  children,
@@ -32,7 +34,9 @@
32
34
  colorScheme,
33
35
  reduceMotion,
34
36
  motion,
35
- components
37
+ components,
38
+ nonce,
39
+ portalContainer
36
40
  }: ThemeProps<T> = $props();
37
41
 
38
42
  const validatedDefaultTheme = (() => {
@@ -83,10 +87,30 @@
83
87
  get storageKey() {
84
88
  return storageKey;
85
89
  },
86
- // `transitionOnChange` is the positive form of svelte-themes' `disableTransitionOnChange`.
87
- get disableTransitionOnChange() {
88
- return !transitionOnChange;
89
- }
90
+ // svelte-themes would inject its transition-suppressing style element without a nonce; the
91
+ // effects below do that part with the Theme `nonce`, around the same DOM update.
92
+ disableTransitionOnChange: false
93
+ });
94
+
95
+ // `transitionOnChange={false}` suppresses CSS transitions for the swap. The pre effect runs
96
+ // before svelte-themes applies the resolved theme (its effect was created first, in the
97
+ // constructor above) and the effect after it, so the style brackets the DOM update.
98
+ let restoreTransitions: (() => void) | null = null;
99
+ $effect.pre(() => {
100
+ void theme.resolvedTheme;
101
+ // `transitionOnChange` is read untracked: this effect must only re-run with a theme swap,
102
+ // because only the post effect below (which follows `resolvedTheme` alone) releases the
103
+ // style. Re-running on the prop would leave `*{transition:none!important}` in the head.
104
+ untrack(() => {
105
+ if (transitionOnChange) return;
106
+ restoreTransitions?.();
107
+ restoreTransitions = disableAnimation(nonce);
108
+ });
109
+ });
110
+ $effect(() => {
111
+ void theme.resolvedTheme;
112
+ restoreTransitions?.();
113
+ restoreTransitions = null;
90
114
  });
91
115
 
92
116
  const entasisTheme = new ThemeState(
@@ -114,6 +138,12 @@
114
138
  get componentThemes() {
115
139
  return components;
116
140
  },
141
+ get nonce() {
142
+ return nonce;
143
+ },
144
+ get portalContainer() {
145
+ return portalContainer;
146
+ },
117
147
  get defaultColor() {
118
148
  const resolved = theme.resolvedTheme;
119
149
  if (!resolved || !designTokens) return 'neutral';
@@ -126,6 +156,10 @@
126
156
  theme
127
157
  );
128
158
 
159
+ // Remember where focus has been, so a dialog whose opener left the page (a menu item) can hand
160
+ // focus to the last element that is still there.
161
+ $effect(() => installFocusHistory(document));
162
+
129
163
  // Mirror the resolved preference onto <html> so CSS-only animations (Marquee, Code)
130
164
  // can honour it. The blocking script below sets it before hydration so a
131
165
  // reduced-motion user never sees a first frame of animation.
@@ -162,7 +196,8 @@
162
196
  syncColorScheme,
163
197
  forcedTheme,
164
198
  defaultTheme: validatedDefaultTheme,
165
- attribute
199
+ attribute,
200
+ nonce
166
201
  })
167
202
  );
168
203
  </script>
@@ -170,27 +205,9 @@
170
205
  <BeforeHydratation
171
206
  immediate
172
207
  once
173
- scripts={[
174
- /* js */ `
175
- (() => {
176
- const visualViewport = window.visualViewport;
177
- const setWindowHeight = () => {
178
- const height = visualViewport?.height ?? window.innerHeight;
179
- document.documentElement.style.setProperty('--window-height', height + 'px');
180
- };
181
- const setWindowWidth = () => {
182
- document.documentElement.style.setProperty('--window-width', window.innerWidth + 'px');
183
- };
184
- window.addEventListener('resize', setWindowHeight);
185
- window.addEventListener('resize', setWindowWidth);
186
- visualViewport?.addEventListener('resize', setWindowHeight);
187
- setWindowHeight();
188
- setWindowWidth();
189
- })();
190
- `,
191
- reduceMotionScript
192
- ]}
208
+ scripts={[compileViewportScript(), reduceMotionScript]}
193
209
  css={[designTokenCss]}
210
+ {nonce}
194
211
  />
195
212
 
196
213
  <svelte:head>
@@ -1,4 +1,5 @@
1
- export declare const disableAnimation: () => () => void;
1
+ /** Suspends every CSS transition until the returned function runs; the style carries `nonce`. */
2
+ export declare const disableAnimation: (nonce?: string) => () => void;
2
3
  export declare const escapeForInlineScript: (json: unknown) => string;
3
4
  export declare const escapeJsString: (s: string) => string;
4
5
  export declare const MEDIA = "(prefers-color-scheme: dark)";
@@ -13,9 +14,22 @@ type ThemeBlockingScriptOptions = {
13
14
  forcedTheme?: string;
14
15
  defaultTheme: string;
15
16
  attribute: string;
17
+ /** The CSP nonce stamped on the emitted `<script>`. */
18
+ nonce?: string;
16
19
  };
17
20
  /** Blocking `<head>` script that applies the stored theme before first paint. */
18
- export declare const compileThemeBlockingScript: ({ value, colorScheme, themes, validThemes, storageKey, systemTheme, syncColorScheme, forcedTheme, defaultTheme, attribute }: ThemeBlockingScriptOptions) => string;
21
+ export declare const compileThemeBlockingScript: ({ value, colorScheme, themes, validThemes, storageKey, systemTheme, syncColorScheme, forcedTheme, defaultTheme, attribute, nonce }: ThemeBlockingScriptOptions) => string;
22
+ /** The custom property carrying how far the on-screen keyboard overlaps the layout viewport. */
23
+ export declare const KEYBOARD_INSET_VARIABLE = "--keyboard-inset";
24
+ /**
25
+ * Boot script that mirrors the viewport onto `<html>`: `--window-height` and `--window-width`,
26
+ * and `--keyboard-inset`, the px height the on-screen keyboard (or any other browser UI that
27
+ * shrinks only the visual viewport) covers at the bottom of the layout viewport, `0px` without
28
+ * one. A pinch zoom also shrinks the visual viewport, so the inset stays `0px` while it is
29
+ * zoomed. Browsers that resize the layout viewport for the keyboard report no overlap either.
30
+ * Written as a self-contained string because it runs before hydration.
31
+ */
32
+ export declare const compileViewportScript: () => string;
19
33
  export declare const colorSchemes: readonly ["light", "dark"];
20
34
  export type ColorScheme = (typeof colorSchemes)[number];
21
35
  export {};
@@ -1,6 +1,8 @@
1
+ import { applyCspNonce, nonceAttribute } from '../../utils/cspNonce.js';
1
2
  const ANIMATION_DELAY_MS = 1;
2
- export const disableAnimation = () => {
3
- const css = document.createElement('style');
3
+ /** Suspends every CSS transition until the returned function runs; the style carries `nonce`. */
4
+ export const disableAnimation = (nonce) => {
5
+ const css = applyCspNonce(document.createElement('style'), nonce);
4
6
  css.appendChild(document.createTextNode(`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`));
5
7
  document.head.appendChild(css);
6
8
  return () => {
@@ -25,7 +27,7 @@ export const escapeJsString = (s) => String(s)
25
27
  .replace(/\u2029/g, '\\u2029');
26
28
  export const MEDIA = '(prefers-color-scheme: dark)';
27
29
  /** Blocking `<head>` script that applies the stored theme before first paint. */
28
- export const compileThemeBlockingScript = ({ value, colorScheme, themes, validThemes, storageKey, systemTheme, syncColorScheme, forcedTheme, defaultTheme, attribute }) => {
30
+ export const compileThemeBlockingScript = ({ value, colorScheme, themes, validThemes, storageKey, systemTheme, syncColorScheme, forcedTheme, defaultTheme, attribute, nonce }) => {
29
31
  const classNames = !value ? [...(themes ?? [])] : Object.values(value);
30
32
  const escapedDefaultTheme = escapeJsString(defaultTheme);
31
33
  const escapedStorageKey = escapeJsString(storageKey);
@@ -44,7 +46,7 @@ export const compileThemeBlockingScript = ({ value, colorScheme, themes, validTh
44
46
  const applyStmt = attribute === 'class'
45
47
  ? `d.classList.add(val);`
46
48
  : `d.setAttribute('${escapeJsString(attribute)}', val);`;
47
- return `<script>
49
+ return `<script${nonceAttribute(nonce)}>
48
50
  function svelteTheme(){
49
51
  var d=document.documentElement;
50
52
  var x=${escapeForInlineScript(value || {})};
@@ -69,4 +71,44 @@ export const compileThemeBlockingScript = ({ value, colorScheme, themes, validTh
69
71
  };svelteTheme();
70
72
  </script>`;
71
73
  };
74
+ /** The custom property carrying how far the on-screen keyboard overlaps the layout viewport. */
75
+ export const KEYBOARD_INSET_VARIABLE = '--keyboard-inset';
76
+ /**
77
+ * Boot script that mirrors the viewport onto `<html>`: `--window-height` and `--window-width`,
78
+ * and `--keyboard-inset`, the px height the on-screen keyboard (or any other browser UI that
79
+ * shrinks only the visual viewport) covers at the bottom of the layout viewport, `0px` without
80
+ * one. A pinch zoom also shrinks the visual viewport, so the inset stays `0px` while it is
81
+ * zoomed. Browsers that resize the layout viewport for the keyboard report no overlap either.
82
+ * Written as a self-contained string because it runs before hydration.
83
+ */
84
+ export const compileViewportScript = () => /* js */ `
85
+ (() => {
86
+ const visualViewport = window.visualViewport;
87
+ const root = document.documentElement;
88
+ const setWindowHeight = () => {
89
+ const height = visualViewport?.height ?? window.innerHeight;
90
+ root.style.setProperty('--window-height', height + 'px');
91
+ };
92
+ const setWindowWidth = () => {
93
+ root.style.setProperty('--window-width', window.innerWidth + 'px');
94
+ };
95
+ const setKeyboardInset = () => {
96
+ const zoomed = !!visualViewport && Math.abs(visualViewport.scale - 1) > 0.01;
97
+ const inset =
98
+ visualViewport && !zoomed
99
+ ? Math.max(0, Math.round(window.innerHeight - visualViewport.height - visualViewport.offsetTop))
100
+ : 0;
101
+ root.style.setProperty('${KEYBOARD_INSET_VARIABLE}', inset + 'px');
102
+ };
103
+ window.addEventListener('resize', setWindowHeight);
104
+ window.addEventListener('resize', setWindowWidth);
105
+ window.addEventListener('resize', setKeyboardInset);
106
+ visualViewport?.addEventListener('resize', setWindowHeight);
107
+ visualViewport?.addEventListener('resize', setKeyboardInset);
108
+ visualViewport?.addEventListener('scroll', setKeyboardInset);
109
+ setWindowHeight();
110
+ setWindowWidth();
111
+ setKeyboardInset();
112
+ })();
113
+ `;
72
114
  export const colorSchemes = ['light', 'dark'];