@lilydesignsystem/svelte-headless 0.6.0 → 0.6.2

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 (282) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/LICENSE.md +8 -8
  3. package/README.md +4 -4
  4. package/dist/components/AccordionLink/AccordionLink.svelte +12 -2
  5. package/dist/components/AccordionLink/AccordionLink.svelte.d.ts +4 -0
  6. package/dist/components/ActionBar/ActionBar.svelte +2 -2
  7. package/dist/components/ActionGroup/ActionGroup.svelte +31 -7
  8. package/dist/components/ActionGroup/ActionGroup.svelte.d.ts +4 -4
  9. package/dist/components/AddressographBox/AddressographBox.svelte +5 -1
  10. package/dist/components/AiLabel/AiLabel.svelte +2 -2
  11. package/dist/components/Alert/Alert.svelte +1 -3
  12. package/dist/components/AlertDialog/AlertDialog.svelte +9 -4
  13. package/dist/components/Answer/Answer.svelte +5 -1
  14. package/dist/components/AreaChart/AreaChart.svelte +5 -1
  15. package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput.svelte +55 -0
  16. package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput/AsSaudiyahRaqmAlHuwiyahAlWataniyahInput.svelte.d.ts +10 -0
  17. package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahView/AsSaudiyahRaqmAlHuwiyahAlWataniyahView.svelte +40 -0
  18. package/dist/components/AsSaudiyahRaqmAlHuwiyahAlWataniyahView/AsSaudiyahRaqmAlHuwiyahAlWataniyahView.svelte.d.ts +8 -0
  19. package/dist/components/AustraliaTaxFileNumberInput/AustraliaTaxFileNumberInput.svelte +55 -0
  20. package/dist/components/AustraliaTaxFileNumberInput/AustraliaTaxFileNumberInput.svelte.d.ts +10 -0
  21. package/dist/components/AustraliaTaxFileNumberView/AustraliaTaxFileNumberView.svelte +40 -0
  22. package/dist/components/AustraliaTaxFileNumberView/AustraliaTaxFileNumberView.svelte.d.ts +8 -0
  23. package/dist/components/Autosuggest/Autosuggest.svelte +175 -8
  24. package/dist/components/Autosuggest/Autosuggest.svelte.d.ts +18 -4
  25. package/dist/components/AvatarGroup/AvatarGroup.svelte +5 -1
  26. package/dist/components/BarChart/BarChart.svelte +5 -1
  27. package/dist/components/BarcodeImage/BarcodeImage.svelte +7 -1
  28. package/dist/components/BreadcrumbLink/BreadcrumbLink.svelte +12 -2
  29. package/dist/components/BreadcrumbLink/BreadcrumbLink.svelte.d.ts +4 -0
  30. package/dist/components/BreadcrumbListItem/BreadcrumbListItem.svelte +3 -3
  31. package/dist/components/Byline/Byline.svelte +4 -1
  32. package/dist/components/CandlestickChart/CandlestickChart.svelte +5 -1
  33. package/dist/components/Caption/Caption.svelte +1 -0
  34. package/dist/components/CareCard/CareCard.svelte +1 -0
  35. package/dist/components/Cascader/Cascader.svelte +7 -1
  36. package/dist/components/ChatComposer/ChatComposer.svelte +6 -3
  37. package/dist/components/ChatList/ChatList.svelte +6 -2
  38. package/dist/components/ChatListItem/ChatListItem.svelte +10 -2
  39. package/dist/components/ChatListItem/ChatListItem.svelte.d.ts +2 -0
  40. package/dist/components/ChatMessage/ChatMessage.svelte +6 -2
  41. package/dist/components/ChatNav/ChatNav.svelte +6 -2
  42. package/dist/components/CheckListItem/CheckListItem.svelte +4 -1
  43. package/dist/components/CheckboxGroup/CheckboxGroup.svelte +1 -0
  44. package/dist/components/ChoroplethChart/ChoroplethChart.svelte +5 -1
  45. package/dist/components/Citation/Citation.svelte +6 -2
  46. package/dist/components/Coachmark/Coachmark.svelte +20 -10
  47. package/dist/components/Code/Code.svelte +6 -2
  48. package/dist/components/CodeBlock/CodeBlock.svelte +6 -2
  49. package/dist/components/CollectionListItem/CollectionListItem.svelte +1 -1
  50. package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte +55 -0
  51. package/dist/components/ColombiaCedulaDeCiudadaniaInput/ColombiaCedulaDeCiudadaniaInput.svelte.d.ts +10 -0
  52. package/dist/components/ColombiaCedulaDeCiudadaniaView/ColombiaCedulaDeCiudadaniaView.svelte +40 -0
  53. package/dist/components/ColombiaCedulaDeCiudadaniaView/ColombiaCedulaDeCiudadaniaView.svelte.d.ts +8 -0
  54. package/dist/components/ColumnChart/ColumnChart.svelte +5 -1
  55. package/dist/components/Combobox/Combobox.svelte +11 -9
  56. package/dist/components/Comment/Comment.svelte +5 -1
  57. package/dist/components/ComposedChart/ComposedChart.svelte +5 -1
  58. package/dist/components/ContentsListItem/ContentsListItem.svelte +4 -1
  59. package/dist/components/ContentsNav/ContentsNav.svelte +56 -36
  60. package/dist/components/ContextMenu/ContextMenu.svelte +19 -17
  61. package/dist/components/ContextualHelp/ContextualHelp.svelte +55 -26
  62. package/dist/components/ContextualHelp/ContextualHelp.svelte.d.ts +4 -2
  63. package/dist/components/ConvertDiv/ConvertDiv.svelte +31 -0
  64. package/dist/components/ConvertDiv/ConvertDiv.svelte.d.ts +11 -0
  65. package/dist/components/ConvertFromDiv/ConvertFromDiv.svelte +25 -0
  66. package/dist/components/ConvertFromDiv/ConvertFromDiv.svelte.d.ts +9 -0
  67. package/dist/components/ConvertFromUnitDiv/ConvertFromUnitDiv.svelte +25 -0
  68. package/dist/components/ConvertFromUnitDiv/ConvertFromUnitDiv.svelte.d.ts +9 -0
  69. package/dist/components/ConvertFromValueDiv/ConvertFromValueDiv.svelte +25 -0
  70. package/dist/components/ConvertFromValueDiv/ConvertFromValueDiv.svelte.d.ts +9 -0
  71. package/dist/components/ConvertIntoDiv/ConvertIntoDiv.svelte +25 -0
  72. package/dist/components/ConvertIntoDiv/ConvertIntoDiv.svelte.d.ts +9 -0
  73. package/dist/components/ConvertIntoUnitDiv/ConvertIntoUnitDiv.svelte +25 -0
  74. package/dist/components/ConvertIntoUnitDiv/ConvertIntoUnitDiv.svelte.d.ts +9 -0
  75. package/dist/components/ConvertIntoValueDiv/ConvertIntoValueDiv.svelte +25 -0
  76. package/dist/components/ConvertIntoValueDiv/ConvertIntoValueDiv.svelte.d.ts +9 -0
  77. package/dist/components/CurrencyInput/CurrencyInput.svelte +61 -8
  78. package/dist/components/CurrencyInput/CurrencyInput.svelte.d.ts +9 -4
  79. package/dist/components/DateTimeNowInput/DateTimeNowInput.svelte +18 -16
  80. package/dist/components/DateTimeNowInput/DateTimeNowInput.svelte.d.ts +3 -3
  81. package/dist/components/DescriptionList/DescriptionList.svelte +0 -2
  82. package/dist/components/DescriptionListItem/DescriptionListItem.svelte +0 -2
  83. package/dist/components/DialGroup/DialGroup.svelte +5 -1
  84. package/dist/components/Dialog/Dialog.svelte +14 -1
  85. package/dist/components/Dialog/modal.d.ts +4 -0
  86. package/dist/components/Dialog/modal.js +47 -0
  87. package/dist/components/Diff/Diff.svelte +5 -1
  88. package/dist/components/DigitalObjectIdentifierLink/DigitalObjectIdentifierLink.svelte +16 -7
  89. package/dist/components/DigitalObjectIdentifierLink/DigitalObjectIdentifierLink.svelte.d.ts +4 -2
  90. package/dist/components/DocumentList/DocumentList.svelte +0 -1
  91. package/dist/components/DocumentListItem/DocumentListItem.svelte +0 -2
  92. package/dist/components/Drawer/Drawer.svelte +35 -12
  93. package/dist/components/DropdownMenu/DropdownMenu.svelte +27 -16
  94. package/dist/components/EcuadorCedulaDeIdentidadInput/EcuadorCedulaDeIdentidadInput.svelte +55 -0
  95. package/dist/components/EcuadorCedulaDeIdentidadInput/EcuadorCedulaDeIdentidadInput.svelte.d.ts +10 -0
  96. package/dist/components/EcuadorCedulaDeIdentidadView/EcuadorCedulaDeIdentidadView.svelte +40 -0
  97. package/dist/components/EcuadorCedulaDeIdentidadView/EcuadorCedulaDeIdentidadView.svelte.d.ts +8 -0
  98. package/dist/components/EireIndividualHealthIdentifierView/EireIndividualHealthIdentifierView.svelte +2 -1
  99. package/dist/components/EspanaTarjetaSanitariaIndividualView/EspanaTarjetaSanitariaIndividualView.svelte +2 -1
  100. package/dist/components/Event/Event.svelte +6 -2
  101. package/dist/components/FeatureCard/FeatureCard.svelte +5 -1
  102. package/dist/components/FeaturePhoto/FeaturePhoto.svelte +4 -1
  103. package/dist/components/FileDialog/FileDialog.svelte +7 -1
  104. package/dist/components/FileTree/FileTree.svelte +20 -5
  105. package/dist/components/FiveFaceRatingPicker/FiveFaceRatingPicker.svelte +3 -1
  106. package/dist/components/FiveFaceRatingPickerButton/FiveFaceRatingPickerButton.svelte +2 -2
  107. package/dist/components/FiveStarRatingPicker/FiveStarRatingPicker.svelte +3 -1
  108. package/dist/components/FiveStarRatingPickerButton/FiveStarRatingPickerButton.svelte +2 -2
  109. package/dist/components/FlexStack/FlexStack.svelte +3 -1
  110. package/dist/components/FloatingPanel/FloatingPanel.svelte +15 -13
  111. package/dist/components/FunnelChart/FunnelChart.svelte +5 -1
  112. package/dist/components/GaugeChart/GaugeChart.svelte +5 -1
  113. package/dist/components/GoToNextSection/GoToNextSection.svelte +2 -3
  114. package/dist/components/GoToPreviousSection/GoToPreviousSection.svelte +2 -3
  115. package/dist/components/GoToTop/GoToTop.svelte +0 -2
  116. package/dist/components/GrailLayoutBottomFooter/GrailLayoutBottomFooter.svelte +4 -1
  117. package/dist/components/GrailLayoutCenterMain/GrailLayoutCenterMain.svelte +4 -1
  118. package/dist/components/GrailLayoutLeftAside/GrailLayoutLeftAside.svelte +4 -1
  119. package/dist/components/GrailLayoutRightAside/GrailLayoutRightAside.svelte +4 -1
  120. package/dist/components/GrailLayoutTopHeader/GrailLayoutTopHeader.svelte +4 -1
  121. package/dist/components/GraphicBlock/GraphicBlock.svelte +1 -1
  122. package/dist/components/Grid/Grid.svelte +12 -3
  123. package/dist/components/Grid/Grid.svelte.d.ts +2 -0
  124. package/dist/components/Headline/Headline.svelte +4 -1
  125. package/dist/components/HeatmapChart/HeatmapChart.svelte +5 -1
  126. package/dist/components/HeatmapChartWithYearOfDays/HeatmapChartWithYearOfDays.svelte +5 -1
  127. package/dist/components/Hero/Hero.svelte +6 -2
  128. package/dist/components/HongKongIdentityCardInput/HongKongIdentityCardInput.svelte +55 -0
  129. package/dist/components/HongKongIdentityCardInput/HongKongIdentityCardInput.svelte.d.ts +10 -0
  130. package/dist/components/HongKongIdentityCardView/HongKongIdentityCardView.svelte +40 -0
  131. package/dist/components/HongKongIdentityCardView/HongKongIdentityCardView.svelte.d.ts +8 -0
  132. package/dist/components/HorizontalScroller/HorizontalScroller.svelte +1 -0
  133. package/dist/components/HoverCard/HoverCard.svelte +14 -13
  134. package/dist/components/IconListItem/IconListItem.svelte +4 -1
  135. package/dist/components/InputWithMask/InputWithMask.svelte +4 -1
  136. package/dist/components/IranKodEMelliInput/IranKodEMelliInput.svelte +55 -0
  137. package/dist/components/IranKodEMelliInput/IranKodEMelliInput.svelte.d.ts +10 -0
  138. package/dist/components/IranKodEMelliView/IranKodEMelliView.svelte +40 -0
  139. package/dist/components/IranKodEMelliView/IranKodEMelliView.svelte.d.ts +8 -0
  140. package/dist/components/Kbd/Kbd.svelte +5 -1
  141. package/dist/components/KbdShortcut/KbdShortcut.svelte +9 -2
  142. package/dist/components/LineChart/LineChart.svelte +5 -1
  143. package/dist/components/Listbox/Listbox.svelte +22 -117
  144. package/dist/components/Listbox/listbox-machine.d.ts +81 -0
  145. package/dist/components/Listbox/listbox-machine.js +116 -0
  146. package/dist/components/Listbox/search-text.d.ts +22 -0
  147. package/dist/components/Listbox/search-text.js +56 -0
  148. package/dist/components/Listbox/typeahead.d.ts +19 -0
  149. package/dist/components/Listbox/typeahead.js +39 -0
  150. package/dist/components/Loading/Loading.svelte +5 -1
  151. package/dist/components/MalaysiaKadPengenalanInput/MalaysiaKadPengenalanInput.svelte +55 -0
  152. package/dist/components/MalaysiaKadPengenalanInput/MalaysiaKadPengenalanInput.svelte.d.ts +10 -0
  153. package/dist/components/MalaysiaKadPengenalanView/MalaysiaKadPengenalanView.svelte +40 -0
  154. package/dist/components/MalaysiaKadPengenalanView/MalaysiaKadPengenalanView.svelte.d.ts +8 -0
  155. package/dist/components/Mark/Mark.svelte +0 -2
  156. package/dist/components/MentionsInput/MentionsInput.svelte +14 -2
  157. package/dist/components/Menu/Menu.svelte +1 -3
  158. package/dist/components/MenuBar/MenuBar.svelte +1 -3
  159. package/dist/components/MenuGroup/MenuGroup.svelte +6 -1
  160. package/dist/components/MiddleTruncation/MiddleTruncation.svelte +13 -3
  161. package/dist/components/MockupBrowser/MockupBrowser.svelte +5 -1
  162. package/dist/components/MockupLaptop/MockupLaptop.svelte +5 -1
  163. package/dist/components/MockupPhonePortrait/MockupPhonePortrait.svelte +5 -1
  164. package/dist/components/MockupShell/MockupShell.svelte +5 -1
  165. package/dist/components/MockupTabletLandscape/MockupTabletLandscape.svelte +5 -1
  166. package/dist/components/MockupTabletPortrait/MockupTabletPortrait.svelte +5 -1
  167. package/dist/components/MockupWatch/MockupWatch.svelte +5 -1
  168. package/dist/components/MockupWindow/MockupWindow.svelte +5 -1
  169. package/dist/components/MutuallyExclusive/MutuallyExclusive.svelte +0 -1
  170. package/dist/components/NavigationMenu/NavigationMenu.svelte +51 -3
  171. package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +4 -0
  172. package/dist/components/NavigationMenu/overflow-navigation.d.ts +35 -0
  173. package/dist/components/NavigationMenu/overflow-navigation.js +133 -0
  174. package/dist/components/NetPromoterScorePicker/NetPromoterScorePicker.svelte +3 -1
  175. package/dist/components/NetPromoterScorePickerButton/NetPromoterScorePickerButton.svelte +2 -2
  176. package/dist/components/NigeriaNationalIdentificationNumberInput/NigeriaNationalIdentificationNumberInput.svelte +55 -0
  177. package/dist/components/NigeriaNationalIdentificationNumberInput/NigeriaNationalIdentificationNumberInput.svelte.d.ts +10 -0
  178. package/dist/components/NigeriaNationalIdentificationNumberView/NigeriaNationalIdentificationNumberView.svelte +40 -0
  179. package/dist/components/NigeriaNationalIdentificationNumberView/NigeriaNationalIdentificationNumberView.svelte.d.ts +8 -0
  180. package/dist/components/Organization/Organization.svelte +6 -2
  181. package/dist/components/PaginationLink/PaginationLink.svelte +12 -2
  182. package/dist/components/PaginationLink/PaginationLink.svelte.d.ts +4 -0
  183. package/dist/components/PakistanComputerizedNationalIdentityCardInput/PakistanComputerizedNationalIdentityCardInput.svelte +55 -0
  184. package/dist/components/PakistanComputerizedNationalIdentityCardInput/PakistanComputerizedNationalIdentityCardInput.svelte.d.ts +10 -0
  185. package/dist/components/PakistanComputerizedNationalIdentityCardView/PakistanComputerizedNationalIdentityCardView.svelte +40 -0
  186. package/dist/components/PakistanComputerizedNationalIdentityCardView/PakistanComputerizedNationalIdentityCardView.svelte.d.ts +8 -0
  187. package/dist/components/Person/Person.svelte +6 -2
  188. package/dist/components/PhaseBanner/PhaseBanner.svelte +0 -1
  189. package/dist/components/Pictogram/Pictogram.svelte +4 -1
  190. package/dist/components/Picture/Picture.svelte +27 -0
  191. package/dist/components/Picture/Picture.svelte.d.ts +9 -0
  192. package/dist/components/PieChart/PieChart.svelte +5 -1
  193. package/dist/components/Place/Place.svelte +6 -2
  194. package/dist/components/PopconfirmDialog/PopconfirmDialog.svelte +16 -3
  195. package/dist/components/Popover/Popover.svelte +39 -24
  196. package/dist/components/Popover/popover.d.ts +9 -0
  197. package/dist/components/Popover/popover.js +50 -0
  198. package/dist/components/Popup/Popup.svelte +40 -25
  199. package/dist/components/ProductCard/ProductCard.svelte +5 -1
  200. package/dist/components/ProgressBar/ProgressBar.svelte +0 -1
  201. package/dist/components/Question/Question.svelte +5 -1
  202. package/dist/components/RadarChart/RadarChart.svelte +5 -1
  203. package/dist/components/RedAmberGreenPickerButton/RedAmberGreenPickerButton.svelte +2 -2
  204. package/dist/components/RedOrangeYellowGreenBluePickerButton/RedOrangeYellowGreenBluePickerButton.svelte +2 -2
  205. package/dist/components/RelatedContent/RelatedContent.svelte +0 -1
  206. package/dist/components/Resizable/Resizable.svelte +1 -0
  207. package/dist/components/RingChart/RingChart.svelte +5 -1
  208. package/dist/components/SankeyChart/SankeyChart.svelte +5 -1
  209. package/dist/components/ScatterChart/ScatterChart.svelte +5 -1
  210. package/dist/components/ScreenReaderSpan/ScreenReaderSpan.svelte +6 -2
  211. package/dist/components/ScrollArea/ScrollArea.svelte +1 -0
  212. package/dist/components/ScrollBar/ScrollBar.svelte +78 -16
  213. package/dist/components/ScrollBar/ScrollBar.svelte.d.ts +13 -1
  214. package/dist/components/Scroller/Scroller.svelte +4 -1
  215. package/dist/components/ScrollerBase/ScrollerBase.svelte +1 -1
  216. package/dist/components/SectionLink/SectionLink.svelte +0 -2
  217. package/dist/components/SectionList/SectionList.svelte +0 -2
  218. package/dist/components/SectionListItem/SectionListItem.svelte +1 -3
  219. package/dist/components/SectionNav/SectionNav.svelte +0 -1
  220. package/dist/components/Separator/Separator.svelte +1 -0
  221. package/dist/components/Sheet/Sheet.svelte +32 -11
  222. package/dist/components/ShowMore/ShowMore.svelte +9 -2
  223. package/dist/components/SlideOutDrawer/SlideOutDrawer.svelte +33 -10
  224. package/dist/components/SliderButton/SliderButton.svelte +64 -6
  225. package/dist/components/SliderButton/SliderButton.svelte.d.ts +8 -2
  226. package/dist/components/SplitButton/SplitButton.svelte +29 -5
  227. package/dist/components/SplitButton/SplitButton.svelte.d.ts +3 -3
  228. package/dist/components/SplitView/SplitView.svelte +1 -0
  229. package/dist/components/Splitter/Splitter.svelte +1 -0
  230. package/dist/components/StatusLight/StatusLight.svelte +5 -8
  231. package/dist/components/StepListItem/StepListItem.svelte +3 -3
  232. package/dist/components/StickyPromoBanner/StickyPromoBanner.svelte +1 -0
  233. package/dist/components/SunburstChart/SunburstChart.svelte +5 -1
  234. package/dist/components/SuperBanner/SuperBanner.svelte +5 -1
  235. package/dist/components/TabBar/TabBar.svelte +1 -3
  236. package/dist/components/Tag/Tag.svelte +10 -2
  237. package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoInput/TaiwanGuominShenfenzhengTongyiBianhaoInput.svelte +55 -0
  238. package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoInput/TaiwanGuominShenfenzhengTongyiBianhaoInput.svelte.d.ts +10 -0
  239. package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoView/TaiwanGuominShenfenzhengTongyiBianhaoView.svelte +40 -0
  240. package/dist/components/TaiwanGuominShenfenzhengTongyiBianhaoView/TaiwanGuominShenfenzhengTongyiBianhaoView.svelte.d.ts +8 -0
  241. package/dist/components/TaskBar/TaskBar.svelte +1 -3
  242. package/dist/components/TextAreaInput/TextAreaInput.svelte +1 -2
  243. package/dist/components/TextAreaInputWithCharacterCounter/TextAreaInputWithCharacterCounter.svelte +4 -3
  244. package/dist/components/ThemeProvider/ThemeProvider.svelte +3 -3
  245. package/dist/components/Tile/Tile.svelte +5 -1
  246. package/dist/components/TimeoutDialog/TimeoutDialog.svelte +14 -1
  247. package/dist/components/TimerButton/TimerButton.svelte +55 -7
  248. package/dist/components/TimerButton/TimerButton.svelte.d.ts +9 -3
  249. package/dist/components/ToolBar/ToolBar.svelte +1 -3
  250. package/dist/components/ToolCallError/ToolCallError.svelte +0 -1
  251. package/dist/components/ToolCallName/ToolCallName.svelte +0 -2
  252. package/dist/components/Tooltip/Tooltip.svelte +14 -12
  253. package/dist/components/Tour/Tour.svelte +5 -4
  254. package/dist/components/TourList/TourList.svelte +10 -9
  255. package/dist/components/TourList/TourList.svelte.d.ts +2 -0
  256. package/dist/components/TourListItem/TourListItem.svelte +2 -2
  257. package/dist/components/TransferList/TransferList.svelte +8 -2
  258. package/dist/components/TreeLink/TreeLink.svelte +12 -2
  259. package/dist/components/TreeLink/TreeLink.svelte.d.ts +4 -0
  260. package/dist/components/TreeList/TreeList.svelte +3 -3
  261. package/dist/components/TreeListItem/TreeListItem.svelte +9 -1
  262. package/dist/components/TreeMenu/TreeMenu.svelte +40 -1
  263. package/dist/components/TreeSelect/TreeSelect.svelte +10 -3
  264. package/dist/components/TuaisceartEireannHealthAndCareNumberView/TuaisceartEireannHealthAndCareNumberView.svelte +2 -1
  265. package/dist/components/UruguayCedulaDeIdentidadInput/UruguayCedulaDeIdentidadInput.svelte +55 -0
  266. package/dist/components/UruguayCedulaDeIdentidadInput/UruguayCedulaDeIdentidadInput.svelte.d.ts +10 -0
  267. package/dist/components/UruguayCedulaDeIdentidadView/UruguayCedulaDeIdentidadView.svelte +40 -0
  268. package/dist/components/UruguayCedulaDeIdentidadView/UruguayCedulaDeIdentidadView.svelte.d.ts +8 -0
  269. package/dist/components/VideoPlayer/VideoPlayer.svelte +6 -2
  270. package/dist/components/VietNamCanCuocCongDanInput/VietNamCanCuocCongDanInput.svelte +55 -0
  271. package/dist/components/VietNamCanCuocCongDanInput/VietNamCanCuocCongDanInput.svelte.d.ts +10 -0
  272. package/dist/components/VietNamCanCuocCongDanView/VietNamCanCuocCongDanView.svelte +40 -0
  273. package/dist/components/VietNamCanCuocCongDanView/VietNamCanCuocCongDanView.svelte.d.ts +8 -0
  274. package/dist/components/Visible/Visible.svelte +1 -1
  275. package/dist/components/WarningText/WarningText.svelte +48 -0
  276. package/dist/components/WarningText/WarningText.svelte.d.ts +13 -0
  277. package/dist/components/WheelPicker/WheelPicker.svelte +18 -4
  278. package/dist/components/WheelPicker/wheel-picker.js +18 -3
  279. package/dist/index.d.ts +33 -0
  280. package/dist/index.js +33 -0
  281. package/index.md +4 -4
  282. package/package.json +5 -5
