@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
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ /** The content. */
4
+ children?: Snippet;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const ConvertFromUnitDiv: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ConvertFromUnitDiv = ReturnType<typeof ConvertFromUnitDiv>;
9
+ export default ConvertFromUnitDiv;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ // ConvertFromValueDiv component
3
+ //
4
+ // A headless part of ConvertDiv: the value to convert from, such as a text input holding the number of dollars. Contract: a plain <div> with the base class and children.
5
+ // Converts nothing and carries no strings of its own; the consumer supplies the controls.
6
+ import type { Snippet } from "svelte";
7
+
8
+ let {
9
+ class: className = "",
10
+ children,
11
+ ...restProps
12
+ }: {
13
+ /** The content. */
14
+ children?: Snippet;
15
+ [key: string]: unknown;
16
+ } = $props();
17
+ </script>
18
+
19
+ <!-- ConvertFromValueDiv.svelte -->
20
+ <div
21
+ class={`convert-from-value-div ${className}`}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ /** The content. */
4
+ children?: Snippet;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const ConvertFromValueDiv: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ConvertFromValueDiv = ReturnType<typeof ConvertFromValueDiv>;
9
+ export default ConvertFromValueDiv;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ // ConvertIntoDiv component
3
+ //
4
+ // A headless part of ConvertDiv: the target side of a conversion, holding the value and unit to convert into. Contract: a plain <div> with the base class and children.
5
+ // Converts nothing and carries no strings of its own; the consumer supplies the controls.
6
+ import type { Snippet } from "svelte";
7
+
8
+ let {
9
+ class: className = "",
10
+ children,
11
+ ...restProps
12
+ }: {
13
+ /** The content. */
14
+ children?: Snippet;
15
+ [key: string]: unknown;
16
+ } = $props();
17
+ </script>
18
+
19
+ <!-- ConvertIntoDiv.svelte -->
20
+ <div
21
+ class={`convert-into-div ${className}`}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ /** The content. */
4
+ children?: Snippet;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const ConvertIntoDiv: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ConvertIntoDiv = ReturnType<typeof ConvertIntoDiv>;
9
+ export default ConvertIntoDiv;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ // ConvertIntoUnitDiv component
3
+ //
4
+ // A headless part of ConvertDiv: the unit to convert into, such as a select box of currencies or lengths. Contract: a plain <div> with the base class and children.
5
+ // Converts nothing and carries no strings of its own; the consumer supplies the controls.
6
+ import type { Snippet } from "svelte";
7
+
8
+ let {
9
+ class: className = "",
10
+ children,
11
+ ...restProps
12
+ }: {
13
+ /** The content. */
14
+ children?: Snippet;
15
+ [key: string]: unknown;
16
+ } = $props();
17
+ </script>
18
+
19
+ <!-- ConvertIntoUnitDiv.svelte -->
20
+ <div
21
+ class={`convert-into-unit-div ${className}`}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ /** The content. */
4
+ children?: Snippet;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const ConvertIntoUnitDiv: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ConvertIntoUnitDiv = ReturnType<typeof ConvertIntoUnitDiv>;
9
+ export default ConvertIntoUnitDiv;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ // ConvertIntoValueDiv component
3
+ //
4
+ // A headless part of ConvertDiv: the converted value, such as a text input showing the number of euros. Contract: a plain <div> with the base class and children.
5
+ // Converts nothing and carries no strings of its own; the consumer supplies the controls.
6
+ import type { Snippet } from "svelte";
7
+
8
+ let {
9
+ class: className = "",
10
+ children,
11
+ ...restProps
12
+ }: {
13
+ /** The content. */
14
+ children?: Snippet;
15
+ [key: string]: unknown;
16
+ } = $props();
17
+ </script>
18
+
19
+ <!-- ConvertIntoValueDiv.svelte -->
20
+ <div
21
+ class={`convert-into-value-div ${className}`}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ /** The content. */
4
+ children?: Snippet;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const ConvertIntoValueDiv: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ConvertIntoValueDiv = ReturnType<typeof ConvertIntoValueDiv>;
9
+ export default ConvertIntoValueDiv;
@@ -1,18 +1,71 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from "svelte";
2
+ // CurrencyInput component
3
+ //
4
+ // A currency input rendered as a native <input type="text" inputmode="decimal">.
5
+ // The component does not format the displayed value; formatting
6
+ // (Intl.NumberFormat, separators, currency symbol placement) is the consumer's
7
+ // responsibility. currencyCode is exposed as data-currency-code so the
8
+ // consumer can pass it to Intl.NumberFormat. It is REQUIRED and never
9
+ // defaulted: the component does not pick a currency.
10
+ //
11
+ // Props:
12
+ // class — string, optional. CSS class name.
13
+ // label — string, required. Accessible name via aria-label.
14
+ // value — number | undefined, bindable. Parsed numeric value.
15
+ // currencyCode — string, required, no default. ISO 4217 currency code.
16
+ // min, max — number, optional. Constraints, not enforced clamping.
17
+ // required, disabled — boolean, default false.
18
+ // ...restProps — spread onto the <input>.
19
+ //
20
+ // Claude rules:
21
+ // - Headless: no CSS, no styles; no locale formatting baked in
22
+ // - Never default currencyCode (AGENTS/internationalization.md)
23
+
3
24
  let {
4
25
  class: className = "",
5
- label = undefined,
6
- children,
26
+ label,
27
+ value = $bindable(undefined),
28
+ currencyCode,
29
+ min = undefined,
30
+ max = undefined,
31
+ required = false,
32
+ disabled = false,
7
33
  ...restProps
8
34
  }: {
9
- label?: string;
10
- children: Snippet;
35
+ class?: string;
36
+ label: string;
37
+ value?: number | undefined;
38
+ currencyCode: string;
39
+ min?: number;
40
+ max?: number;
41
+ required?: boolean;
42
+ disabled?: boolean;
11
43
  [key: string]: unknown;
12
44
  } = $props();
