@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
@@ -27,7 +27,10 @@
27
27
  </script>
28
28
 
29
29
  <!-- Headline.svelte -->
30
- <div class={`headline ${className}`} {...restProps}>
30
+ <div
31
+ class={`headline ${className}`}
32
+ {...restProps}
33
+ >
31
34
  {#if level === 1}
32
35
  <h1 class="headline-heading">{@render children?.()}</h1>
33
36
  {:else if level === 2}
@@ -52,7 +52,11 @@
52
52
  class={`heatmap-chart ${className}`}
53
53
  {...restProps}
54
54
  >
55
- <div class="heatmap-chart-graphic" role="img" aria-label={label}>
55
+ <div
56
+ class="heatmap-chart-graphic"
57
+ role="img"
58
+ aria-label={label}
59
+ >
56
60
  {@render children?.()}
57
61
  </div>
58
62
  {#if dataTable}
@@ -63,7 +63,11 @@
63
63
  data-week-start={weekStart}
64
64
  {...restProps}
65
65
  >
66
- <div class="heatmap-chart-with-year-of-days-graphic" role="img" aria-label={label}>
66
+ <div
67
+ class="heatmap-chart-with-year-of-days-graphic"
68
+ role="img"
69
+ aria-label={label}
70
+ >
67
71
  {@render children?.()}
68
72
  </div>
69
73
  {#if dataTable}
@@ -13,6 +13,10 @@
13
13
  </script>
14
14
 
15
15
  <!-- Hero.svelte -->
16
- <div class={`hero ${className}`} aria-label={label} {...restProps}>
16
+ <section
17
+ class={`hero ${className}`}
18
+ aria-label={label}
19
+ {...restProps}
20
+ >
17
21
  {@render children?.()}
18
- </div>
22
+ </section>
@@ -0,0 +1,55 @@
1
+ <script lang="ts">
2
+ // HongKongIdentityCardInput component
3
+ //
4
+ // A headless input for entering Hong Kong's Identity Card Number.
5
+ // Format: One or two letters, six digits and a check digit in parentheses, such as A123456(3). The check digit is 0 to 9 or A. Each letter counts as A=10 to Z=35, and a single letter is preceded by a space counted as 36; the eight values are multiplied by 9,8,7,6,5,4,3,2 and summed, and the check digit is 11 minus the sum's Modulus-11 remainder (0 when the remainder is 0, and A when the result is 10).
6
+ //
7
+ // Props:
8
+ // className — string, optional. CSS class name.
9
+ // label — string, required. Accessible label for screen readers via aria-label.
10
+ // value — string, default "". Bindable input value; supports bind:value.
11
+ // required — boolean, default false. Whether the input is required for form submission.
12
+ // disabled — boolean, default false. Whether the input is disabled.
13
+ // ...restProps — additional HTML attributes spread onto the <input>.
14
+ //
15
+ // Syntax:
16
+ // <HongKongIdentityCardInput label="Hong Kong Identity Card Number" bind:value />
17
+ //
18
+ // Accessibility:
19
+ // - aria-label provides the accessible name for screen readers
20
+ // - autocomplete="off" protects sensitive identifiers
21
+ // - required and disabled states are conveyed to assistive technology
22
+ //
23
+ // Internationalization:
24
+ // - The label prop externalizes user-facing text for translation
25
+ //
26
+ // References:
27
+ // - https://en.wikipedia.org/wiki/Hong_Kong_identity_card
28
+
29
+ let {
30
+ class: className = "",
31
+ label,
32
+ value = $bindable(""),
33
+ required = false,
34
+ disabled = false,
35
+ ...restProps
36
+ }: {
37
+ label: string;
38
+ value?: string;
39
+ required?: boolean;
40
+ disabled?: boolean;
41
+ [key: string]: unknown;
42
+ } = $props();
43
+ </script>
44
+
45
+ <!-- HongKongIdentityCardInput.svelte -->
46
+ <input
47
+ class={`hong-kong-identity-card-input ${className}`}
48
+ type="text"
49
+ aria-label={label}
50
+ autocomplete="off"
51
+ bind:value
52
+ {required}
53
+ {disabled}
54
+ {...restProps}
55
+ />
@@ -0,0 +1,10 @@
1
+ type $$ComponentProps = {
2
+ label: string;
3
+ value?: string;
4
+ required?: boolean;
5
+ disabled?: boolean;
6
+ [key: string]: unknown;
7
+ };
8
+ declare const HongKongIdentityCardInput: import("svelte").Component<$$ComponentProps, {}, "value">;
9
+ type HongKongIdentityCardInput = ReturnType<typeof HongKongIdentityCardInput>;
10
+ export default HongKongIdentityCardInput;
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ // HongKongIdentityCardView component
3
+ //
4
+ // A headless display component for showing Hong Kong's
5
+ // Hong Kong Identity Card Number in a read-only format.
6
+ // Format: One or two letters, six digits and a check digit in parentheses, such as A123456(3). The check digit is 0 to 9 or A. Each letter counts as A=10 to Z=35, and a single letter is preceded by a space counted as 36; the eight values are multiplied by 9,8,7,6,5,4,3,2 and summed, and the check digit is 11 minus the sum's Modulus-11 remainder (0 when the remainder is 0, and A when the result is 10).
7
+ //
8
+ // Props:
9
+ // className — string, optional. CSS class name.
10
+ // label — string, required. Accessible label for screen readers via aria-label.
11
+ // value — string, default "". The identifier string to display.
12
+ // ...restProps — additional HTML attributes spread onto the <span>.
13
+ //
14
+ // Syntax:
15
+ // <HongKongIdentityCardView label="Hong Kong Identity Card Number" value={value} />
16
+ //
17
+ // Accessibility:
18
+ // - aria-label provides the accessible name so screen readers announce the purpose
19
+ //
20
+ // References:
21
+ // - https://en.wikipedia.org/wiki/Hong_Kong_identity_card
22
+
23
+ let {
24
+ class: className = "",
25
+ label,
26
+ value = "",
27
+ ...restProps
28
+ }: {
29
+ label: string;
30
+ value?: string;
31
+ [key: string]: unknown;
32
+ } = $props();
33
+ </script>
34
+
35
+ <!-- HongKongIdentityCardView.svelte -->
36
+ <span
37
+ class={`hong-kong-identity-card-view ${className}`}
38
+ aria-label={label}
39
+ {...restProps}>{value}</span
40
+ >
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ label: string;
3
+ value?: string;
4
+ [key: string]: unknown;
5
+ };
6
+ declare const HongKongIdentityCardView: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type HongKongIdentityCardView = ReturnType<typeof HongKongIdentityCardView>;
8
+ export default HongKongIdentityCardView;
@@ -41,6 +41,7 @@
41
41
  </script>
42
42
 
43
43
  <!-- HorizontalScroller.svelte -->
44
+ <!-- svelte-ignore a11y_no_noninteractive_tabindex (a scrollable region must be keyboard-focusable (axe scrollable-region-focusable)) -->
44
45
  <div
45
46
  bind:this={scrollerEl}
46
47
  class={`horizontal-scroller ${className}`}
@@ -2,7 +2,7 @@
2
2
  // HoverCard component
3
3
  //
4
4
  // A hover card that displays supplementary content when triggered, typically by a
5
- // hover or focus interaction on a trigger element. It conditionally renders a container
5
+ // hover or focus interaction on a trigger element. It renders a popover="manual" container
6
6
  // with role="tooltip" when the open prop is true. Useful for user profile previews,
7
7
  // link previews, contextual help, or any popover-style content.
8
8
  //
@@ -44,14 +44,15 @@
44
44
  // - Headless: no CSS, no styles — consumer provides all styling and positioning
45
45
  // - Uses $bindable(false) for two-way binding on the open prop
46
46
  // - Consumer is responsible for managing hover/focus events on the trigger element
47
- // - Fully removed from DOM when closed via {#if open}
48
- //
47
+ // - Native first: popover="manual" (top layer) opened and closed by the `open` state through ./Popover/popover.ts; where the Popover API is missing (jsdom, older browsers) it falls back to the `hidden` attribute. Placement is the theme's CSS (anchor positioning); light dismiss and Escape stay the consumer's.
49
48
  // References:
50
49
  // - WAI-ARIA tooltip role: https://www.w3.org/TR/wai-aria-1.2/#tooltip
51
50
  // - WAI-ARIA Tooltip Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
52
51
 
53
52
  import type { Snippet } from "svelte";
54
53
 
54
+ import { popoverState } from "../Popover/popover.js";
55
+
55
56
  let {
56
57
  class: className = "",
57
58
  label,
@@ -67,13 +68,13 @@
67
68
  </script>
68
69
 
69
70
  <!-- HoverCard.svelte -->
70
- {#if open}
71
- <div
72
- class={`hover-card ${className}`}
73
- role="tooltip"
74
- aria-label={label}
75
- {...restProps}
76
- >
77
- {@render children?.()}
78
- </div>
79
- {/if}
71
+ <div
72
+ class={`hover-card ${className}`}
73
+ role="tooltip"
74
+ popover="manual"
75
+ use:popoverState={open}
76
+ aria-label={label}
77
+ {...restProps}
78
+ >
79
+ {@render children?.()}
80
+ </div>
@@ -50,7 +50,10 @@
50
50
  {...restProps}
51
51
  >
52
52
  {#if icon}
53
- <span class="icon-list-item-icon" aria-hidden="true">
53
+ <span
54
+ class="icon-list-item-icon"
55
+ aria-hidden="true"
56
+ >
54
57
  {@render icon()}
55
58
  </span>
56
59
  {/if}
@@ -65,7 +65,10 @@
65
65
  data-mask={mask}
66
66
  {...restProps}
67
67
  >
68
- <span class="input-with-mask-display" aria-hidden="true">{mask}</span>
68
+ <span
69
+ class="input-with-mask-display"
70
+ aria-hidden="true">{mask}</span
71
+ >
69
72
  <input
70
73
  class="input-with-mask-control"
71
74
  type="text"
@@ -0,0 +1,55 @@
1
+ <script lang="ts">
2
+ // IranKodEMelliInput component
3
+ //
4
+ // A headless input for entering Iran's National Code (Kod-e Melli).
5
+ // Format: Ten digits whose last digit is a check digit. The first nine digits are multiplied by 10,9,8,7,6,5,4,3,2 and summed; with r the sum's Modulus-11 remainder, the check digit is r when r is less than 2, otherwise 11 minus r. A number whose ten digits are all the same is never valid.
6
+ //
7
+ // Props:
8
+ // className — string, optional. CSS class name.
9
+ // label — string, required. Accessible label for screen readers via aria-label.
10
+ // value — string, default "". Bindable input value; supports bind:value.
11
+ // required — boolean, default false. Whether the input is required for form submission.
12
+ // disabled — boolean, default false. Whether the input is disabled.
13
+ // ...restProps — additional HTML attributes spread onto the <input>.
14
+ //
15
+ // Syntax:
16
+ // <IranKodEMelliInput label="National Code (Kod-e Melli)" bind:value />
17
+ //
18
+ // Accessibility:
19
+ // - aria-label provides the accessible name for screen readers
20
+ // - autocomplete="off" protects sensitive identifiers
21
+ // - required and disabled states are conveyed to assistive technology
22
+ //
23
+ // Internationalization:
24
+ // - The label prop externalizes user-facing text for translation
25
+ //
26
+ // References:
27
+ // - https://en.wikipedia.org/wiki/Iranian_identity_card
28
+
29
+ let {
30
+ class: className = "",
31
+ label,
32
+ value = $bindable(""),
33
+ required = false,
34
+ disabled = false,
35
+ ...restProps
36
+ }: {
37
+ label: string;
38
+ value?: string;
39
+ required?: boolean;
40
+ disabled?: boolean;
41
+ [key: string]: unknown;
42
+ } = $props();
43
+ </script>
44
+
45
+ <!-- IranKodEMelliInput.svelte -->
46
+ <input
47
+ class={`iran-kod-e-melli-input ${className}`}
48
+ type="text"
49
+ aria-label={label}
50
+ autocomplete="off"
51
+ bind:value
52
+ {required}
53
+ {disabled}
54
+ {...restProps}
55
+ />
@@ -0,0 +1,10 @@
1
+ type $$ComponentProps = {
2
+ label: string;
3
+ value?: string;
4
+ required?: boolean;
5
+ disabled?: boolean;
6
+ [key: string]: unknown;
7
+ };
8
+ declare const IranKodEMelliInput: import("svelte").Component<$$ComponentProps, {}, "value">;
9
+ type IranKodEMelliInput = ReturnType<typeof IranKodEMelliInput>;
10
+ export default IranKodEMelliInput;
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ // IranKodEMelliView component
3
+ //
4
+ // A headless display component for showing Iran's
5
+ // National Code (Kod-e Melli) in a read-only format.
6
+ // Format: Ten digits whose last digit is a check digit. The first nine digits are multiplied by 10,9,8,7,6,5,4,3,2 and summed; with r the sum's Modulus-11 remainder, the check digit is r when r is less than 2, otherwise 11 minus r. A number whose ten digits are all the same is never valid.
7
+ //
8
+ // Props:
9
+ // className — string, optional. CSS class name.
10
+ // label — string, required. Accessible label for screen readers via aria-label.
11
+ // value — string, default "". The identifier string to display.
12
+ // ...restProps — additional HTML attributes spread onto the <span>.
13
+ //
14
+ // Syntax:
15
+ // <IranKodEMelliView label="National Code (Kod-e Melli)" value={value} />
16
+ //
17
+ // Accessibility:
18
+ // - aria-label provides the accessible name so screen readers announce the purpose
19
+ //
20
+ // References:
21
+ // - https://en.wikipedia.org/wiki/Iranian_identity_card
22
+
23
+ let {
24
+ class: className = "",
25
+ label,
26
+ value = "",
27
+ ...restProps
28
+ }: {
29
+ label: string;
30
+ value?: string;
31
+ [key: string]: unknown;
32
+ } = $props();
33
+ </script>
34
+
35
+ <!-- IranKodEMelliView.svelte -->
36
+ <span
37
+ class={`iran-kod-e-melli-view ${className}`}
38
+ aria-label={label}
39
+ {...restProps}>{value}</span
40
+ >
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ label: string;
3
+ value?: string;
4
+ [key: string]: unknown;
5
+ };
6
+ declare const IranKodEMelliView: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type IranKodEMelliView = ReturnType<typeof IranKodEMelliView>;
8
+ export default IranKodEMelliView;
@@ -13,6 +13,10 @@
13
13
  </script>
14
14
 
15
15
  <!-- Kbd.svelte -->
16
- <kbd class={`kbd ${className}`} aria-label={label} {...restProps}>
16
+ <kbd
17
+ class={`kbd ${className}`}
18
+ aria-label={label}
19
+ {...restProps}
20
+ >
17
21
  {@render children?.()}
18
22
  </kbd>
@@ -42,8 +42,15 @@
42
42
  </script>
43
43
 
44
44
  <!-- KbdShortcut.svelte -->
45
- <kbd class={`kbd-shortcut ${className}`} aria-label={label} {...restProps}>
45
+ <kbd
46
+ class={`kbd-shortcut ${className}`}
47
+ aria-label={label}
48
+ {...restProps}
49
+ >
46
50
  {#each keys as key, i (i)}
47
- {#if i > 0}<span class="kbd-shortcut-separator" aria-hidden="true">{separator}</span>{/if}<kbd class="kbd-shortcut-key">{key}</kbd>
51
+ {#if i > 0}<span
52
+ class="kbd-shortcut-separator"
53
+ aria-hidden="true">{separator}</span
54
+ >{/if}<kbd class="kbd-shortcut-key">{key}</kbd>
48
55
  {/each}
49
56
  </kbd>
@@ -52,7 +52,11 @@
52
52
  class={`line-chart ${className}`}
53
53
  {...restProps}
54
54
  >
55
- <div class="line-chart-graphic" role="img" aria-label={label}>
55
+ <div
56
+ class="line-chart-graphic"
57
+ role="img"
58
+ aria-label={label}
59
+ >
56
60
  {@render children?.()}
57
61
  </div>
58
62
  {#if dataTable}
@@ -105,6 +105,7 @@
105
105
  // - WAI-ARIA Listbox Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
106
106
 
107
107
  import type { Snippet } from "svelte";
108
+ import { initialListboxState, listboxKeydown } from "./listbox-machine";
108
109
 
109
110
  let {
110
111
  class: className = "",
@@ -153,129 +154,33 @@
153
154
  [key: string]: unknown;
154
155
  } = $props();
155
156
 
157
+ // Every keyboard decision lives in the framework-free machine (shared/listbox-machine.ts, copied here by
158
+ // bin/sync-shared-modules); this component only reads the DOM and applies the transition it returns.
156
159
  function options(): HTMLElement[] {
157
160
  return ref ? Array.from(ref.querySelectorAll<HTMLElement>("[role='option']")) : [];
158
161
  }
159
162
 
160
- // ---------------------------------------------------------------
161
- // roving-focus (default, unchanged): real DOM focus per option, wraps.
162
- // ---------------------------------------------------------------
163
-
164
- function onRovingFocusKeydown(event: KeyboardEvent) {
165
- const opts = options();
166
- const current = document.activeElement as HTMLElement;
167
- const index = opts.indexOf(current);
168
- switch (event.key) {
169
- case "ArrowDown": {
170
- event.preventDefault();
171
- const next = index < opts.length - 1 ? index + 1 : 0;
172
- opts[next]?.focus();
173
- break;
174
- }
175
- case "ArrowUp": {
176
- event.preventDefault();
177
- const prev = index > 0 ? index - 1 : opts.length - 1;
178
- opts[prev]?.focus();
179
- break;
180
- }
181
- case "Home": {
182
- event.preventDefault();
183
- opts[0]?.focus();
184
- break;
185
- }
186
- case "End": {
187
- event.preventDefault();
188
- opts[opts.length - 1]?.focus();
189
- break;
190
- }
191
- }
192
- }
193
-
194
- // ---------------------------------------------------------------
195
- // active-descendant (opt-in): virtual cursor, clamp/wrap, typeahead, paging.
196
- // ---------------------------------------------------------------
197
-
198
- let typeaheadBuffer = "";
199
- let typeaheadTimer: ReturnType<typeof setTimeout> | undefined;
200
-
201
- function moveActive(delta: number) {
202
- const count = options().length;
203
- if (count === 0) return;
204
- const next = activeIndex + delta;
205
- activeIndex = clamp ? Math.min(Math.max(next, 0), count - 1) : ((next % count) + count) % count;
206
- }
207
-
208
- function runTypeahead(char: string) {
209
- const opts = options();
210
- if (opts.length === 0) return;
211
- const lower = char.toLowerCase();
212
- const sameCharRun = typeaheadBuffer === "" || [...typeaheadBuffer].every((c) => c === lower);
213
- typeaheadBuffer += lower;
214
- clearTimeout(typeaheadTimer);
215
- typeaheadTimer = setTimeout(() => (typeaheadBuffer = ""), 500);
216
- const query = sameCharRun ? lower : typeaheadBuffer;
217
- const anchor = activeIndex < 0 ? 0 : activeIndex;
218
- const start = sameCharRun ? anchor + 1 : anchor;
219
- for (let n = 0; n < opts.length; n++) {
220
- const i = (start + n) % opts.length;
221
- if ((opts[i].textContent ?? "").trim().toLowerCase().startsWith(query)) {
222
- activeIndex = i;
223
- return;
224
- }
225
- }
226
- }
227
-
228
- function onActiveDescendantKeydown(event: KeyboardEvent) {
229
- switch (event.key) {
230
- case "ArrowDown":
231
- event.preventDefault();
232
- moveActive(1);
233
- break;
234
- case "ArrowUp":
235
- event.preventDefault();
236
- moveActive(-1);
237
- break;
238
- case "Home":
239
- event.preventDefault();
240
- activeIndex = options().length ? 0 : -1;
241
- break;
242
- case "End":
243
- event.preventDefault();
244
- activeIndex = options().length - 1;
245
- break;
246
- case "PageDown":
247
- event.preventDefault();
248
- moveActive(pageSize);
249
- break;
250
- case "PageUp":
251
- event.preventDefault();
252
- moveActive(-pageSize);
253
- break;
254
- case "Enter":
255
- case " ":
256
- event.preventDefault();
257
- if (activeIndex >= 0) onActivate?.(activeIndex);
258
- break;
259
- case "Escape":
260
- event.preventDefault();
261
- onEscape?.();
262
- break;
263
- case "Tab":
264
- // Not prevented: the consumer's onTabOut (e.g. moving focus to a
265
- // trigger button) runs first, so the browser's default Tab
266
- // proceeds from wherever focus ends up, not from this element.
267
- onTabOut?.(event);
268
- break;
269
- default:
270
- if (typeahead && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
271
- runTypeahead(event.key);
272
- }
273
- }
274
- }
163
+ let typeaheadState = initialListboxState().typeahead;
275
164
 
276
165
  function onkeydown(event: KeyboardEvent) {
277
- if (navigation === "active-descendant") onActiveDescendantKeydown(event);
278
- else onRovingFocusKeydown(event);
166
+ const opts = options();
167
+ const t = listboxKeydown(
168
+ { activeIndex, typeahead: typeaheadState },
169
+ event,
170
+ {
171
+ labels: opts.map((option) => (option.textContent ?? "").trim()),
172
+ focusedIndex: opts.indexOf(document.activeElement as HTMLElement),
173
+ now: Date.now(),
174
+ },
175
+ { navigation, clamp, typeahead, pageSize },
176
+ );
177
+ typeaheadState = t.state.typeahead;
178
+ if (t.preventDefault) event.preventDefault();
179
+ if (t.focus !== undefined) opts[t.focus]?.focus();
180
+ if (t.setActiveIndex !== undefined) activeIndex = t.setActiveIndex;
181
+ if (t.activate !== undefined) onActivate?.(t.activate);
182
+ if (t.escape) onEscape?.();
183
+ if (t.tabOut) onTabOut?.(event); // never prevented: Tab proceeds from wherever onTabOut leaves focus
279
184
  }
280
185
 
281
186
  const activeId = $derived.by(() => {
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The listbox behaviour core: one framework-free transition function that every library's Listbox binds with a thin
3
+ * adapter (spec/competitive-position item 3). Pure, so the whole WAI-ARIA APG listbox keyboard contract is unit-tested
4
+ * without a browser.
5
+ *
6
+ * The adapter owns the DOM: it reads the options' labels and which option has focus, calls `listboxKeydown`, then
7
+ * applies the returned transition (prevent the default, move focus, set the active index, call the consumer's
8
+ * callbacks). The machine owns every decision.
9
+ *
10
+ * Two navigation models, as the Listbox components document them:
11
+ *
12
+ * "roving-focus" (default): real focus moves between the options. ArrowDown/ArrowUp wrap; Home/End jump. No
13
+ * typeahead, paging or activation.
14
+ *
15
+ * "active-descendant": the root keeps focus and a virtual cursor (`activeIndex`) moves. ArrowDown/ArrowUp wrap, or
16
+ * clamp when `clamp` is set; Home/End jump; PageUp/PageDown move by `pageSize`, wrapping or clamping like the
17
+ * arrows; printable characters run typeahead when `typeahead` is set; Enter/Space activate the active option;
18
+ * Escape and Tab are reported so the consumer decides what they do (Tab is never prevented).
19
+ *
20
+ * Selection is the consumer's: the machine reports activation and the consumer sets `aria-selected`. Disabled options
21
+ * are not skipped, matching the components this machine was extracted from.
22
+ */
23
+ import { type TypeaheadState } from "./typeahead";
24
+ export type ListboxNavigation = "roving-focus" | "active-descendant";
25
+ /** Typeahead prefix lifetime: a pause this long starts a new prefix. The Listbox components have always used 500 ms. */
26
+ export declare const LISTBOX_TYPEAHEAD_RESET_MS = 500;
27
+ /** The component props the machine reads. Every field is optional and defaults as the components do. */
28
+ export interface ListboxConfig {
29
+ navigation?: ListboxNavigation;
30
+ /** Arrows and paging clamp at the ends instead of wrapping (active-descendant only). */
31
+ clamp?: boolean;
32
+ /** Printable characters move the cursor (active-descendant only). */
33
+ typeahead?: boolean;
34
+ /** PageUp/PageDown step (active-descendant only). Default 10. */
35
+ pageSize?: number;
36
+ /** Typeahead reset pause in milliseconds. Default `LISTBOX_TYPEAHEAD_RESET_MS`. */
37
+ typeaheadResetMs?: number;
38
+ }
39
+ /** The machine's state: the virtual cursor (-1 = none) and the typeahead prefix. */
40
+ export interface ListboxState {
41
+ activeIndex: number;
42
+ typeahead: TypeaheadState;
43
+ }
44
+ /** The parts of a keyboard event the machine reads. A DOM, React or Svelte KeyboardEvent fits. */
45
+ export interface ListboxKey {
46
+ key: string;
47
+ ctrlKey?: boolean;
48
+ altKey?: boolean;
49
+ metaKey?: boolean;
50
+ }
51
+ /** What the adapter reads from the DOM at the moment of the key press. */
52
+ export interface ListboxContext {
53
+ /** Each option's text, trimmed, in document order. Its length is the option count. */
54
+ labels: readonly string[];
55
+ /** The option that has real focus, or -1 (roving-focus only). */
56
+ focusedIndex?: number;
57
+ /** The time of the key press in milliseconds (for typeahead). */
58
+ now?: number;
59
+ }
60
+ /** What the adapter must do. Absent fields mean "nothing". */
61
+ export interface ListboxTransition {
62
+ state: ListboxState;
63
+ /** Call `event.preventDefault()`. */
64
+ preventDefault: boolean;
65
+ /** Set the active index to this value (and notify the consumer), even when it is unchanged. */
66
+ setActiveIndex?: number;
67
+ /** Move real focus to the option at this index (roving-focus). */
68
+ focus?: number;
69
+ /** Call the consumer's onActivate with this index. */
70
+ activate?: number;
71
+ /** Call the consumer's onEscape. */
72
+ escape?: boolean;
73
+ /** Call the consumer's onTabOut, before the browser handles Tab. */
74
+ tabOut?: boolean;
75
+ }
76
+ /** A fresh state with the cursor at `activeIndex`. */
77
+ export declare function initialListboxState(activeIndex?: number): ListboxState;
78
+ /** `index` moved by `delta` among `count` options, clamped to the ends or wrapped. `count` must be positive. */
79
+ export declare function stepListboxIndex(index: number, delta: number, count: number, clamp: boolean): number;
80
+ /** The transition for one key press. Never mutates `state`. */
81
+ export declare function listboxKeydown(state: ListboxState, event: ListboxKey, context: ListboxContext, config?: ListboxConfig): ListboxTransition;