@@ -2,19 +2,27 @@
2
2
  // ScrollBar component
3
3
  //
4
4
  // A headless scrollbar track element that provides the ARIA scrollbar role
5
- // and value attributes for a custom scrollbar control. Renders a <div> with
6
- // orientation, value range, and accessible labeling. The consumer provides the
7
- // visual thumb element as children and implements drag/scroll interaction logic.
5
+ // and value attributes for a custom scrollbar control. Renders a focusable
6
+ // <div> with orientation, value range, and accessible labeling, and owns the
7
+ // keyboard: the keys move the bindable value. The consumer provides the
8
+ // visual thumb element as children, scrolls its content to the value, and
9
+ // implements drag handling.
8
10
  //
9
11
  // Props:
10
12
  // className — string, optional. CSS class name.
11
13
  // orientation — "vertical" | "horizontal", default "vertical". The scrollbar direction.
14
+ // value — number, default 0. Bindable. The scroll position, reflected in aria-valuenow.
15
+ // min — number, default 0. The start of the range.
16
+ // max — number, default 100. The end of the range.
17
+ // step — number, default 1. The arrow-key increment.
18
+ // pageStep — number, default 10. The Page Up / Page Down increment.
19
+ // controls — string, optional. The id of the scrolled element, via aria-controls.
12
20
  // label — string, required. Accessible name for the scrollbar via aria-label.