45
+
46
+ function oninput(event: Event) {
47
+ const raw = (event.currentTarget as HTMLInputElement).value.trim();
48
+ if (raw === "") {
49
+ value = undefined;
50
+ return;
51
+ }
52
+ const parsed = Number(raw);
53
+ value = Number.isNaN(parsed) ? undefined : parsed;
54
+ }
13
55
  </script>
14
56
 
15
57
  <!-- CurrencyInput.svelte -->
16
- <div class={`currency-input ${className}`} aria-label={label} {...restProps}>
17
- {@render children?.()}
18
- </div>
58
+ <input
59
+ class={`currency-input ${className}`}
60
+ type="text"
61
+ inputmode="decimal"
62
+ aria-label={label}
63
+ data-currency-code={currencyCode}
64
+ value={value === undefined ? "" : String(value)}
65
+ {min}
66
+ {max}
67
+ {required}
68
+ {disabled}
69
+ {oninput}
70
+ {...restProps}
71
+ />
@@ -1,9 +1,14 @@
1
- import type { Snippet } from "svelte";
2
1
  type $$ComponentProps = {
3
- label?: string;
4
- children: Snippet;
2
+ class?: string;
3
+ label: string;
4
+ value?: number | undefined;
5
+ currencyCode: string;
6
+ min?: number;
7
+ max?: number;
8
+ required?: boolean;
9
+ disabled?: boolean;
5
10
  [key: string]: unknown;
6
11
  };
7
- declare const CurrencyInput: import("svelte").Component<$$ComponentProps, {}, "">;
12
+ declare const CurrencyInput: import("svelte").Component<$$ComponentProps, {}, "value">;
8
13
  type CurrencyInput = ReturnType<typeof CurrencyInput>;
9
14
  export default CurrencyInput;
@@ -10,9 +10,10 @@
10
10
  // Props:
11
11
  // className — string, optional. CSS class name.
12
12
  // label — string, required. Accessible name for the wrapper group via aria-label.