13
21
  // children — Snippet, required. ScrollBar content, typically the draggable thumb element.
14
22
  // ...restProps — additional HTML attributes spread onto the <div>.
15
23
  //
16
24
  // Syntax:
17
- // <ScrollBar orientation="vertical" label="Scroll">
25
+ // <ScrollBar orientation="vertical" label="Scroll" controls="messages" bind:value={position}>
18
26
  // <div>thumb</div>
19
27
  // </ScrollBar>
20
28
  //
@@ -24,17 +32,18 @@
24
32
  // <div class="thumb"></div>
25
33
  // </ScrollBar>
26
34
  //
27
- // <!-- Vertical scrollbar with custom attributes -->
28
- // <ScrollBar orientation="vertical" label="Page scroll" aria-valuenow={scrollPos}>
35
+ // <!-- Vertical scrollbar bound to the consumer's scroll position -->
36
+ // <ScrollBar orientation="vertical" label="Page scroll" bind:value={scrollPos}>
29
37
  // <div class="thumb"></div>
30
38
  // </ScrollBar>
31
39
  //
32
40
  // Keyboard:
33
- // - Arrow Up/Left: scroll backward (decrease value) — consumer must implement
34
- // - Arrow Down/Right: scroll forward (increase value) — consumer must implement
35
- // - Page Up/Down: scroll by large increment — consumer must implement
36
- // - Home: scroll to beginning — consumer must implement
37
- // - End: scroll to end — consumer must implement
41
+ // - Arrow Up/Left: decrease value by step
42
+ // - Arrow Down/Right: increase value by step
43
+ // - Page Up/Down: decrease/increase value by pageStep
44
+ // - Home: value to min
45
+ // - End: value to max
46
+ // The value is clamped to [min, max].
38
47
  //
39
48
  // Accessibility:
40
49
  // - role="scrollbar" identifies the element as a scrollbar control
@@ -47,8 +56,8 @@
47
56
  //
48
57
  // Claude rules:
49
58
  // - Headless: no CSS, no styles — consumer provides all styling
50
- // - Initial value attributes (0/0/100) are defaults; consumer updates dynamically
51
- // - Consumer implements all drag handling and position updates
59
+ // - The component moves the value on keys; the consumer scrolls its content to
60
+ // the value, writes the value back as the content scrolls, and handles drag
52
61
  //
53
62
  // References:
54
63
  // - WAI-ARIA scrollbar role: https://www.w3.org/TR/wai-aria-1.2/#scrollbar
@@ -58,18 +67,68 @@
58
67
  let {
59
68
  class: className = "",
60
69
  orientation = "vertical",
70
+ value = $bindable(0),
71
+ min = 0,
72
+ max = 100,
73
+ step = 1,
74
+ pageStep = 10,
75
+ controls = undefined,
61
76
  label,
62
77
  children,
63
78
  ...restProps
64
79
  }: {
65
80
  /** ScrollBar orientation. */
66
81
  orientation?: "vertical" | "horizontal";
82
+ /** Scroll position. Bindable. */
83
+ value?: number;
84
+ /** Start of the range. */
85
+ min?: number;
86
+ /** End of the range. */
87
+ max?: number;
88
+ /** Arrow-key increment. */
89
+ step?: number;
90
+ /** Page Up / Page Down increment. */
91
+ pageStep?: number;
92
+ /** Id of the scrolled element. */
93
+ controls?: string;
67
94
  /** Accessible label. */
68
95
  label: string;
69
96
  /** ScrollBar content. */
70
97
  children: Snippet;
71
98
  [key: string]: unknown;
72
99
  } = $props();