13
- // dateLabel — string, default "Date". Accessible name for the date input via aria-label.
14
- // timeLabel — string, default "Time". Accessible name for the time input via aria-label.
15
- // nowLabel — string, default "Now". Accessible label and text for the "Now" button.
13
+ // dateLabel — string, required. Accessible name for the date input via aria-label.
14
+ // timeLabel — string, required. Accessible name for the time input via aria-label.
15
+ // nowLabel — string, required. Accessible label and text for the "Now" button.
16
+ // The three come from the locale-translations packs: {...dateTimeNowInputLabels(pack)}.
16
17
  // dateValue — string, default "". Bindable date string (format: YYYY-MM-DD).
17
18
  // timeValue — string, default "". Bindable time string (format: HH:mm).
18
19
  // required — boolean, default false. Whether the inputs are required.
@@ -20,17 +21,17 @@
20
21
  // ...restProps — additional HTML attributes spread onto the wrapper <div>.
21
22
  //
22
23
  // Syntax:
23
- // <DateTimeNowInput label="Event time" bind:dateValue bind:timeValue />
24
+ // <DateTimeNowInput label="Event time" dateLabel="Date" timeLabel="Time" nowLabel="Now" bind:dateValue bind:timeValue />
24
25
  //
25
26
  // Examples:
26
- // <!-- Basic usage -->
27
- // <DateTimeNowInput label="Event time" bind:dateValue bind:timeValue />
27
+ // <!-- Labels from a locale pack (@lilydesignsystem/svelte-locale-translations) -->
28
+ // <DateTimeNowInput label="Heure de l'événement" {...dateTimeNowInputLabels(fr)} bind:dateValue bind:timeValue />
28
29
  //
29
- // <!-- Custom labels for internationalization -->
30
- // <DateTimeNowInput label="Heure" dateLabel="Date" timeLabel="Heure" nowLabel="Maintenant" bind:dateValue bind:timeValue />
30
+ // <!-- Labels written by hand -->
31
+ // <DateTimeNowInput label="Event time" dateLabel="Date" timeLabel="Time" nowLabel="Now" bind:dateValue bind:timeValue />
31
32
  //
32
33
  // <!-- Required and disabled -->
33
- // <DateTimeNowInput label="Appointment" bind:dateValue bind:timeValue required disabled={isLocked} />
34
+ // <DateTimeNowInput label="Appointment" {...labels} bind:dateValue bind:timeValue required disabled={isLocked} />
34
35
  //
35
36
  // Keyboard:
36
37
  // - Tab: Moves focus between the date input, time input, and "Now" button
@@ -45,7 +46,8 @@
45
46
  //
46
47
  // Internationalization:
47
48
  // - The label, dateLabel, timeLabel, and nowLabel props are the only user-facing strings
48
- // - Default labels are "Date", "Time", and "Now"; override for other locales
49
+ // - No default labels: a missing one leaves its control unnamed rather than in English.
50
+ // dateTimeNowInputLabels(pack) from the locale-translations package gives all three in 64 locales.
49
51
  // - No other hardcoded user-facing strings
50
52
  //
51
53
  // Claude rules:
@@ -59,9 +61,9 @@
59
61
  let {
60
62
  class: className = "",
61
63
  label,
62
- dateLabel = "Date",
63
- timeLabel = "Time",
64
- nowLabel = "Now",
64
+ dateLabel,
65
+ timeLabel,
66
+ nowLabel,
65
67
  dateValue = $bindable(""),
66
68
  timeValue = $bindable(""),
67
69
  required = false,
@@ -69,9 +71,9 @@
69
71
  ...restProps
70
72
  }: {
71
73
  label: string;
72
- dateLabel?: string;
73
- timeLabel?: string;
74
- nowLabel?: string;
74
+ dateLabel: string;
75
+ timeLabel: string;
76
+ nowLabel: string;
75
77
  dateValue?: string;
76
78
  timeValue?: string;
77
79
  required?: boolean;
@@ -1,8 +1,8 @@
1
1
  type $$ComponentProps = {
2
2
  label: string;
3
- dateLabel?: string;
4
- timeLabel?: string;
5
- nowLabel?: string;
3
+ dateLabel: string;
4
+ timeLabel: string;
5
+ nowLabel: string;
6
6
  dateValue?: string;
7
7
  timeValue?: string;
8
8
  required?: boolean;
@@ -16,8 +16,6 @@
16
16
  <!-- DescriptionList.svelte -->
17
17
  <dl
18
18
  class={`description-list ${className}`}
19
-
20
-
21
19
  {...restProps}
22
20
  >
23
21
  {@render children?.()}
@@ -16,8 +16,6 @@
16
16
  <!-- DescriptionListItem.svelte -->
17
17
  <div
18
18
  class={`description-list-item ${className}`}
19
-
20
-
21
19
  {...restProps}
22
20
  >
23
21
  {@render children?.()}
@@ -13,6 +13,10 @@
13
13
  </script>
14
14
 
15
15
  <!-- DialGroup.svelte -->
16
- <div class={`dial-group ${className}`} aria-label={label} {...restProps}>
16
+ <div
17
+ class={`dial-group ${className}`}
18
+ aria-label={label}
19
+ {...restProps}
20
+ >
17
21
  {@render children?.()}
18
22
  </div>
@@ -54,6 +54,7 @@
54
54
  // - WAI-ARIA dialog role: https://www.w3.org/TR/wai-aria-1.2/#dialog
55
55
 
56
56
  import type { Snippet } from "svelte";
57
+ import { modalDialog } from "./modal.js";
57
58
 
58
59
  let {
59
60
  class: className = "",
@@ -80,17 +81,29 @@
80
81
  open = false;
81
82
  }
82
83
  }
84
+ function oncancel(event: Event) {
85
+ event.preventDefault();
86
+ open = false;
87
+ }
88
+ function onclose() {
89
+ open = false;
90
+ }
83
91
  </script>
84
92
 
85
93
  <!-- Dialog.svelte -->
86
94
  {#if open}
95
+ <!-- A modal dialog is opened by `showModal()` (see modal.ts), so the `open` attribute is only rendered for a
96
+ non-modal one; the keydown and cancel handlers keep `open` in step with a native Escape or `<form method="dialog">`. -->
87
97
  <dialog
88
98
  class={`dialog ${className}`}
89
- open
99
+ open={modal ? undefined : true}
90
100
  tabindex="-1"
91
101
  aria-label={label}
92
102
  aria-modal={modal || undefined}
103
+ use:modalDialog={modal}
93
104
  {onkeydown}
105
+ {oncancel}
106
+ {onclose}
94
107
  {...restProps}
95
108
  >
96
109
  {@render children?.()}
@@ -0,0 +1,4 @@
1
+ export declare function modalDialog(node: HTMLDialogElement, enabled: boolean): {
2
+ update(next: boolean): void;
3
+ destroy(): void;
4
+ };
@@ -0,0 +1,47 @@
1
+ // Show a <dialog> as a real modal, or as a plain open dialog.
2
+ //
3
+ // A modal dialog is opened with `showModal()`: the browser puts it in the top layer, makes the rest of the page
4
+ // inert (no pointer, no keyboard, no assistive-technology access behind it), traps Tab inside it, moves focus to
5
+ // it and returns focus to the opener when it closes. Setting the `open` attribute does none of that, so a dialog
6
+ // that only sets `open` and says `aria-modal="true"` claims a modality it does not have.
7
+ //
8
+ // Where `showModal` is missing (jsdom, very old browsers) the dialog falls back to the `open` attribute, which
9
+ // keeps it visible and testable. Used as `use:modalDialog={modal}`.
10
+ export function modalDialog(node, enabled) {
11
+ let modal = enabled;
12
+ // Where focus was when the dialog opened. A native close() would hand focus back there, but Svelte takes the element
13
+ // out of the page before this action's cleanup runs, so by then the browser can no longer do it: we do.
14
+ const opener = typeof document === "undefined" ? null : document.activeElement;
15
+ function show() {
16
+ if (node.open)
17
+ return;
18
+ if (modal && typeof node.showModal === "function")
19
+ node.showModal();
20
+ else
21
+ node.setAttribute("open", "");
22
+ }
23
+ function hide() {
24
+ if (!node.open)
25
+ return;
26
+ if (typeof node.close === "function")
27
+ node.close();
28
+ else
29
+ node.removeAttribute("open");
30
+ }
31
+ show();
32
+ return {
33
+ update(next) {
34
+ if (next === modal)
35
+ return;
36
+ // Modal and non-modal are different openings: close the old one and open the new one.
37
+ hide();
38
+ modal = next;
39
+ show();
40
+ },
41
+ destroy() {
42
+ hide();
43
+ if (opener && opener !== document.body && opener.isConnected)
44
+ opener.focus();
45
+ },
46
+ };
47
+ }
@@ -13,6 +13,10 @@
13
13
  </script>
14
14
 
15
15
  <!-- Diff.svelte -->
16
- <div class={`diff ${className}`} aria-label={label} {...restProps}>
16
+ <div
17
+ class={`diff ${className}`}
18
+ aria-label={label}
19
+ {...restProps}
20
+ >
17
21
  {@render children?.()}
18
22
  </div>
@@ -1,18 +1,27 @@
1
1
  <script lang="ts">
2
+ // DigitalObjectIdentifierLink: a link to a Digital Object Identifier through the https://doi.org/ resolver.
3
+ // The display text is the consumer's children, or the DOI itself when none is given.
2
4
  import type { Snippet } from "svelte";
3
5
  let {
4
6
  class: className = "",
5
- label = undefined,
6
- children,
7
+ doi,
8
+ children = undefined,
7
9
  ...restProps
8
10
  }: {
9
- label?: string;
10
- children: Snippet;
11
+ /** The Digital Object Identifier, e.g. "10.1000/xyz123". */
12
+ doi: string;
13
+ /** Link display text; the DOI when omitted. */
14
+ children?: Snippet;
11
15
  [key: string]: unknown;
12
16
  } = $props();
13
17
  </script>
14
18
 
15
19
  <!-- DigitalObjectIdentifierLink.svelte -->
16
- <div class={`digital-object-identifier-link ${className}`} aria-label={label} {...restProps}>
17
- {@render children?.()}
18
- </div>
20
+ <a
21
+ class={`digital-object-identifier-link ${className}`}
22
+ href={`https://doi.org/${doi}`}
23
+ rel="noopener noreferrer"
24
+ {...restProps}
25
+ >
26
+ {#if children}{@render children()}{:else}{doi}{/if}
27
+ </a>
@@ -1,7 +1,9 @@
1
1
  import type { Snippet } from "svelte";
2
2
  type $$ComponentProps = {
3
- label?: string;
4
- children: Snippet;
3
+ /** The Digital Object Identifier, e.g. "10.1000/xyz123". */
4
+ doi: string;
5
+ /** Link display text; the DOI when omitted. */
6
+ children?: Snippet;
5
7
  [key: string]: unknown;
6
8
  };
7
9
  declare const DigitalObjectIdentifierLink: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -16,7 +16,6 @@
16
16
  <!-- DocumentList.svelte -->
17
17
  <ul
18
18
  class={`document-list ${className}`}
19
-
20
19
  aria-label={label}
21
20
  {...restProps}
22
21
  >
@@ -16,8 +16,6 @@
16
16
  <!-- DocumentListItem.svelte -->
17
17
  <li
18
18
  class={`document-list-item ${className}`}
19
-
20
-
21
19
  {...restProps}
22
20
  >
23
21
  {@render children?.()}
@@ -2,10 +2,12 @@
2
2
  // Drawer component
3
3
  //
4
4
  // A panel that slides in from an edge of the viewport, typically used for
5
- // navigation menus, filters, or supplementary content. Renders conditionally
6
- // based on the open state and uses role="dialog" with aria-modal="true" for
7
- // proper screen reader behavior. The side prop indicates which edge via a
8
- // data-side attribute for consumer positioning and animation styles.
5
+ // navigation menus, filters, or supplementary content. It is modal: while open
6
+ // it renders a native <dialog> opened with showModal() (see ../Dialog/modal.ts),
7
+ // so the browser puts it in the top layer, makes the page behind it inert,
8
+ // traps Tab inside it and, on close, focus returns to the element that opened
9
+ // it. The side prop indicates which edge via a data-side attribute for
10
+ // consumer positioning and animation styles.
9
11
  //
10
12
  // Props:
11
13
  // className — string, optional. CSS class name.
@@ -13,7 +15,7 @@
13
15
  // label — string, required. Accessible name for the drawer.
14
16
  // side — "left" | "right" | "top" | "bottom", default "left". Edge the drawer enters from.
15
17
  // children — Snippet, required. Drawer content.
16
- // ...restProps — additional HTML attributes spread onto the <div>.
18
+ // ...restProps — additional HTML attributes spread onto the <dialog>.
17
19
  //
18
20
  // Syntax:
19
21
  // <Drawer label="Nav" bind:open side="left">Content</Drawer>
@@ -30,13 +32,15 @@
30
32
  // </Drawer>
31
33
  //
32
34
  // Keyboard:
33
- // - Escape: closes the drawer by setting open to false
35
+ // - Escape: closes the drawer by setting open to false (also the native cancel event)
36
+ // - Tab: stays inside the drawer while it is open (showModal() makes the page inert)
34
37
  //
35
38
  // Accessibility:
36
- // - role="dialog" identifies the drawer as a dialog
39
+ // - role="dialog" provided natively by the <dialog> element
37
40
  // - aria-label provides the accessible name
38
- // - aria-modal="true" indicates the drawer is modal
39
- // - tabindex="-1" allows programmatic focus management
41
+ // - aria-modal="true" is true: showModal() makes the rest of the page inert
42
+ // - focus moves into the drawer on open and returns to the opener on close
43
+ // - tabindex="-1" lets the drawer itself take focus when it has no focusable child
40
44
  // - data-side attribute conveys position for consumer styling
41
45
  //
42
46
  // Internationalization:
@@ -46,12 +50,15 @@
46
50
  // - Headless: no CSS, no styles — consumer provides all styling
47
51
  // - Uses $bindable() on open for two-way state binding
48
52
  // - Drawer is removed from DOM when open is false
53
+ // - Opened with showModal() via ../Dialog/modal.ts; where showModal is missing (jsdom) it falls back to
54
+ // the open attribute
49
55
  // - Consumer uses data-side for positioning CSS
50
56
  //
51
57
  // References:
52
58
  // - WAI-ARIA Dialog Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
53
59
 
54
60
  import type { Snippet } from "svelte";
61
+ import { modalDialog } from "../Dialog/modal.js";
55
62
 
56
63
  let {
57
64
  class: className = "",
@@ -78,20 +85,36 @@
78
85
  open = false;
79
86
  }
80
87
  }
88
+ function oncancel(event: Event) {
89
+ event.preventDefault();
90
+ open = false;
91
+ }
92
+ function onclose() {
93
+ open = false;
94
+ }
95
+ // Open as a real modal, then make sure focus is inside: showModal() already moves it in a browser, the
96
+ // open-attribute fallback does not.
97
+ function modal(node: HTMLDialogElement) {
98
+ const action = modalDialog(node, true);
99
+ if (!node.contains(document.activeElement)) node.focus();
100
+ return action;
101
+ }
81
102
  </script>
82
103
 
83
104
  {#if open}
84
105
  <!-- Drawer.svelte -->
85
- <div
106
+ <dialog
86
107
  class={`drawer ${className}`}
87
- role="dialog"
88
108
  tabindex="-1"
89
109
  aria-label={label}
90
110
  aria-modal="true"
91
111
  data-side={side}
112
+ use:modal
92
113
  {onkeydown}
114
+ {oncancel}
115
+ {onclose}
93
116
  {...restProps}
94
117
  >
95
118
  {@render children?.()}
96
- </div>
119
+ </dialog>
97
120
  {/if}