100
+
101
+ function clamp(v: number): number {
102
+ return Math.min(max, Math.max(min, v));
103
+ }
104
+
105
+ function onkeydown(event: KeyboardEvent) {
106
+ switch (event.key) {
107
+ case "ArrowUp":
108
+ case "ArrowLeft":
109
+ value = clamp(value - step);
110
+ break;
111
+ case "ArrowDown":
112
+ case "ArrowRight":
113
+ value = clamp(value + step);
114
+ break;
115
+ case "PageUp":
116
+ value = clamp(value - pageStep);
117
+ break;
118
+ case "PageDown":
119
+ value = clamp(value + pageStep);
120
+ break;
121
+ case "Home":
122
+ value = min;
123
+ break;
124
+ case "End":
125
+ value = max;
126
+ break;
127
+ default:
128
+ return;
129
+ }
130
+ event.preventDefault();
131
+ }
73
132
  </script>
74
133
 
75
134
  <!-- ScrollBar.svelte -->
@@ -78,9 +137,12 @@
78
137
  role="scrollbar"
79
138
  aria-label={label}
80
139
  aria-orientation={orientation}
81
- aria-valuenow={0}
82
- aria-valuemin={0}
83
- aria-valuemax={100}
140
+ aria-controls={controls}
141
+ aria-valuenow={value}
142
+ aria-valuemin={min}
143
+ aria-valuemax={max}
144
+ tabindex="0"
145
+ {onkeydown}
84
146
  {...restProps}
85
147
  >
86
148
  {@render children?.()}
@@ -2,12 +2,24 @@ import type { Snippet } from "svelte";
2
2
  type $$ComponentProps = {
3
3
  /** ScrollBar orientation. */
4
4
  orientation?: "vertical" | "horizontal";
5
+ /** Scroll position. Bindable. */
6
+ value?: number;
7
+ /** Start of the range. */
8
+ min?: number;
9
+ /** End of the range. */
10
+ max?: number;
11
+ /** Arrow-key increment. */
12
+ step?: number;
13
+ /** Page Up / Page Down increment. */
14
+ pageStep?: number;
15
+ /** Id of the scrolled element. */
16
+ controls?: string;
5
17
  /** Accessible label. */
6
18
  label: string;
7
19
  /** ScrollBar content. */
8
20
  children: Snippet;
9
21
  [key: string]: unknown;
10
22
  };
11
- declare const ScrollBar: import("svelte").Component<$$ComponentProps, {}, "">;
23
+ declare const ScrollBar: import("svelte").Component<$$ComponentProps, {}, "value">;
12
24
  type ScrollBar = ReturnType<typeof ScrollBar>;
13
25
  export default ScrollBar;
@@ -33,7 +33,10 @@
33
33
  aria-label={label}
34
34
  {...restProps}
35
35
  >
36
- <div class="scroller-background" aria-live="polite">
36
+ <div
37
+ class="scroller-background"
38
+ aria-live="polite"
39
+ >
37
40
  {@render background?.()}
38
41
  </div>
39
42
  <ScrollerBase
@@ -46,7 +46,7 @@
46
46
  {
47
47
  rootMargin: `-${triggerFromTop} 0px -${(100 - offset * 100).toFixed(2)}% 0px`,
48
48
  threshold: 0,
49
- }
49
+ },
50
50
  );
51
51
  for (const step of steps) observer.observe(step);
52
52
 
@@ -18,8 +18,6 @@
18
18
  <!-- SectionLink.svelte -->
19
19
  <a
20
20
  class={`section-link ${className}`}
21
-
22
-
23
21
  {href}
24
22
  {...restProps}
25
23
  >
@@ -16,8 +16,6 @@
16
16
  <!-- SectionList.svelte -->
17
17
  <ul
18
18
  class={`section-list ${className}`}
19
-
20
-
21
19
  {...restProps}
22
20
  >
23
21
  {@render children?.()}
@@ -18,9 +18,7 @@
18
18
  <!-- SectionListItem.svelte -->
19
19
  <li
20
20
  class={`section-list-item ${className}`}
21
-
22
-
23
- aria-current={current ? "page" : undefined}
21
+ data-current={current ? "" : undefined}
24
22
  {...restProps}
25
23
  >
26
24
  {@render children?.()}
@@ -16,7 +16,6 @@
16
16
  <!-- SectionNav.svelte -->
17
17
  <nav
18
18
  class={`section-nav ${className}`}
19
-
20
19
  aria-label={label}
21
20
  {...restProps}
22
21
  >
@@ -52,6 +52,7 @@
52
52
  </script>
53
53
 
54
54
  <!-- Separator.svelte -->
55
+ <!-- svelte-ignore a11y_no_redundant_roles (explicit role keeps the contract on wrapper hosts) -->
55
56
  <hr
56
57
  class={`separator ${className}`}
57
58
  role="separator"
@@ -2,8 +2,10 @@
2
2
  // Sheet component
3
3
  //
4
4
  // A headless sliding panel overlay that appears from an edge of the viewport,
5
- // functioning as a modal dialog. Conditionally rendered based on the open state,
6
- // with Escape key to dismiss. Commonly used for navigation menus, settings panels,
5
+ // functioning as a modal dialog: while open it renders a native <dialog> opened
6
+ // with showModal() (see ../Dialog/modal.ts), so the page behind it is inert, Tab
7
+ // stays inside it, and focus returns to the opener when it closes.
8
+ // Conditionally rendered based on the open state, with Escape key to dismiss. Commonly used for navigation menus, settings panels,
7
9
  // detail views, or filter interfaces that slide in from the top, right, bottom, or left.
8
10
  //
9
11
  // Props:
@@ -12,7 +14,7 @@
12
14
  // open — boolean, default false. Whether the sheet is visible; bindable via bind:open.
13
15
  // side — "left" | "right" | "top" | "bottom", default "right". Which edge the sheet appears from.
14
16
  // children — Snippet, required. Content to render inside the sheet.
15
- // ...restProps — additional HTML attributes spread onto the <div>.
17
+ // ...restProps — additional HTML attributes spread onto the <dialog>.
16
18
  //
17
19
  // Syntax:
18
20
  // <Sheet label="Settings" bind:open side="right">
@@ -32,13 +34,14 @@
32
34
  // </Sheet>
33
35
  //
34
36
  // Keyboard:
35
- // - Escape: closes the sheet by setting open to false
36
- // - Tab: moves focus between focusable elements within the sheet
37
+ // - Escape: closes the sheet by setting open to false (also the native cancel event)
38
+ // - Tab: moves focus between focusable elements within the sheet; showModal() keeps it inside
37
39
  //
38
40
  // Accessibility:
39
- // - role="dialog" identifies the sheet as a dialog window
41
+ // - role="dialog" provided natively by the <dialog> element
40
42
  // - aria-label provides an accessible name for the dialog
41
- // - aria-modal="true" indicates the dialog is modal (content behind is inert)
43
+ // - aria-modal="true" is true: showModal() makes the content behind inert
44
+ // - focus moves into the sheet on open and returns to the opener on close
42
45
  // - tabindex="-1" allows programmatic focus on the dialog container
43
46
  // - data-side attribute exposes the side for CSS targeting
44
47
  //
@@ -48,13 +51,15 @@
48
51
  // Claude rules:
49
52
  // - Headless: no CSS, no styles — consumer provides all styling
50
53
  // - Open uses $bindable() for two-way binding with bind:open
51
- // - Consumer implements focus trapping and slide-in animations via CSS
54
+ // - Focus trapping comes from showModal() via ../Dialog/modal.ts (open-attribute fallback where it is
55
+ // missing, e.g. jsdom); consumer implements slide-in animations via CSS
52
56
  // - Completely removed from DOM when closed ({#if open})
53
57
  //
54
58
  // References:
55
59
  // - WAI-ARIA Dialog (Modal) Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
56
60
 
57
61
  import type { Snippet } from "svelte";
62
+ import { modalDialog } from "../Dialog/modal.js";
58
63
 
59
64
  let {
60
65
  class: className = "",
@@ -81,20 +86,36 @@
81
86
  open = false;
82
87
  }
83
88
  }
89
+ function oncancel(event: Event) {
90
+ event.preventDefault();
91
+ open = false;
92
+ }
93
+ function onclose() {
94
+ open = false;
95
+ }
96
+ // Open as a real modal, then make sure focus is inside: showModal() already moves it in a browser, the
97
+ // open-attribute fallback does not.
98
+ function modal(node: HTMLDialogElement) {
99
+ const action = modalDialog(node, true);
100
+ if (!node.contains(document.activeElement)) node.focus();
101
+ return action;
102
+ }
84
103
  </script>
85
104
 
86
105
  <!-- Sheet.svelte -->
87
106
  {#if open}
88
- <div
107
+ <dialog
89
108
  class={`sheet ${className}`}
90
- role="dialog"
91
109
  aria-label={label}
92
110
  aria-modal="true"
93
111
  tabindex="-1"
94
112
  data-side={side}
113
+ use:modal
95
114
  {onkeydown}
115
+ {oncancel}
116
+ {onclose}
96
117
  {...restProps}
97
118
  >
98
119
  {@render children?.()}
99
- </div>
120
+ </dialog>
100
121
  {/if}
@@ -48,8 +48,15 @@
48
48
  </script>
49
49
 
50
50
  <!-- ShowMore.svelte -->
51
- <div class={`show-more ${className}`} {...restProps}>
52
- <div class="show-more-content" id={contentId} data-expanded={expanded}>
51
+ <div
52
+ class={`show-more ${className}`}
53
+ {...restProps}
54
+ >
55
+ <div
56
+ class="show-more-content"
57
+ id={contentId}
58
+ data-expanded={expanded}
59
+ >
53
60
  {@render children?.()}
54
61
  </div>
55
62
  <button
@@ -2,7 +2,9 @@
2
2
  // SlideOutDrawer component
3
3
  //
4
4
  // A headless slide-out drawer that renders a modal dialog container which
5
- // slides in from the side of the screen. When open, it can be dismissed with
5
+ // slides in from the side of the screen. The container is a native <dialog>
6
+ // opened with showModal() (see ../Dialog/modal.ts): the page behind it is inert,
7
+ // Tab stays inside it, and focus returns to the opener when it closes. When open, it can be dismissed with
6
8
  // the Escape key. Commonly used for navigation menus, filters, settings panels,
7
9
  // or secondary content in mobile and web applications.
8
10
  //
@@ -11,7 +13,7 @@
11
13
  // label — string, required. Accessible label for the dialog via aria-label.
12
14
  // open — boolean, default false. Whether the drawer is visible; bindable via bind:open.
13
15
  // children — Snippet, required. The drawer content.
14
- // ...restProps — additional HTML attributes spread onto the <div>.
16
+ // ...restProps — additional HTML attributes spread onto the <dialog>.
15
17
  //
16
18
  // Syntax:
17
19
  // <SlideOutDrawer label="Menu" bind:open={isOpen}>
@@ -34,12 +36,14 @@
34
36
  // </SlideOutDrawer>
35
37
  //
36
38
  // Keyboard:
37
- // - Escape: closes the drawer by setting open to false
39
+ // - Escape: closes the drawer by setting open to false (also the native cancel event)
40
+ // - Tab: stays inside the drawer while it is open
38
41
  //
39
42
  // Accessibility:
40
- // - role="dialog" for modal overlay semantics
43
+ // - role="dialog" provided natively by the <dialog> element
41
44
  // - aria-label describes the drawer purpose
42
- // - aria-modal="true" indicates modal behavior (content behind is inert)
45
+ // - aria-modal="true" is true: showModal() makes the content behind inert
46
+ // - focus moves into the drawer on open and returns to the opener on close
43
47
  // - tabindex="-1" allows the dialog to receive programmatic focus
44
48
  // - WCAG 2.2 AAA: properly labeled modal with keyboard dismissal
45
49
  //
@@ -51,13 +55,15 @@
51
55
  // - Headless: no CSS, no styles — consumer provides all styling
52
56
  // - Open uses $bindable() for two-way binding with bind:open
53
57
  // - Completely removed from DOM when closed ({#if open})
54
- // - Consumer implements focus trapping and slide animations via CSS
58
+ // - Focus trapping comes from showModal() via ../Dialog/modal.ts (open-attribute fallback where it is
59
+ // missing, e.g. jsdom); consumer implements slide animations via CSS
55
60
  //
56
61
  // References:
57
62
  // - WAI-ARIA Dialog (Modal) Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
58
63
  // - WAI-ARIA dialog role: https://www.w3.org/TR/wai-aria-1.2/#dialog
59
64
 
60
65
  import type { Snippet } from "svelte";
66
+ import { modalDialog } from "../Dialog/modal.js";
61
67
 
62
68
  let {
63
69
  class: className = "",
@@ -79,22 +85,39 @@
79
85
  // Escape key closes the drawer, matching standard dialog behavior.
80
86
  function handleKeydown(event: KeyboardEvent) {
81
87
  if (event.key === "Escape") {
88
+ event.preventDefault();
82
89
  open = false;
83
90
  }
84
91
  }
92
+ function oncancel(event: Event) {
93
+ event.preventDefault();
94
+ open = false;
95
+ }
96
+ function onclose() {
97
+ open = false;
98
+ }
99
+ // Open as a real modal, then make sure focus is inside: showModal() already moves it in a browser, the
100
+ // open-attribute fallback does not.
101
+ function modal(node: HTMLDialogElement) {
102
+ const action = modalDialog(node, true);
103
+ if (!node.contains(document.activeElement)) node.focus();
104
+ return action;
105
+ }
85
106
  </script>
86
107
 
87
- <!-- SlideOutDrawer: a modal dialog container, conditionally rendered -->
108
+ <!-- SlideOutDrawer: a modal <dialog>, conditionally rendered and opened with showModal() -->
88
109
  {#if open}
89
- <div
110
+ <dialog
90
111
  class={`slide-out-drawer ${className}`}
91
- role="dialog"
92
112
  aria-label={label}
93
113
  aria-modal="true"
94
114
  tabindex="-1"
115
+ use:modal
95
116
  onkeydown={handleKeydown}
117
+ {oncancel}
118
+ {onclose}
96
119
  {...restProps}
97
120
  >
98
121
  {@render children?.()}
99
- </div>
122
+ </dialog>
100
123
  {/if}
@@ -1,18 +1,76 @@
1
1
  <script lang="ts">
2
+ // SliderButton: a slide-to-confirm control. A <button role="slider"> whose aria-valuenow is the position, 0 to
3
+ // 100. ArrowRight/ArrowLeft move it by `step`; Home returns it to 0; End, Enter or Space complete it (the
4
+ // keyboard fallback for the drag). Reaching 100 calls `onconfirm` and resets to 0. The consumer draws the track
5
+ // and thumb from aria-valuenow, and wires pointer drag through the same position if it wants one.
2
6
  import type { Snippet } from "svelte";
3
7
  let {
4
8
  class: className = "",
5
- label = undefined,
6
- children,
9
+ label,
10
+ step = 10,
11
+ disabled = false,
12
+ onconfirm = undefined,
13
+ children = undefined,
7
14
  ...restProps
8
15
  }: {
9
- label?: string;
10
- children: Snippet;
16
+ /** Accessible label describing the confirmation action. */
17
+ label: string;
18
+ /** How far one arrow press moves the slider, in percent. */
19
+ step?: number;
20
+ disabled?: boolean;
21
+ /** Called when the slider reaches 100%. */
22
+ onconfirm?: () => void;
23
+ children?: Snippet;
11
24
  [key: string]: unknown;
12
25
  } = $props();
26
+
27
+ let position = $state(0);
28
+
29
+ function moveTo(next: number) {
30
+ if (next >= 100) {
31
+ position = 0;
32
+ onconfirm?.();
33
+ } else {
34
+ position = Math.max(0, next);
35
+ }
36
+ }
37
+
38
+ function onkeydown(event: KeyboardEvent) {
39
+ if (disabled) return;
40
+ switch (event.key) {
41
+ case "ArrowRight":
42
+ moveTo(position + step);
43
+ break;
44
+ case "ArrowLeft":
45
+ moveTo(position - step);
46
+ break;
47
+ case "Home":
48
+ moveTo(0);
49
+ break;
50
+ case "End":
51
+ case "Enter":
52
+ case " ":
53
+ moveTo(100);
54
+ break;
55
+ default:
56
+ return;
57
+ }
58
+ event.preventDefault();
59
+ }
13
60
  </script>
14
61
 
15
62
  <!-- SliderButton.svelte -->
16
- <div class={`slider-button ${className}`} aria-label={label} {...restProps}>
63
+ <button
64
+ type="button"
65
+ role="slider"
66
+ class={`slider-button ${className}`}
67
+ aria-label={label}
68
+ aria-valuenow={position}
69
+ aria-valuemin={0}
70
+ aria-valuemax={100}
71
+ {disabled}
72
+ {onkeydown}
73
+ {...restProps}
74
+ >
17
75
  {@render children?.()}
18
- </div>
76
+ </button>
@@ -1,7 +1,13 @@
1
1
  import type { Snippet } from "svelte";
2
2
  type $$ComponentProps = {
3
- label?: string;
4
- children: Snippet;
3
+ /** Accessible label describing the confirmation action. */
4
+ label: string;
5
+ /** How far one arrow press moves the slider, in percent. */
6
+ step?: number;
7
+ disabled?: boolean;
8
+ /** Called when the slider reaches 100%. */
9
+ onconfirm?: () => void;
10
+ children?: Snippet;
5
11
  [key: string]: unknown;
6
12
  };
7
13
  declare const SliderButton: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -52,13 +52,14 @@
52
52
  // - WAI-ARIA Menu Button: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/
53
53
 
54
54
  import type { Snippet } from "svelte";
55
+ import { popoverState, popoverSupported, toggleOpened } from "../Popover/popover.js";
55
56
 
56
57
  let {
57
58
  class: className = "",
58
59
  label,
59
60
  primaryLabel,
60
61
  menuLabel,
61
- menuOpen = false,
62
+ menuOpen = $bindable(false),
62
63
  disabled = false,
63
64
  onprimaryclick = undefined,
64
65
  onmenutoggle = undefined,
@@ -71,18 +72,30 @@
71
72
  primaryLabel: string;
72
73
  /** Accessible label for the menu trigger (required) */
73
74
  menuLabel: string;
74
- /** Whether the dropdown menu is open */
75
+ /** Whether the dropdown menu is open. Bindable: the browser opens and light-dismisses it. */
75
76
  menuOpen?: boolean;
76
77
  /** Whether both buttons are disabled */
77
78
  disabled?: boolean;
78
79
  /** Primary action handler */
79
80
  onprimaryclick?: (event: MouseEvent) => void;
80
- /** Menu toggle handler */
81
+ /** Menu toggle handler; call preventDefault() to keep the menu as it is */
81
82
  onmenutoggle?: (event: MouseEvent) => void;
82
83
  /** The menu content */
83
84
  children: Snippet;
84
85
  [key: string]: unknown;
85
86
  } = $props();
87
+
88
+ const uid = $props.id();
89
+ const menuId = `split-button-menu-${uid}`;
90
+ let menu: HTMLDivElement | undefined = $state();
91
+
92
+ // With the Popover API the trigger's command="toggle-popover" opens and closes the menu and the toggle event
93
+ // writes `menuOpen` back; without it, the click toggles `menuOpen` and popoverState sets `hidden`.
94
+ function toggle(event: MouseEvent) {
95
+ onmenutoggle?.(event);
96
+ if (event.defaultPrevented) return;
97
+ if (menu && !popoverSupported(menu)) menuOpen = !menuOpen;
98
+ }
86
99
  </script>
87
100
 
88
101
  <!-- SplitButton.svelte -->
@@ -107,9 +120,20 @@
107
120
  aria-haspopup="menu"
108
121
  aria-expanded={menuOpen}
109
122
  aria-label={menuLabel}
110
- onclick={onmenutoggle}
123
+ aria-controls={menuId}
124
+ command="toggle-popover"
125
+ commandfor={menuId}
126
+ popovertarget={menuId}
127
+ onclick={toggle}
111
128
  ></button>
112
- <div class="split-button-menu" hidden={!menuOpen}>
129
+ <div
130
+ bind:this={menu}
131
+ class="split-button-menu"
132
+ id={menuId}
133
+ popover="auto"
134
+ use:popoverState={menuOpen}
135
+ ontoggle={(event) => (menuOpen = toggleOpened(event))}
136
+ >
113
137
  {@render children?.()}
114
138
  </div>
115
139
  </div>
@@ -6,18 +6,18 @@ type $$ComponentProps = {
6
6
  primaryLabel: string;
7
7
  /** Accessible label for the menu trigger (required) */
8
8
  menuLabel: string;
9
- /** Whether the dropdown menu is open */
9
+ /** Whether the dropdown menu is open. Bindable: the browser opens and light-dismisses it. */
10
10
  menuOpen?: boolean;
11
11
  /** Whether both buttons are disabled */
12
12
  disabled?: boolean;
13
13
  /** Primary action handler */
14
14
  onprimaryclick?: (event: MouseEvent) => void;
15
- /** Menu toggle handler */
15
+ /** Menu toggle handler; call preventDefault() to keep the menu as it is */
16
16
  onmenutoggle?: (event: MouseEvent) => void;
17
17
  /** The menu content */
18
18
  children: Snippet;
19
19
  [key: string]: unknown;
20
20
  };
21
- declare const SplitButton: import("svelte").Component<$$ComponentProps, {}, "">;
21
+ declare const SplitButton: import("svelte").Component<$$ComponentProps, {}, "menuOpen">;
22
22
  type SplitButton = ReturnType<typeof SplitButton>;
23
23
  export default SplitButton;