@gnome-ui/react 1.45.1 → 1.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/dist/components/AboutDialog/AboutDialog.cjs +1 -1
  2. package/dist/components/AboutDialog/AboutDialog.cjs.map +1 -1
  3. package/dist/components/AboutDialog/AboutDialog.d.ts +1 -1
  4. package/dist/components/AboutDialog/AboutDialog.js +106 -108
  5. package/dist/components/AboutDialog/AboutDialog.js.map +1 -1
  6. package/dist/components/AboutDialog/AboutDialog.module.css.cjs +1 -1
  7. package/dist/components/AboutDialog/AboutDialog.module.css.js +28 -29
  8. package/dist/components/AboutDialog.cjs +1 -1
  9. package/dist/components/ActionRow/ActionRow.cjs +1 -1
  10. package/dist/components/ActionRow/ActionRow.cjs.map +1 -1
  11. package/dist/components/ActionRow/ActionRow.d.ts +1 -1
  12. package/dist/components/ActionRow/ActionRow.js +2 -2
  13. package/dist/components/ActionRow/ActionRow.js.map +1 -1
  14. package/dist/components/ActionRow.cjs +1 -1
  15. package/dist/components/Avatar/Avatar.cjs +1 -1
  16. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  17. package/dist/components/Avatar/Avatar.d.ts +1 -1
  18. package/dist/components/Avatar/Avatar.js +2 -2
  19. package/dist/components/Avatar/Avatar.js.map +1 -1
  20. package/dist/components/Avatar.cjs +1 -1
  21. package/dist/components/AvatarRotator/AvatarRotator.cjs +1 -1
  22. package/dist/components/AvatarRotator/AvatarRotator.cjs.map +1 -1
  23. package/dist/components/AvatarRotator/AvatarRotator.d.ts +1 -1
  24. package/dist/components/AvatarRotator/AvatarRotator.js +2 -2
  25. package/dist/components/AvatarRotator/AvatarRotator.js.map +1 -1
  26. package/dist/components/AvatarRotator.cjs +1 -1
  27. package/dist/components/Badge/Badge.cjs +1 -1
  28. package/dist/components/Badge/Badge.cjs.map +1 -1
  29. package/dist/components/Badge/Badge.d.ts +1 -1
  30. package/dist/components/Badge/Badge.js +2 -2
  31. package/dist/components/Badge/Badge.js.map +1 -1
  32. package/dist/components/Badge.cjs +1 -1
  33. package/dist/components/Banner/Banner.cjs +1 -1
  34. package/dist/components/Banner/Banner.cjs.map +1 -1
  35. package/dist/components/Banner/Banner.d.ts +1 -1
  36. package/dist/components/Banner/Banner.js +34 -36
  37. package/dist/components/Banner/Banner.js.map +1 -1
  38. package/dist/components/Banner/Banner.module.css.cjs +1 -1
  39. package/dist/components/Banner/Banner.module.css.js +11 -12
  40. package/dist/components/Banner.cjs +1 -1
  41. package/dist/components/Bin/Bin.cjs +1 -1
  42. package/dist/components/Bin/Bin.cjs.map +1 -1
  43. package/dist/components/Bin/Bin.d.ts +1 -1
  44. package/dist/components/Bin/Bin.js +4 -6
  45. package/dist/components/Bin/Bin.js.map +1 -1
  46. package/dist/components/Bin.cjs +1 -1
  47. package/dist/components/Blockquote/Blockquote.cjs +1 -1
  48. package/dist/components/Blockquote/Blockquote.cjs.map +1 -1
  49. package/dist/components/Blockquote/Blockquote.d.ts +1 -1
  50. package/dist/components/Blockquote/Blockquote.js +24 -26
  51. package/dist/components/Blockquote/Blockquote.js.map +1 -1
  52. package/dist/components/Blockquote.cjs +1 -1
  53. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  54. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  55. package/dist/components/BottomSheet/BottomSheet.d.ts +1 -1
  56. package/dist/components/BottomSheet/BottomSheet.js +37 -38
  57. package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
  58. package/dist/components/BottomSheet/BottomSheet.module.css.cjs +1 -1
  59. package/dist/components/BottomSheet/BottomSheet.module.css.js +8 -9
  60. package/dist/components/BottomSheet.cjs +1 -1
  61. package/dist/components/Box/Box.cjs +1 -1
  62. package/dist/components/Box/Box.cjs.map +1 -1
  63. package/dist/components/Box/Box.d.ts +1 -1
  64. package/dist/components/Box/Box.js +2 -2
  65. package/dist/components/Box/Box.js.map +1 -1
  66. package/dist/components/Box.cjs +1 -1
  67. package/dist/components/BoxedList/BoxedList.cjs +1 -1
  68. package/dist/components/BoxedList/BoxedList.cjs.map +1 -1
  69. package/dist/components/BoxedList/BoxedList.d.ts +1 -1
  70. package/dist/components/BoxedList/BoxedList.js +2 -2
  71. package/dist/components/BoxedList/BoxedList.js.map +1 -1
  72. package/dist/components/BoxedList.cjs +1 -1
  73. package/dist/components/BreakpointBin/BreakpointBin.cjs +1 -1
  74. package/dist/components/BreakpointBin/BreakpointBin.cjs.map +1 -1
  75. package/dist/components/BreakpointBin/BreakpointBin.d.ts +1 -1
  76. package/dist/components/BreakpointBin/BreakpointBin.js +2 -2
  77. package/dist/components/BreakpointBin/BreakpointBin.js.map +1 -1
  78. package/dist/components/BreakpointBin.cjs +1 -1
  79. package/dist/components/Button/Button.cjs +1 -1
  80. package/dist/components/Button/Button.cjs.map +1 -1
  81. package/dist/components/Button/Button.js.map +1 -1
  82. package/dist/components/Button.cjs +1 -1
  83. package/dist/components/ButtonContent/ButtonContent.cjs +1 -1
  84. package/dist/components/ButtonContent/ButtonContent.cjs.map +1 -1
  85. package/dist/components/ButtonContent/ButtonContent.d.ts +1 -1
  86. package/dist/components/ButtonContent/ButtonContent.js +24 -26
  87. package/dist/components/ButtonContent/ButtonContent.js.map +1 -1
  88. package/dist/components/ButtonContent.cjs +1 -1
  89. package/dist/components/ButtonRow/ButtonRow.cjs +1 -1
  90. package/dist/components/ButtonRow/ButtonRow.cjs.map +1 -1
  91. package/dist/components/ButtonRow/ButtonRow.d.ts +1 -1
  92. package/dist/components/ButtonRow/ButtonRow.js +22 -24
  93. package/dist/components/ButtonRow/ButtonRow.js.map +1 -1
  94. package/dist/components/ButtonRow.cjs +1 -1
  95. package/dist/components/Card/Card.cjs +1 -1
  96. package/dist/components/Card/Card.cjs.map +1 -1
  97. package/dist/components/Card/Card.d.ts +1 -1
  98. package/dist/components/Card/Card.js +10 -12
  99. package/dist/components/Card/Card.js.map +1 -1
  100. package/dist/components/Card/Card.module.css.cjs +1 -1
  101. package/dist/components/Card/Card.module.css.js +4 -5
  102. package/dist/components/Card.cjs +1 -1
  103. package/dist/components/Carousel/Carousel.cjs +1 -1
  104. package/dist/components/Carousel/Carousel.cjs.map +1 -1
  105. package/dist/components/Carousel/Carousel.d.ts +3 -3
  106. package/dist/components/Carousel/Carousel.js +28 -34
  107. package/dist/components/Carousel/Carousel.js.map +1 -1
  108. package/dist/components/Carousel.cjs +1 -1
  109. package/dist/components/CheckRow/CheckRow.cjs +1 -1
  110. package/dist/components/CheckRow/CheckRow.cjs.map +1 -1
  111. package/dist/components/CheckRow/CheckRow.d.ts +1 -1
  112. package/dist/components/CheckRow/CheckRow.js +7 -7
  113. package/dist/components/CheckRow/CheckRow.js.map +1 -1
  114. package/dist/components/CheckRow.cjs +1 -1
  115. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  116. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  117. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  118. package/dist/components/Checkbox/Checkbox.js +2 -2
  119. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  120. package/dist/components/Checkbox.cjs +1 -1
  121. package/dist/components/Chip/Chip.cjs +1 -1
  122. package/dist/components/Chip/Chip.cjs.map +1 -1
  123. package/dist/components/Chip/Chip.d.ts +1 -1
  124. package/dist/components/Chip/Chip.js +2 -2
  125. package/dist/components/Chip/Chip.js.map +1 -1
  126. package/dist/components/Chip.cjs +1 -1
  127. package/dist/components/Clamp/Clamp.cjs +1 -1
  128. package/dist/components/Clamp/Clamp.cjs.map +1 -1
  129. package/dist/components/Clamp/Clamp.d.ts +1 -1
  130. package/dist/components/Clamp/Clamp.js +9 -11
  131. package/dist/components/Clamp/Clamp.js.map +1 -1
  132. package/dist/components/Clamp.cjs +1 -1
  133. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  134. package/dist/components/ColorPicker/ColorPicker.cjs.map +1 -1
  135. package/dist/components/ColorPicker/ColorPicker.d.ts +2 -2
  136. package/dist/components/ColorPicker/ColorPicker.js +33 -37
  137. package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
  138. package/dist/components/ColorPicker/ColorPicker.module.css.cjs +1 -1
  139. package/dist/components/ColorPicker/ColorPicker.module.css.js +9 -10
  140. package/dist/components/ColorPicker.cjs +1 -1
  141. package/dist/components/ColumnView/ColumnView.cjs +1 -1
  142. package/dist/components/ColumnView/ColumnView.cjs.map +1 -1
  143. package/dist/components/ColumnView/ColumnView.d.ts +1 -1
  144. package/dist/components/ColumnView/ColumnView.js +24 -28
  145. package/dist/components/ColumnView/ColumnView.js.map +1 -1
  146. package/dist/components/ColumnView.cjs +1 -1
  147. package/dist/components/ComboRow/ComboRow.cjs +1 -1
  148. package/dist/components/ComboRow/ComboRow.cjs.map +1 -1
  149. package/dist/components/ComboRow/ComboRow.d.ts +1 -1
  150. package/dist/components/ComboRow/ComboRow.js +2 -2
  151. package/dist/components/ComboRow/ComboRow.js.map +1 -1
  152. package/dist/components/ComboRow/ComboRow.module.css.cjs +1 -1
  153. package/dist/components/ComboRow/ComboRow.module.css.js +24 -25
  154. package/dist/components/ComboRow.cjs +1 -1
  155. package/dist/components/ContributionGraph/ContributionGraph.cjs +1 -1
  156. package/dist/components/ContributionGraph/ContributionGraph.cjs.map +1 -1
  157. package/dist/components/ContributionGraph/ContributionGraph.d.ts +1 -1
  158. package/dist/components/ContributionGraph/ContributionGraph.js +2 -2
  159. package/dist/components/ContributionGraph/ContributionGraph.js.map +1 -1
  160. package/dist/components/ContributionGraph.cjs +1 -1
  161. package/dist/components/CountDownTimer/CountDownTimer.cjs +1 -1
  162. package/dist/components/CountDownTimer/CountDownTimer.cjs.map +1 -1
  163. package/dist/components/CountDownTimer/CountDownTimer.d.ts +1 -1
  164. package/dist/components/CountDownTimer/CountDownTimer.js +2 -2
  165. package/dist/components/CountDownTimer/CountDownTimer.js.map +1 -1
  166. package/dist/components/CountDownTimer.cjs +1 -1
  167. package/dist/components/Dialog/Dialog.cjs +1 -1
  168. package/dist/components/Dialog/Dialog.cjs.map +1 -1
  169. package/dist/components/Dialog/Dialog.d.ts +1 -1
  170. package/dist/components/Dialog/Dialog.js +51 -52
  171. package/dist/components/Dialog/Dialog.js.map +1 -1
  172. package/dist/components/Dialog/Dialog.module.css.cjs +1 -1
  173. package/dist/components/Dialog/Dialog.module.css.js +8 -9
  174. package/dist/components/Dialog/dialogUtils.cjs +1 -1
  175. package/dist/components/Dialog/dialogUtils.cjs.map +1 -1
  176. package/dist/components/Dialog/dialogUtils.d.ts +6 -0
  177. package/dist/components/Dialog/dialogUtils.js +11 -2
  178. package/dist/components/Dialog/dialogUtils.js.map +1 -1
  179. package/dist/components/Dialog.cjs +1 -1
  180. package/dist/components/Drawer/Drawer.cjs +1 -1
  181. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  182. package/dist/components/Drawer/Drawer.d.ts +1 -1
  183. package/dist/components/Drawer/Drawer.js +2 -2
  184. package/dist/components/Drawer/Drawer.js.map +1 -1
  185. package/dist/components/Drawer/Drawer.module.css.cjs +1 -1
  186. package/dist/components/Drawer/Drawer.module.css.js +11 -12
  187. package/dist/components/Drawer.cjs +1 -1
  188. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  189. package/dist/components/Dropdown/Dropdown.cjs.map +1 -1
  190. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  191. package/dist/components/Dropdown/Dropdown.js +89 -85
  192. package/dist/components/Dropdown/Dropdown.js.map +1 -1
  193. package/dist/components/Dropdown/Dropdown.module.css.cjs +1 -1
  194. package/dist/components/Dropdown/Dropdown.module.css.js +20 -21
  195. package/dist/components/Dropdown.cjs +1 -1
  196. package/dist/components/EntryRow/EntryRow.cjs +1 -1
  197. package/dist/components/EntryRow/EntryRow.cjs.map +1 -1
  198. package/dist/components/EntryRow/EntryRow.d.ts +1 -1
  199. package/dist/components/EntryRow/EntryRow.js +2 -2
  200. package/dist/components/EntryRow/EntryRow.js.map +1 -1
  201. package/dist/components/EntryRow.cjs +1 -1
  202. package/dist/components/ExpanderRow/ExpanderRow.cjs +1 -1
  203. package/dist/components/ExpanderRow/ExpanderRow.cjs.map +1 -1
  204. package/dist/components/ExpanderRow/ExpanderRow.d.ts +1 -1
  205. package/dist/components/ExpanderRow/ExpanderRow.js +2 -2
  206. package/dist/components/ExpanderRow/ExpanderRow.js.map +1 -1
  207. package/dist/components/ExpanderRow.cjs +1 -1
  208. package/dist/components/Footer/Footer.cjs +1 -1
  209. package/dist/components/Footer/Footer.cjs.map +1 -1
  210. package/dist/components/Footer/Footer.d.ts +1 -1
  211. package/dist/components/Footer/Footer.js +22 -24
  212. package/dist/components/Footer/Footer.js.map +1 -1
  213. package/dist/components/Footer.cjs +1 -1
  214. package/dist/components/Frame/Frame.cjs +1 -1
  215. package/dist/components/Frame/Frame.cjs.map +1 -1
  216. package/dist/components/Frame/Frame.d.ts +1 -1
  217. package/dist/components/Frame/Frame.js +5 -7
  218. package/dist/components/Frame/Frame.js.map +1 -1
  219. package/dist/components/Frame.cjs +1 -1
  220. package/dist/components/GnomeProvider/GnomeContext.cjs +1 -1
  221. package/dist/components/GnomeProvider/GnomeContext.cjs.map +1 -1
  222. package/dist/components/GnomeProvider/GnomeContext.js.map +1 -1
  223. package/dist/components/GnomeProvider/GnomeProvider.cjs +1 -1
  224. package/dist/components/GnomeProvider/GnomeProvider.cjs.map +1 -1
  225. package/dist/components/GnomeProvider/GnomeProvider.d.ts +1 -1
  226. package/dist/components/GnomeProvider/GnomeProvider.js +2 -2
  227. package/dist/components/GnomeProvider/GnomeProvider.js.map +1 -1
  228. package/dist/components/HeaderBar/HeaderBar.cjs +1 -1
  229. package/dist/components/HeaderBar/HeaderBar.cjs.map +1 -1
  230. package/dist/components/HeaderBar/HeaderBar.d.ts +1 -1
  231. package/dist/components/HeaderBar/HeaderBar.js +26 -28
  232. package/dist/components/HeaderBar/HeaderBar.js.map +1 -1
  233. package/dist/components/HeaderBar.cjs +1 -1
  234. package/dist/components/Icon/Icon.cjs +1 -1
  235. package/dist/components/Icon/Icon.cjs.map +1 -1
  236. package/dist/components/Icon/Icon.d.ts +1 -1
  237. package/dist/components/Icon/Icon.js +2 -2
  238. package/dist/components/Icon/Icon.js.map +1 -1
  239. package/dist/components/Icon.cjs +1 -1
  240. package/dist/components/IconButton/IconButton.cjs +1 -1
  241. package/dist/components/IconButton/IconButton.cjs.map +1 -1
  242. package/dist/components/IconButton/IconButton.js +4 -4
  243. package/dist/components/IconButton/IconButton.js.map +1 -1
  244. package/dist/components/IconButton.cjs +1 -1
  245. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs +1 -1
  246. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs.map +1 -1
  247. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.d.ts +1 -1
  248. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js +2 -2
  249. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js.map +1 -1
  250. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs +1 -1
  251. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs.map +1 -1
  252. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.d.ts +1 -1
  253. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js +2 -2
  254. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js.map +1 -1
  255. package/dist/components/InlineViewSwitcher.cjs +1 -1
  256. package/dist/components/Link/Link.cjs +1 -1
  257. package/dist/components/Link/Link.cjs.map +1 -1
  258. package/dist/components/Link/Link.d.ts +1 -1
  259. package/dist/components/Link/Link.js +2 -2
  260. package/dist/components/Link/Link.js.map +1 -1
  261. package/dist/components/Link.cjs +1 -1
  262. package/dist/components/LinkedGroup/LinkedGroup.cjs +1 -1
  263. package/dist/components/LinkedGroup/LinkedGroup.cjs.map +1 -1
  264. package/dist/components/LinkedGroup/LinkedGroup.d.ts +1 -1
  265. package/dist/components/LinkedGroup/LinkedGroup.js +9 -11
  266. package/dist/components/LinkedGroup/LinkedGroup.js.map +1 -1
  267. package/dist/components/LinkedGroup.cjs +1 -1
  268. package/dist/components/NavigationSplitView/NavigationSplitView.cjs +1 -1
  269. package/dist/components/NavigationSplitView/NavigationSplitView.cjs.map +1 -1
  270. package/dist/components/NavigationSplitView/NavigationSplitView.d.ts +1 -1
  271. package/dist/components/NavigationSplitView/NavigationSplitView.js +2 -2
  272. package/dist/components/NavigationSplitView/NavigationSplitView.js.map +1 -1
  273. package/dist/components/NavigationSplitView.cjs +1 -1
  274. package/dist/components/NavigationView/NavigationView.cjs +1 -1
  275. package/dist/components/NavigationView/NavigationView.cjs.map +1 -1
  276. package/dist/components/NavigationView/NavigationView.d.ts +2 -2
  277. package/dist/components/NavigationView/NavigationView.js +3 -4
  278. package/dist/components/NavigationView/NavigationView.js.map +1 -1
  279. package/dist/components/NavigationView/NavigationView.module.css.cjs +1 -1
  280. package/dist/components/NavigationView/NavigationView.module.css.js +9 -10
  281. package/dist/components/NavigationView.cjs +1 -1
  282. package/dist/components/OverlaySplitView/OverlaySplitView.cjs +1 -1
  283. package/dist/components/OverlaySplitView/OverlaySplitView.cjs.map +1 -1
  284. package/dist/components/OverlaySplitView/OverlaySplitView.d.ts +1 -1
  285. package/dist/components/OverlaySplitView/OverlaySplitView.js +2 -2
  286. package/dist/components/OverlaySplitView/OverlaySplitView.js.map +1 -1
  287. package/dist/components/OverlaySplitView.cjs +1 -1
  288. package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs +1 -1
  289. package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs.map +1 -1
  290. package/dist/components/PasswordEntryRow/PasswordEntryRow.d.ts +1 -1
  291. package/dist/components/PasswordEntryRow/PasswordEntryRow.js +11 -10
  292. package/dist/components/PasswordEntryRow/PasswordEntryRow.js.map +1 -1
  293. package/dist/components/PasswordEntryRow.cjs +1 -1
  294. package/dist/components/PathBar/PathBar.cjs +1 -1
  295. package/dist/components/PathBar/PathBar.cjs.map +1 -1
  296. package/dist/components/PathBar/PathBar.d.ts +1 -1
  297. package/dist/components/PathBar/PathBar.js +48 -50
  298. package/dist/components/PathBar/PathBar.js.map +1 -1
  299. package/dist/components/PathBar.cjs +1 -1
  300. package/dist/components/Popover/Popover.cjs +1 -1
  301. package/dist/components/Popover/Popover.cjs.map +1 -1
  302. package/dist/components/Popover/Popover.d.ts +1 -1
  303. package/dist/components/Popover/Popover.js +5 -5
  304. package/dist/components/Popover/Popover.js.map +1 -1
  305. package/dist/components/Popover.cjs +1 -1
  306. package/dist/components/PreferencesDialog/PreferencesDialog.cjs +1 -1
  307. package/dist/components/PreferencesDialog/PreferencesDialog.cjs.map +1 -1
  308. package/dist/components/PreferencesDialog/PreferencesDialog.d.ts +1 -1
  309. package/dist/components/PreferencesDialog/PreferencesDialog.js +2 -2
  310. package/dist/components/PreferencesDialog/PreferencesDialog.js.map +1 -1
  311. package/dist/components/PreferencesDialog/PreferencesDialog.module.css.cjs +1 -1
  312. package/dist/components/PreferencesDialog/PreferencesDialog.module.css.js +18 -19
  313. package/dist/components/PreferencesDialog.cjs +1 -1
  314. package/dist/components/PreferencesGroup/PreferencesGroup.cjs +1 -1
  315. package/dist/components/PreferencesGroup/PreferencesGroup.cjs.map +1 -1
  316. package/dist/components/PreferencesGroup/PreferencesGroup.d.ts +1 -1
  317. package/dist/components/PreferencesGroup/PreferencesGroup.js +2 -2
  318. package/dist/components/PreferencesGroup/PreferencesGroup.js.map +1 -1
  319. package/dist/components/PreferencesGroup.cjs +1 -1
  320. package/dist/components/PreferencesPage/PreferencesPage.cjs +1 -1
  321. package/dist/components/PreferencesPage/PreferencesPage.cjs.map +1 -1
  322. package/dist/components/PreferencesPage/PreferencesPage.d.ts +1 -1
  323. package/dist/components/PreferencesPage/PreferencesPage.js +9 -11
  324. package/dist/components/PreferencesPage/PreferencesPage.js.map +1 -1
  325. package/dist/components/PreferencesPage.cjs +1 -1
  326. package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
  327. package/dist/components/ProgressBar/ProgressBar.cjs.map +1 -1
  328. package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
  329. package/dist/components/ProgressBar/ProgressBar.js +2 -2
  330. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  331. package/dist/components/ProgressBar.cjs +1 -1
  332. package/dist/components/RadioButton/RadioButton.cjs +1 -1
  333. package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
  334. package/dist/components/RadioButton/RadioButton.d.ts +1 -1
  335. package/dist/components/RadioButton/RadioButton.js +5 -7
  336. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  337. package/dist/components/RadioButton.cjs +1 -1
  338. package/dist/components/SearchBar/SearchBar.cjs +1 -1
  339. package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
  340. package/dist/components/SearchBar/SearchBar.d.ts +1 -1
  341. package/dist/components/SearchBar/SearchBar.js +2 -2
  342. package/dist/components/SearchBar/SearchBar.js.map +1 -1
  343. package/dist/components/SearchBar.cjs +1 -1
  344. package/dist/components/SegmentedBar/SegmentedBar.cjs +1 -1
  345. package/dist/components/SegmentedBar/SegmentedBar.cjs.map +1 -1
  346. package/dist/components/SegmentedBar/SegmentedBar.js.map +1 -1
  347. package/dist/components/SegmentedBar.cjs +1 -1
  348. package/dist/components/Separator/Separator.cjs +1 -1
  349. package/dist/components/Separator/Separator.cjs.map +1 -1
  350. package/dist/components/Separator/Separator.d.ts +1 -1
  351. package/dist/components/Separator/Separator.js +2 -2
  352. package/dist/components/Separator/Separator.js.map +1 -1
  353. package/dist/components/Separator.cjs +1 -1
  354. package/dist/components/ShortcutLabel/ShortcutLabel.cjs +1 -1
  355. package/dist/components/ShortcutLabel/ShortcutLabel.cjs.map +1 -1
  356. package/dist/components/ShortcutLabel/ShortcutLabel.d.ts +1 -1
  357. package/dist/components/ShortcutLabel/ShortcutLabel.js +2 -3
  358. package/dist/components/ShortcutLabel/ShortcutLabel.js.map +1 -1
  359. package/dist/components/ShortcutLabel.cjs +1 -1
  360. package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs +1 -1
  361. package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs.map +1 -1
  362. package/dist/components/ShortcutsDialog/ShortcutsDialog.d.ts +1 -1
  363. package/dist/components/ShortcutsDialog/ShortcutsDialog.js +75 -76
  364. package/dist/components/ShortcutsDialog/ShortcutsDialog.js.map +1 -1
  365. package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.cjs +1 -1
  366. package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.js +21 -22
  367. package/dist/components/ShortcutsDialog.cjs +1 -1
  368. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  369. package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
  370. package/dist/components/Sidebar/Sidebar.d.ts +1 -1
  371. package/dist/components/Sidebar/Sidebar.js +2 -3
  372. package/dist/components/Sidebar/Sidebar.js.map +1 -1
  373. package/dist/components/Sidebar/Sidebar.module.css.cjs +1 -1
  374. package/dist/components/Sidebar/Sidebar.module.css.js +33 -34
  375. package/dist/components/Sidebar/SidebarItem.cjs +1 -1
  376. package/dist/components/Sidebar/SidebarItem.cjs.map +1 -1
  377. package/dist/components/Sidebar/SidebarItem.d.ts +1 -1
  378. package/dist/components/Sidebar/SidebarItem.js +16 -16
  379. package/dist/components/Sidebar/SidebarItem.js.map +1 -1
  380. package/dist/components/Sidebar/SidebarSection.cjs +1 -1
  381. package/dist/components/Sidebar/SidebarSection.cjs.map +1 -1
  382. package/dist/components/Sidebar/SidebarSection.js.map +1 -1
  383. package/dist/components/Sidebar.cjs +1 -1
  384. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  385. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  386. package/dist/components/Skeleton/Skeleton.d.ts +1 -1
  387. package/dist/components/Skeleton/Skeleton.js +9 -10
  388. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  389. package/dist/components/Skeleton.cjs +1 -1
  390. package/dist/components/Slider/Slider.cjs +1 -1
  391. package/dist/components/Slider/Slider.cjs.map +1 -1
  392. package/dist/components/Slider/Slider.d.ts +1 -1
  393. package/dist/components/Slider/Slider.js +2 -2
  394. package/dist/components/Slider/Slider.js.map +1 -1
  395. package/dist/components/Slider.cjs +1 -1
  396. package/dist/components/SpinButton/SpinButton.cjs +1 -1
  397. package/dist/components/SpinButton/SpinButton.cjs.map +1 -1
  398. package/dist/components/SpinButton/SpinButton.d.ts +1 -1
  399. package/dist/components/SpinButton/SpinButton.js +2 -2
  400. package/dist/components/SpinButton/SpinButton.js.map +1 -1
  401. package/dist/components/SpinButton.cjs +1 -1
  402. package/dist/components/SpinRow/SpinRow.cjs +1 -1
  403. package/dist/components/SpinRow/SpinRow.cjs.map +1 -1
  404. package/dist/components/SpinRow/SpinRow.d.ts +1 -1
  405. package/dist/components/SpinRow/SpinRow.js +2 -2
  406. package/dist/components/SpinRow/SpinRow.js.map +1 -1
  407. package/dist/components/SpinRow.cjs +1 -1
  408. package/dist/components/Spinner/Spinner.cjs +1 -1
  409. package/dist/components/Spinner/Spinner.cjs.map +1 -1
  410. package/dist/components/Spinner/Spinner.d.ts +1 -1
  411. package/dist/components/Spinner/Spinner.js +2 -2
  412. package/dist/components/Spinner/Spinner.js.map +1 -1
  413. package/dist/components/Spinner.cjs +1 -1
  414. package/dist/components/SplitButton/SplitButton.cjs +1 -1
  415. package/dist/components/SplitButton/SplitButton.cjs.map +1 -1
  416. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  417. package/dist/components/SplitButton/SplitButton.js +2 -2
  418. package/dist/components/SplitButton/SplitButton.js.map +1 -1
  419. package/dist/components/SplitButton.cjs +1 -1
  420. package/dist/components/StatusBadge/StatusBadge.cjs +1 -1
  421. package/dist/components/StatusBadge/StatusBadge.cjs.map +1 -1
  422. package/dist/components/StatusBadge/StatusBadge.d.ts +1 -1
  423. package/dist/components/StatusBadge/StatusBadge.js +9 -11
  424. package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
  425. package/dist/components/StatusBadge.cjs +1 -1
  426. package/dist/components/StatusPage/StatusPage.cjs +1 -1
  427. package/dist/components/StatusPage/StatusPage.cjs.map +1 -1
  428. package/dist/components/StatusPage/StatusPage.d.ts +1 -1
  429. package/dist/components/StatusPage/StatusPage.js +2 -2
  430. package/dist/components/StatusPage/StatusPage.js.map +1 -1
  431. package/dist/components/StatusPage.cjs +1 -1
  432. package/dist/components/Switch/Switch.cjs +1 -1
  433. package/dist/components/Switch/Switch.cjs.map +1 -1
  434. package/dist/components/Switch/Switch.d.ts +1 -1
  435. package/dist/components/Switch/Switch.js +6 -8
  436. package/dist/components/Switch/Switch.js.map +1 -1
  437. package/dist/components/Switch.cjs +1 -1
  438. package/dist/components/SwitchRow/SwitchRow.cjs +1 -1
  439. package/dist/components/SwitchRow/SwitchRow.cjs.map +1 -1
  440. package/dist/components/SwitchRow/SwitchRow.d.ts +1 -1
  441. package/dist/components/SwitchRow/SwitchRow.js +7 -7
  442. package/dist/components/SwitchRow/SwitchRow.js.map +1 -1
  443. package/dist/components/SwitchRow.cjs +1 -1
  444. package/dist/components/Tabs/TabBar.cjs +1 -1
  445. package/dist/components/Tabs/TabBar.cjs.map +1 -1
  446. package/dist/components/Tabs/TabBar.d.ts +1 -1
  447. package/dist/components/Tabs/TabBar.js +2 -2
  448. package/dist/components/Tabs/TabBar.js.map +1 -1
  449. package/dist/components/Tabs/TabItem.cjs +1 -1
  450. package/dist/components/Tabs/TabItem.cjs.map +1 -1
  451. package/dist/components/Tabs/TabItem.js.map +1 -1
  452. package/dist/components/Tabs/TabPanel.cjs +1 -1
  453. package/dist/components/Tabs/TabPanel.cjs.map +1 -1
  454. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  455. package/dist/components/Tabs/TabPanel.js +8 -10
  456. package/dist/components/Tabs/TabPanel.js.map +1 -1
  457. package/dist/components/Tabs.cjs +1 -1
  458. package/dist/components/TerminalView/TerminalView.cjs +1 -1
  459. package/dist/components/TerminalView/TerminalView.cjs.map +1 -1
  460. package/dist/components/TerminalView/TerminalView.d.ts +1 -1
  461. package/dist/components/TerminalView/TerminalView.js +2 -2
  462. package/dist/components/TerminalView/TerminalView.js.map +1 -1
  463. package/dist/components/TerminalView.cjs +1 -1
  464. package/dist/components/Text/Text.cjs +1 -1
  465. package/dist/components/Text/Text.cjs.map +1 -1
  466. package/dist/components/Text/Text.d.ts +1 -1
  467. package/dist/components/Text/Text.js +10 -13
  468. package/dist/components/Text/Text.js.map +1 -1
  469. package/dist/components/Text/Text.module.css.cjs +1 -1
  470. package/dist/components/Text/Text.module.css.js +9 -10
  471. package/dist/components/Text.cjs +1 -1
  472. package/dist/components/TextField/TextField.cjs +1 -1
  473. package/dist/components/TextField/TextField.cjs.map +1 -1
  474. package/dist/components/TextField/TextField.d.ts +1 -1
  475. package/dist/components/TextField/TextField.js +2 -2
  476. package/dist/components/TextField/TextField.js.map +1 -1
  477. package/dist/components/TextField.cjs +1 -1
  478. package/dist/components/Timeline/Timeline.cjs +1 -1
  479. package/dist/components/Timeline/Timeline.cjs.map +1 -1
  480. package/dist/components/Timeline/Timeline.d.ts +1 -1
  481. package/dist/components/Timeline/Timeline.js +2 -2
  482. package/dist/components/Timeline/Timeline.js.map +1 -1
  483. package/dist/components/Timeline.cjs +1 -1
  484. package/dist/components/Toast/Toast.cjs +1 -1
  485. package/dist/components/Toast/Toast.cjs.map +1 -1
  486. package/dist/components/Toast/Toast.d.ts +1 -1
  487. package/dist/components/Toast/Toast.js +2 -2
  488. package/dist/components/Toast/Toast.js.map +1 -1
  489. package/dist/components/Toast/Toast.module.css.cjs +1 -1
  490. package/dist/components/Toast/Toast.module.css.js +10 -11
  491. package/dist/components/Toast/Toaster.cjs +1 -1
  492. package/dist/components/Toast/Toaster.cjs.map +1 -1
  493. package/dist/components/Toast/Toaster.d.ts +1 -1
  494. package/dist/components/Toast/Toaster.js +2 -2
  495. package/dist/components/Toast/Toaster.js.map +1 -1
  496. package/dist/components/Toast.cjs +1 -1
  497. package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -1
  498. package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
  499. package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -1
  500. package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
  501. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  502. package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -1
  503. package/dist/components/ToggleGroup/ToggleGroupItem.cjs.map +1 -1
  504. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
  505. package/dist/components/ToggleGroup/ToggleGroupItem.js +2 -2
  506. package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
  507. package/dist/components/ToggleGroup.cjs +1 -1
  508. package/dist/components/Toolbar/Spacer.cjs +1 -1
  509. package/dist/components/Toolbar/Spacer.cjs.map +1 -1
  510. package/dist/components/Toolbar/Spacer.d.ts +1 -1
  511. package/dist/components/Toolbar/Spacer.js +5 -7
  512. package/dist/components/Toolbar/Spacer.js.map +1 -1
  513. package/dist/components/Toolbar/Toolbar.cjs +1 -1
  514. package/dist/components/Toolbar/Toolbar.cjs.map +1 -1
  515. package/dist/components/Toolbar/Toolbar.d.ts +1 -1
  516. package/dist/components/Toolbar/Toolbar.js +5 -7
  517. package/dist/components/Toolbar/Toolbar.js.map +1 -1
  518. package/dist/components/Toolbar.cjs +1 -1
  519. package/dist/components/ToolbarView/ToolbarView.cjs +1 -1
  520. package/dist/components/ToolbarView/ToolbarView.cjs.map +1 -1
  521. package/dist/components/ToolbarView/ToolbarView.d.ts +1 -1
  522. package/dist/components/ToolbarView/ToolbarView.js +18 -20
  523. package/dist/components/ToolbarView/ToolbarView.js.map +1 -1
  524. package/dist/components/ToolbarView.cjs +1 -1
  525. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  526. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  527. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  528. package/dist/components/Tooltip/Tooltip.js +2 -2
  529. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  530. package/dist/components/Tooltip.cjs +1 -1
  531. package/dist/components/ViewSwitcher/ViewSwitcher.cjs +1 -1
  532. package/dist/components/ViewSwitcher/ViewSwitcher.cjs.map +1 -1
  533. package/dist/components/ViewSwitcher/ViewSwitcher.d.ts +1 -1
  534. package/dist/components/ViewSwitcher/ViewSwitcher.js +2 -2
  535. package/dist/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
  536. package/dist/components/ViewSwitcher/ViewSwitcherItem.cjs +1 -1
  537. package/dist/components/ViewSwitcher/ViewSwitcherItem.cjs.map +1 -1
  538. package/dist/components/ViewSwitcher/ViewSwitcherItem.d.ts +1 -1
  539. package/dist/components/ViewSwitcher/ViewSwitcherItem.js +24 -26
  540. package/dist/components/ViewSwitcher/ViewSwitcherItem.js.map +1 -1
  541. package/dist/components/ViewSwitcher.cjs +1 -1
  542. package/dist/components/ViewSwitcherBar/ViewSwitcherBar.cjs +1 -1
  543. package/dist/components/ViewSwitcherBar/ViewSwitcherBar.cjs.map +1 -1
  544. package/dist/components/ViewSwitcherBar/ViewSwitcherBar.d.ts +1 -1
  545. package/dist/components/ViewSwitcherBar/ViewSwitcherBar.js +7 -9
  546. package/dist/components/ViewSwitcherBar/ViewSwitcherBar.js.map +1 -1
  547. package/dist/components/ViewSwitcherBar.cjs +1 -1
  548. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs +1 -1
  549. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs.map +1 -1
  550. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.d.ts +1 -1
  551. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js +2 -2
  552. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js.map +1 -1
  553. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.cjs +1 -1
  554. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.cjs.map +1 -1
  555. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.d.ts +1 -1
  556. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.js +2 -2
  557. package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.js.map +1 -1
  558. package/dist/components/ViewSwitcherSidebar.cjs +1 -1
  559. package/dist/components/WindowTitle/WindowTitle.cjs +1 -1
  560. package/dist/components/WindowTitle/WindowTitle.cjs.map +1 -1
  561. package/dist/components/WindowTitle/WindowTitle.d.ts +1 -1
  562. package/dist/components/WindowTitle/WindowTitle.js +11 -13
  563. package/dist/components/WindowTitle/WindowTitle.js.map +1 -1
  564. package/dist/components/WindowTitle.cjs +1 -1
  565. package/dist/components/WrapBox/WrapBox.cjs +1 -1
  566. package/dist/components/WrapBox/WrapBox.cjs.map +1 -1
  567. package/dist/components/WrapBox/WrapBox.d.ts +1 -1
  568. package/dist/components/WrapBox/WrapBox.js +5 -5
  569. package/dist/components/WrapBox/WrapBox.js.map +1 -1
  570. package/dist/components/WrapBox.cjs +1 -1
  571. package/dist/hooks/useBreakpoint.cjs +1 -1
  572. package/dist/hooks/useBreakpoint.cjs.map +1 -1
  573. package/dist/hooks/useBreakpoint.js.map +1 -1
  574. package/dist/hooks.cjs +1 -1
  575. package/dist/index.cjs +1 -1
  576. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","names":[],"sources":["../../../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import type { InputHTMLAttributes } from 'react';\n\nimport styles from './RadioButton.module.css';\n\nexport interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /** Accessible label. Required when no visible `<label>` is associated. */\n 'aria-label'?: string;\n}\n\n/**\n * Single-selection radio button following the GNOME HIG and Adwaita style.\n *\n * Group radio buttons by giving them the same `name` attribute.\n * Renders as `<input type=\"radio\">` — natively keyboard-accessible\n * (arrow keys cycle within the group) and compatible with standard form libraries.\n *\n * @see https://developer.gnome.org/hig/patterns/controls/radio-buttons.html\n */\nexport function RadioButton({ className, ...props }: RadioButtonProps) {\n return (\n <input\n type=\"radio\"\n className={[styles.radio, className].filter(Boolean).join(' ')}\n {...props}\n />\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAY,EAAE,cAAW,GAAG,KAA2B;AACrE,QACE,kBAAC,SAAD;EACE,MAAK;EACL,WAAW,CAAC,EAAO,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAC9D,GAAI;EACJ,CAAA"}
1
+ {"version":3,"file":"RadioButton.js","names":[],"sources":["../../../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import type { InputHTMLAttributes } from 'react';\n\nimport styles from './RadioButton.module.css';\n\nexport interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /** Accessible label. Required when no visible `<label>` is associated. */\n 'aria-label'?: string;\n}\n\n/**\n * Single-selection radio button following the GNOME HIG and Adwaita style.\n *\n * Group radio buttons by giving them the same `name` attribute.\n * Renders as `<input type=\"radio\">` — natively keyboard-accessible\n * (arrow keys cycle within the group) and compatible with standard form libraries.\n *\n * @see https://developer.gnome.org/hig/patterns/controls/radio-buttons.html\n */\nexport const RadioButton = ({ className, ...props }: RadioButtonProps) => {\n return (\n <input\n type=\"radio\"\n className={[styles.radio, className].filter(Boolean).join(' ')}\n {...props}\n />\n );\n};\n"],"mappings":";;;AAkBA,IAAa,KAAe,EAAE,cAAW,GAAG,QAExC,kBAAC,SAAD;CACE,MAAK;CACL,WAAW,CAAC,EAAO,OAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CAC7D,GAAI;AACL,CAAA"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./RadioButton/RadioButton.cjs`);exports.RadioButton=e.RadioButton;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./RadioButton/RadioButton.cjs");exports.RadioButton=e.RadioButton;
@@ -1,2 +1,2 @@
1
- const e=require(`../Icon/Icon.cjs`),t=require(`../Spinner/Spinner.cjs`),n=require(`./SearchBar.module.css.cjs`);let r=require(`react`),i=require(`react-dom`),a=require(`react/jsx-runtime`),o=require(`@gnome-ui/icons`);function s({open:s,onClose:c,onClear:l,children:u,value:d,onChange:f,placeholder:p=`Search…`,disabled:m,inline:h=!1,className:g,suggestions:_,onSuggestionSelect:v,loadingSuggestions:y=!1,renderSuggestion:b,suggestionsLabel:x=`Suggestions`,...S}){let C=(0,r.useRef)(null),w=(0,r.useRef)(null),T=(0,r.useRef)(null),E=(0,r.useId)(),D=(0,r.useId)(),[O,k]=(0,r.useState)(-1),[A,j]=(0,r.useState)(null),M=(_?.length??0)>0,N=s&&(y||M);(0,r.useEffect)(()=>{k(-1)},[]),(0,r.useEffect)(()=>{if(s){let e=requestAnimationFrame(()=>C.current?.focus());return()=>cancelAnimationFrame(e)}},[s]),(0,r.useEffect)(()=>{if(!N||!w.current){j(null);return}function e(){if(!w.current)return;let e=w.current.getBoundingClientRect();j({top:e.bottom,left:e.left,width:e.width})}return e(),window.addEventListener(`scroll`,e,{passive:!0,capture:!0}),window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)}},[N]),(0,r.useEffect)(()=>{O<0||!T.current||T.current.children[O]?.scrollIntoView({block:`nearest`})},[O]);let P=(0,r.useCallback)(e=>{if(N&&M&&_){if(e.key===`ArrowDown`){e.preventDefault(),k(e=>Math.min(e+1,_.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),k(e=>Math.max(e-1,-1));return}if(e.key===`Enter`&&O>=0){e.preventDefault(),v?.(_[O]);return}}e.key===`Escape`&&(e.preventDefault(),c?.()),S.onKeyDown?.(e)},[c,S,N,M,_,O,v]),F=d!==void 0&&d!==``,I=O>=0&&_?.[O]?`${D}-${_[O].id}`:void 0,L=N&&A?(0,i.createPortal)((0,a.jsxs)(`ul`,{ref:T,"aria-label":x,id:E,className:n.default.suggestionsPanel,style:{top:A.top,left:A.left,width:A.width},onMouseDown:e=>e.preventDefault(),children:[y&&(0,a.jsx)(`li`,{role:`presentation`,className:n.default.suggestionsLoading,children:(0,a.jsx)(t.Spinner,{size:`sm`,label:`Loading suggestions…`})}),!y&&_?.map((e,t)=>(0,a.jsx)(`li`,{id:`${D}-${e.id}`,"aria-selected":t===O,className:[n.default.suggestionItem,t===O?n.default.suggestionItemActive:null].filter(Boolean).join(` `),onMouseEnter:()=>k(t),onMouseLeave:()=>k(-1),onClick:()=>v?.(e),children:b?b(e):e.label},e.id))]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`div`,{ref:w,className:[n.default.wrapper,s?n.default.open:null,g].filter(Boolean).join(` `),"aria-hidden":!s,children:[(0,a.jsxs)(`div`,{className:[n.default.bar,h?n.default.inline:null,m?n.default.disabled:null].filter(Boolean).join(` `),children:[(0,a.jsx)(`span`,{className:n.default.searchIcon,"aria-hidden":!0,children:(0,a.jsx)(e.Icon,{icon:o.Search,size:`md`})}),(0,a.jsx)(`input`,{ref:C,type:`search`,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?E:void 0,"aria-activedescendant":I,value:d,onChange:f,placeholder:p,disabled:m,tabIndex:s?void 0:-1,className:n.default.input,onKeyDown:P,...S}),F&&(0,a.jsx)(`button`,{type:`button`,className:n.default.clearButton,"aria-label":`Clear search`,tabIndex:s?void 0:-1,disabled:m,onClick:()=>{l?.(),C.current?.focus()},children:(0,a.jsx)(e.Icon,{icon:o.Close,size:`md`})})]}),u&&(0,a.jsx)(`div`,{className:n.default.filterRow,children:u})]}),typeof document<`u`&&L]})}exports.SearchBar=s;
1
+ const e=require("../Icon/Icon.cjs"),t=require("../Spinner/Spinner.cjs"),n=require("./SearchBar.module.css.cjs");let r=require("react"),i=require("react-dom"),a=require("react/jsx-runtime"),o=require("@gnome-ui/icons");var s=({open:s,onClose:c,onClear:l,children:u,value:d,onChange:f,placeholder:p=`Search…`,disabled:m,inline:h=!1,className:g,suggestions:_,onSuggestionSelect:v,loadingSuggestions:y=!1,renderSuggestion:b,suggestionsLabel:x=`Suggestions`,...S})=>{let C=(0,r.useRef)(null),w=(0,r.useRef)(null),T=(0,r.useRef)(null),E=(0,r.useId)(),D=(0,r.useId)(),[O,k]=(0,r.useState)(-1),[A,j]=(0,r.useState)(null),M=(_?.length??0)>0,N=s&&(y||M);(0,r.useEffect)(()=>{k(-1)},[]),(0,r.useEffect)(()=>{if(s){let e=requestAnimationFrame(()=>C.current?.focus());return()=>cancelAnimationFrame(e)}},[s]),(0,r.useEffect)(()=>{if(!N||!w.current){j(null);return}function e(){if(!w.current)return;let e=w.current.getBoundingClientRect();j({top:e.bottom,left:e.left,width:e.width})}return e(),window.addEventListener(`scroll`,e,{passive:!0,capture:!0}),window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)}},[N]),(0,r.useEffect)(()=>{O<0||!T.current||T.current.children[O]?.scrollIntoView({block:`nearest`})},[O]);let P=(0,r.useCallback)(e=>{if(N&&M&&_){if(e.key===`ArrowDown`){e.preventDefault(),k(e=>Math.min(e+1,_.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),k(e=>Math.max(e-1,-1));return}if(e.key===`Enter`&&O>=0){e.preventDefault(),v?.(_[O]);return}}e.key===`Escape`&&(e.preventDefault(),c?.()),S.onKeyDown?.(e)},[c,S,N,M,_,O,v]),F=d!==void 0&&d!==``,I=O>=0&&_?.[O]?`${D}-${_[O].id}`:void 0,L=N&&A?(0,i.createPortal)((0,a.jsxs)(`ul`,{ref:T,"aria-label":x,id:E,className:n.default.suggestionsPanel,style:{top:A.top,left:A.left,width:A.width},onMouseDown:e=>e.preventDefault(),children:[y&&(0,a.jsx)(`li`,{role:`presentation`,className:n.default.suggestionsLoading,children:(0,a.jsx)(t.Spinner,{size:`sm`,label:`Loading suggestions…`})}),!y&&_?.map((e,t)=>(0,a.jsx)(`li`,{id:`${D}-${e.id}`,"aria-selected":t===O,className:[n.default.suggestionItem,t===O?n.default.suggestionItemActive:null].filter(Boolean).join(` `),onMouseEnter:()=>k(t),onMouseLeave:()=>k(-1),onClick:()=>v?.(e),children:b?b(e):e.label},e.id))]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`div`,{ref:w,className:[n.default.wrapper,s?n.default.open:null,g].filter(Boolean).join(` `),"aria-hidden":!s,children:[(0,a.jsxs)(`div`,{className:[n.default.bar,h?n.default.inline:null,m?n.default.disabled:null].filter(Boolean).join(` `),children:[(0,a.jsx)(`span`,{className:n.default.searchIcon,"aria-hidden":!0,children:(0,a.jsx)(e.Icon,{icon:o.Search,size:`md`})}),(0,a.jsx)(`input`,{ref:C,type:`search`,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?E:void 0,"aria-activedescendant":I,value:d,onChange:f,placeholder:p,disabled:m,tabIndex:s?void 0:-1,className:n.default.input,onKeyDown:P,...S}),F&&(0,a.jsx)(`button`,{type:`button`,className:n.default.clearButton,"aria-label":`Clear search`,tabIndex:s?void 0:-1,disabled:m,onClick:()=>{l?.(),C.current?.focus()},children:(0,a.jsx)(e.Icon,{icon:o.Close,size:`md`})})]}),u&&(0,a.jsx)(`div`,{className:n.default.filterRow,children:u})]}),typeof document<`u`&&L]})};exports.SearchBar=s;
2
2
  //# sourceMappingURL=SearchBar.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.cjs","names":[],"sources":["../../../src/components/SearchBar/SearchBar.tsx"],"sourcesContent":["import { Close, Search } from '@gnome-ui/icons';\nimport {\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { Icon } from '../Icon';\nimport { Spinner } from '../Spinner';\n\nimport styles from './SearchBar.module.css';\n\nexport interface Suggestion {\n id: string;\n label: string;\n}\n\nexport interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * Whether the search bar is visible/expanded.\n * When `false` the bar collapses to zero height and is hidden from AT.\n */\n open: boolean;\n /** Called when the user presses Escape or clicks the clear button with empty value. */\n onClose?: () => void;\n /** Called when the clear (×) button is clicked. Also clears the input value. */\n onClear?: () => void;\n /**\n * Content to render below the search bar (e.g. filter chips).\n * Only visible while `open` is true.\n */\n children?: ReactNode;\n /**\n * Removes the header-bar background so the bar blends into any surface.\n * Mirrors the `.inline` style class.\n */\n inline?: boolean;\n /** Suggestion items to show in the autocomplete popover. */\n suggestions?: Suggestion[];\n /** Called when the user selects a suggestion. */\n onSuggestionSelect?: (item: Suggestion) => void;\n /** Shows a spinner inside the suggestions popover while fetching async results. */\n loadingSuggestions?: boolean;\n /** Custom row renderer for each suggestion. */\n renderSuggestion?: (item: Suggestion) => ReactNode;\n /** `aria-label` for the suggestions listbox. Defaults to `\"Suggestions\"`. */\n suggestionsLabel?: string;\n}\n\ninterface DropdownPos {\n top: number;\n left: number;\n width: number;\n}\n\n/**\n * Collapsible search bar following the Adwaita `AdwSearchBar` pattern.\n *\n * - Slides in/out with a CSS height transition.\n * - Auto-focuses the input when `open` becomes `true`.\n * - Escape key calls `onClose`.\n * - Shows a clear (×) button whenever the input has a value.\n * - Optional `suggestions` / `loadingSuggestions` props show an autocomplete\n * popover anchored below the bar — follows the GTK4 pattern of\n * `AdwSearchBar` + `GtkPopover` + `GtkListView` (replaces `GtkEntryCompletion`).\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SearchBar.html\n */\nexport function SearchBar({\n open,\n onClose,\n onClear,\n children,\n value,\n onChange,\n placeholder = 'Search…',\n disabled,\n inline = false,\n className,\n suggestions,\n onSuggestionSelect,\n loadingSuggestions = false,\n renderSuggestion,\n suggestionsLabel = 'Suggestions',\n ...props\n}: SearchBarProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n\n const listboxId = useId();\n const optionIdPrefix = useId();\n\n const [activeIndex, setActiveIndex] = useState(-1);\n const [dropdownPos, setDropdownPos] = useState<DropdownPos | null>(null);\n\n const hasSuggestions = (suggestions?.length ?? 0) > 0;\n const showDropdown = open && (loadingSuggestions || hasSuggestions);\n\n // Reset active index whenever the suggestion list changes\n useEffect(() => {\n setActiveIndex(-1);\n }, []);\n\n // Auto-focus when opening\n useEffect(() => {\n if (open) {\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n\n return () => cancelAnimationFrame(id);\n }\n }, [open]);\n\n // Position the suggestions dropdown below the wrapper\n useEffect(() => {\n if (!showDropdown || !wrapperRef.current) {\n setDropdownPos(null);\n\n return;\n }\n\n function updatePos() {\n if (!wrapperRef.current) {\n return;\n }\n\n const r = wrapperRef.current.getBoundingClientRect();\n\n setDropdownPos({ top: r.bottom, left: r.left, width: r.width });\n }\n updatePos();\n window.addEventListener('scroll', updatePos, { passive: true, capture: true });\n window.addEventListener('resize', updatePos, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', updatePos, { capture: true });\n window.removeEventListener('resize', updatePos);\n };\n }, [showDropdown]);\n\n // Scroll the active option into view\n useEffect(() => {\n if (activeIndex < 0 || !listboxRef.current) {\n return;\n }\n\n (listboxRef.current.children[activeIndex] as HTMLElement | undefined)?.scrollIntoView({\n block: 'nearest',\n });\n }, [activeIndex]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (showDropdown && hasSuggestions && suggestions) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, suggestions.length - 1));\n\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, -1));\n\n return;\n }\n\n if (e.key === 'Enter' && activeIndex >= 0) {\n e.preventDefault();\n onSuggestionSelect?.(suggestions[activeIndex]);\n\n return;\n }\n }\n\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose?.();\n }\n\n props.onKeyDown?.(e);\n },\n [onClose, props, showDropdown, hasSuggestions, suggestions, activeIndex, onSuggestionSelect],\n );\n\n const hasValue = value !== undefined && value !== '';\n const activeOptionId =\n activeIndex >= 0 && suggestions?.[activeIndex]\n ? `${optionIdPrefix}-${suggestions[activeIndex].id}`\n : undefined;\n\n const dropdown =\n showDropdown && dropdownPos\n ? createPortal(\n <ul\n ref={listboxRef}\n aria-label={suggestionsLabel}\n id={listboxId}\n className={styles.suggestionsPanel}\n style={{ top: dropdownPos.top, left: dropdownPos.left, width: dropdownPos.width }}\n onMouseDown={(e) => e.preventDefault()} // keep focus on input\n >\n {loadingSuggestions && (\n <li role=\"presentation\" className={styles.suggestionsLoading}>\n <Spinner size=\"sm\" label=\"Loading suggestions…\" />\n </li>\n )}\n {!loadingSuggestions &&\n suggestions?.map((item, index) => (\n <li\n key={item.id}\n id={`${optionIdPrefix}-${item.id}`}\n aria-selected={index === activeIndex}\n className={[\n styles.suggestionItem,\n index === activeIndex ? styles.suggestionItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => setActiveIndex(index)}\n onMouseLeave={() => setActiveIndex(-1)}\n onClick={() => onSuggestionSelect?.(item)}\n >\n {renderSuggestion ? renderSuggestion(item) : item.label}\n </li>\n ))}\n </ul>,\n document.body,\n )\n : null;\n\n return (\n <>\n <div\n ref={wrapperRef}\n className={[styles.wrapper, open ? styles.open : null, className].filter(Boolean).join(' ')}\n aria-hidden={!open}\n >\n <div\n className={[styles.bar, inline ? styles.inline : null, disabled ? styles.disabled : null]\n .filter(Boolean)\n .join(' ')}\n >\n <span className={styles.searchIcon} aria-hidden>\n <Icon icon={Search} size=\"md\" />\n </span>\n\n <input\n ref={inputRef}\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={showDropdown}\n aria-controls={showDropdown ? listboxId : undefined}\n aria-activedescendant={activeOptionId}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n disabled={disabled}\n tabIndex={open ? undefined : -1}\n className={styles.input}\n onKeyDown={handleKeyDown}\n {...props}\n />\n\n {hasValue && (\n <button\n type=\"button\"\n className={styles.clearButton}\n aria-label=\"Clear search\"\n tabIndex={open ? undefined : -1}\n disabled={disabled}\n onClick={() => {\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n <Icon icon={Close} size=\"md\" />\n </button>\n )}\n </div>\n\n {children && <div className={styles.filterRow}>{children}</div>}\n </div>\n\n {typeof document !== 'undefined' && dropdown}\n </>\n );\n}\n"],"mappings":"0NA0EA,SAAgB,EAAU,CACxB,OACA,UACA,UACA,WACA,QACA,WACA,cAAc,UACd,WACA,SAAS,GACT,YACA,cACA,qBACA,qBAAqB,GACrB,mBACA,mBAAmB,cACnB,GAAG,GACc,CACjB,IAAM,GAAA,EAAA,EAAA,QAAoC,KAAK,CACzC,GAAA,EAAA,EAAA,QAAoC,KAAK,CACzC,GAAA,EAAA,EAAA,QAAsC,KAAK,CAE3C,GAAA,EAAA,EAAA,QAAmB,CACnB,GAAA,EAAA,EAAA,QAAwB,CAExB,CAAC,EAAa,IAAA,EAAA,EAAA,UAA2B,GAAG,CAC5C,CAAC,EAAa,IAAA,EAAA,EAAA,UAA+C,KAAK,CAElE,GAAkB,GAAa,QAAU,GAAK,EAC9C,EAAe,IAAS,GAAsB,IAGpD,EAAA,EAAA,eAAgB,CACd,EAAe,GAAG,EACjB,EAAE,CAAC,EAGN,EAAA,EAAA,eAAgB,CACd,GAAI,EAAM,CACR,IAAM,EAAK,0BAA4B,EAAS,SAAS,OAAO,CAAC,CAEjE,UAAa,qBAAqB,EAAG,GAEtC,CAAC,EAAK,CAAC,EAGV,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,GAAgB,CAAC,EAAW,QAAS,CACxC,EAAe,KAAK,CAEpB,OAGF,SAAS,GAAY,CACnB,GAAI,CAAC,EAAW,QACd,OAGF,IAAM,EAAI,EAAW,Q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,CAAM,KAAM,EAAA,OAAQ,KAAK,KAAO,CAAA,CAC3B,CAAA,EAEP,EAAA,EAAA,KAAC,QAAD,CACE,IAAK,EACL,KAAK,SACL,KAAK,WACL,oBAAkB,OAClB,gBAAe,EACf,gBAAe,EAAe,EAAY,IAAA,GAC1C,wBAAuB,EAChB,QACG,WACG,cACH,WACV,SAAU,EAAO,IAAA,GAAY,GAC7B,UAAW,EAAA,QAAO,MAClB,UAAW,EACX,GAAI,EACJ,CAAA,CAED,IACC,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,YAClB,aAAW,eACX,SAAU,EAAO,IAAA,GAAY,GACnB,WACV,YAAe,CACb,KAAW,CACX,EAAS,SAAS,OAAO,YAG3B,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAM,EAAA,MAAO,KAAK,KAAO,CAAA,CACxB,CAAA,CAEP,GAEL,IAAY,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,UAAY,WAAe,CAAA,CAC3D,GAEL,OAAO,SAAa,KAAe,EACnC,CAAA,CAAA"}
1
+ {"version":3,"file":"SearchBar.cjs","names":[],"sources":["../../../src/components/SearchBar/SearchBar.tsx"],"sourcesContent":["import { Close, Search } from '@gnome-ui/icons';\nimport {\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { Icon } from '../Icon';\nimport { Spinner } from '../Spinner';\n\nimport styles from './SearchBar.module.css';\n\nexport interface Suggestion {\n id: string;\n label: string;\n}\n\nexport interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * Whether the search bar is visible/expanded.\n * When `false` the bar collapses to zero height and is hidden from AT.\n */\n open: boolean;\n /** Called when the user presses Escape or clicks the clear button with empty value. */\n onClose?: () => void;\n /** Called when the clear (×) button is clicked. Also clears the input value. */\n onClear?: () => void;\n /**\n * Content to render below the search bar (e.g. filter chips).\n * Only visible while `open` is true.\n */\n children?: ReactNode;\n /**\n * Removes the header-bar background so the bar blends into any surface.\n * Mirrors the `.inline` style class.\n */\n inline?: boolean;\n /** Suggestion items to show in the autocomplete popover. */\n suggestions?: Suggestion[];\n /** Called when the user selects a suggestion. */\n onSuggestionSelect?: (item: Suggestion) => void;\n /** Shows a spinner inside the suggestions popover while fetching async results. */\n loadingSuggestions?: boolean;\n /** Custom row renderer for each suggestion. */\n renderSuggestion?: (item: Suggestion) => ReactNode;\n /** `aria-label` for the suggestions listbox. Defaults to `\"Suggestions\"`. */\n suggestionsLabel?: string;\n}\n\ninterface DropdownPos {\n top: number;\n left: number;\n width: number;\n}\n\n/**\n * Collapsible search bar following the Adwaita `AdwSearchBar` pattern.\n *\n * - Slides in/out with a CSS height transition.\n * - Auto-focuses the input when `open` becomes `true`.\n * - Escape key calls `onClose`.\n * - Shows a clear (×) button whenever the input has a value.\n * - Optional `suggestions` / `loadingSuggestions` props show an autocomplete\n * popover anchored below the bar — follows the GTK4 pattern of\n * `AdwSearchBar` + `GtkPopover` + `GtkListView` (replaces `GtkEntryCompletion`).\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SearchBar.html\n */\nexport const SearchBar = ({\n open,\n onClose,\n onClear,\n children,\n value,\n onChange,\n placeholder = 'Search…',\n disabled,\n inline = false,\n className,\n suggestions,\n onSuggestionSelect,\n loadingSuggestions = false,\n renderSuggestion,\n suggestionsLabel = 'Suggestions',\n ...props\n}: SearchBarProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n\n const listboxId = useId();\n const optionIdPrefix = useId();\n\n const [activeIndex, setActiveIndex] = useState(-1);\n const [dropdownPos, setDropdownPos] = useState<DropdownPos | null>(null);\n\n const hasSuggestions = (suggestions?.length ?? 0) > 0;\n const showDropdown = open && (loadingSuggestions || hasSuggestions);\n\n // Reset active index whenever the suggestion list changes\n useEffect(() => {\n setActiveIndex(-1);\n }, []);\n\n // Auto-focus when opening\n useEffect(() => {\n if (open) {\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n\n return () => cancelAnimationFrame(id);\n }\n }, [open]);\n\n // Position the suggestions dropdown below the wrapper\n useEffect(() => {\n if (!showDropdown || !wrapperRef.current) {\n setDropdownPos(null);\n\n return;\n }\n\n function updatePos() {\n if (!wrapperRef.current) {\n return;\n }\n\n const r = wrapperRef.current.getBoundingClientRect();\n\n setDropdownPos({ top: r.bottom, left: r.left, width: r.width });\n }\n updatePos();\n window.addEventListener('scroll', updatePos, { passive: true, capture: true });\n window.addEventListener('resize', updatePos, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', updatePos, { capture: true });\n window.removeEventListener('resize', updatePos);\n };\n }, [showDropdown]);\n\n // Scroll the active option into view\n useEffect(() => {\n if (activeIndex < 0 || !listboxRef.current) {\n return;\n }\n\n (listboxRef.current.children[activeIndex] as HTMLElement | undefined)?.scrollIntoView({\n block: 'nearest',\n });\n }, [activeIndex]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (showDropdown && hasSuggestions && suggestions) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, suggestions.length - 1));\n\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, -1));\n\n return;\n }\n\n if (e.key === 'Enter' && activeIndex >= 0) {\n e.preventDefault();\n onSuggestionSelect?.(suggestions[activeIndex]);\n\n return;\n }\n }\n\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose?.();\n }\n\n props.onKeyDown?.(e);\n },\n [onClose, props, showDropdown, hasSuggestions, suggestions, activeIndex, onSuggestionSelect],\n );\n\n const hasValue = value !== undefined && value !== '';\n const activeOptionId =\n activeIndex >= 0 && suggestions?.[activeIndex]\n ? `${optionIdPrefix}-${suggestions[activeIndex].id}`\n : undefined;\n\n const dropdown =\n showDropdown && dropdownPos\n ? createPortal(\n <ul\n ref={listboxRef}\n aria-label={suggestionsLabel}\n id={listboxId}\n className={styles.suggestionsPanel}\n style={{ top: dropdownPos.top, left: dropdownPos.left, width: dropdownPos.width }}\n onMouseDown={(e) => e.preventDefault()} // keep focus on input\n >\n {loadingSuggestions && (\n <li role=\"presentation\" className={styles.suggestionsLoading}>\n <Spinner size=\"sm\" label=\"Loading suggestions…\" />\n </li>\n )}\n {!loadingSuggestions &&\n suggestions?.map((item, index) => (\n <li\n key={item.id}\n id={`${optionIdPrefix}-${item.id}`}\n aria-selected={index === activeIndex}\n className={[\n styles.suggestionItem,\n index === activeIndex ? styles.suggestionItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => setActiveIndex(index)}\n onMouseLeave={() => setActiveIndex(-1)}\n onClick={() => onSuggestionSelect?.(item)}\n >\n {renderSuggestion ? renderSuggestion(item) : item.label}\n </li>\n ))}\n </ul>,\n document.body,\n )\n : null;\n\n return (\n <>\n <div\n ref={wrapperRef}\n className={[styles.wrapper, open ? styles.open : null, className].filter(Boolean).join(' ')}\n aria-hidden={!open}\n >\n <div\n className={[styles.bar, inline ? styles.inline : null, disabled ? styles.disabled : null]\n .filter(Boolean)\n .join(' ')}\n >\n <span className={styles.searchIcon} aria-hidden>\n <Icon icon={Search} size=\"md\" />\n </span>\n\n <input\n ref={inputRef}\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={showDropdown}\n aria-controls={showDropdown ? listboxId : undefined}\n aria-activedescendant={activeOptionId}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n disabled={disabled}\n tabIndex={open ? undefined : -1}\n className={styles.input}\n onKeyDown={handleKeyDown}\n {...props}\n />\n\n {hasValue && (\n <button\n type=\"button\"\n className={styles.clearButton}\n aria-label=\"Clear search\"\n tabIndex={open ? undefined : -1}\n disabled={disabled}\n onClick={() => {\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n <Icon icon={Close} size=\"md\" />\n </button>\n )}\n </div>\n\n {children && <div className={styles.filterRow}>{children}</div>}\n </div>\n\n {typeof document !== 'undefined' && dropdown}\n </>\n );\n};\n"],"mappings":"0NA0EA,IAAa,GAAa,CACxB,OACA,UACA,UACA,WACA,QACA,WACA,cAAc,UACd,WACA,SAAS,GACT,YACA,cACA,qBACA,qBAAqB,GACrB,mBACA,mBAAmB,cACnB,GAAG,KACiB,CACpB,IAAM,GAAA,EAAA,EAAA,QAAoC,IAAI,EACxC,GAAA,EAAA,EAAA,QAAoC,IAAI,EACxC,GAAA,EAAA,EAAA,QAAsC,IAAI,EAE1C,GAAA,EAAA,EAAA,OAAkB,EAClB,GAAA,EAAA,EAAA,OAAuB,EAEvB,CAAC,EAAa,IAAA,EAAA,EAAA,UAA2B,EAAE,EAC3C,CAAC,EAAa,IAAA,EAAA,EAAA,UAA+C,IAAI,EAEjE,GAAkB,GAAa,QAAU,GAAK,EAC9C,EAAe,IAAS,GAAsB,IAGpD,EAAA,EAAA,eAAgB,CACd,EAAe,EAAE,CACnB,EAAG,CAAC,CAAC,GAGL,EAAA,EAAA,eAAgB,CACd,GAAI,EAAM,CACR,IAAM,EAAK,0BAA4B,EAAS,SAAS,MAAM,CAAC,EAEhE,UAAa,qBAAqB,CAAE,CACtC,CACF,EAAG,CAAC,CAAI,CAAC,GAGT,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,GAAgB,CAAC,EAAW,QAAS,CACxC,EAAe,IAAI,EAEnB,MACF,CAEA,SAAS,GAAY,CACnB,GAAI,CAAC,EAAW,QACd,OAGF,IAAM,EAAI,EAAW,QAAQ,sBAAsB,EAEnD,EAAe,CAAE,IAAK,EAAE,OAAQ,KAAM,EAAE,KAAM,MAAO,EAAE,KAAM,CAAC,CAChE,CAKA,OAJA,EAAU,EACV,OAAO,iBAAiB,SAAU,EAAW,CAAE,QAAS,GAAM,QAAS,EAAK,CAAC,EAC7E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,EAAY,IAAA,GAC1C,wBAAuB,EAChB,QACG,WACG,cACH,WACV,SAAU,EAAO,IAAA,GAAY,GAC7B,UAAW,EAAA,QAAO,MAClB,UAAW,EACX,GAAI,CACL,CAAA,EAEA,IACC,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,YAClB,aAAW,eACX,SAAU,EAAO,IAAA,GAAY,GACnB,WACV,YAAe,CACb,IAAU,EACV,EAAS,SAAS,MAAM,CAC1B,YAEA,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAM,EAAA,MAAO,KAAK,IAAM,CAAA,CACxB,CAAA,CAEP,IAEJ,IAAY,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,UAAY,UAAc,CAAA,CAC3D,IAEJ,OAAO,SAAa,KAAe,CACpC,CAAA,CAAA,CAEN"}
@@ -47,4 +47,4 @@ export interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElemen
47
47
  *
48
48
  * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SearchBar.html
49
49
  */
50
- export declare function SearchBar({ open, onClose, onClear, children, value, onChange, placeholder, disabled, inline, className, suggestions, onSuggestionSelect, loadingSuggestions, renderSuggestion, suggestionsLabel, ...props }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare const SearchBar: ({ open, onClose, onClear, children, value, onChange, placeholder, disabled, inline, className, suggestions, onSuggestionSelect, loadingSuggestions, renderSuggestion, suggestionsLabel, ...props }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { createPortal as c } from "react-dom";
6
6
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
7
7
  import { Close as f, Search as p } from "@gnome-ui/icons";
8
8
  //#region src/components/SearchBar/SearchBar.tsx
9
- function m({ open: m, onClose: h, onClear: g, children: _, value: v, onChange: y, placeholder: b = "Search…", disabled: x, inline: S = !1, className: C, suggestions: w, onSuggestionSelect: T, loadingSuggestions: E = !1, renderSuggestion: D, suggestionsLabel: O = "Suggestions", ...k }) {
9
+ var m = ({ open: m, onClose: h, onClear: g, children: _, value: v, onChange: y, placeholder: b = "Search…", disabled: x, inline: S = !1, className: C, suggestions: w, onSuggestionSelect: T, loadingSuggestions: E = !1, renderSuggestion: D, suggestionsLabel: O = "Suggestions", ...k }) => {
10
10
  let A = o(null), j = o(null), M = o(null), N = a(), P = a(), [F, I] = s(-1), [L, R] = s(null), z = (w?.length ?? 0) > 0, B = m && (E || z);
11
11
  i(() => {
12
12
  I(-1);
@@ -150,7 +150,7 @@ function m({ open: m, onClose: h, onClear: g, children: _, value: v, onChange: y
150
150
  children: _
151
151
  })]
152
152
  }), typeof document < "u" && W] });
153
- }
153
+ };
154
154
  //#endregion
155
155
  export { m as SearchBar };
156
156
 
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","names":[],"sources":["../../../src/components/SearchBar/SearchBar.tsx"],"sourcesContent":["import { Close, Search } from '@gnome-ui/icons';\nimport {\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { Icon } from '../Icon';\nimport { Spinner } from '../Spinner';\n\nimport styles from './SearchBar.module.css';\n\nexport interface Suggestion {\n id: string;\n label: string;\n}\n\nexport interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * Whether the search bar is visible/expanded.\n * When `false` the bar collapses to zero height and is hidden from AT.\n */\n open: boolean;\n /** Called when the user presses Escape or clicks the clear button with empty value. */\n onClose?: () => void;\n /** Called when the clear (×) button is clicked. Also clears the input value. */\n onClear?: () => void;\n /**\n * Content to render below the search bar (e.g. filter chips).\n * Only visible while `open` is true.\n */\n children?: ReactNode;\n /**\n * Removes the header-bar background so the bar blends into any surface.\n * Mirrors the `.inline` style class.\n */\n inline?: boolean;\n /** Suggestion items to show in the autocomplete popover. */\n suggestions?: Suggestion[];\n /** Called when the user selects a suggestion. */\n onSuggestionSelect?: (item: Suggestion) => void;\n /** Shows a spinner inside the suggestions popover while fetching async results. */\n loadingSuggestions?: boolean;\n /** Custom row renderer for each suggestion. */\n renderSuggestion?: (item: Suggestion) => ReactNode;\n /** `aria-label` for the suggestions listbox. Defaults to `\"Suggestions\"`. */\n suggestionsLabel?: string;\n}\n\ninterface DropdownPos {\n top: number;\n left: number;\n width: number;\n}\n\n/**\n * Collapsible search bar following the Adwaita `AdwSearchBar` pattern.\n *\n * - Slides in/out with a CSS height transition.\n * - Auto-focuses the input when `open` becomes `true`.\n * - Escape key calls `onClose`.\n * - Shows a clear (×) button whenever the input has a value.\n * - Optional `suggestions` / `loadingSuggestions` props show an autocomplete\n * popover anchored below the bar — follows the GTK4 pattern of\n * `AdwSearchBar` + `GtkPopover` + `GtkListView` (replaces `GtkEntryCompletion`).\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SearchBar.html\n */\nexport function SearchBar({\n open,\n onClose,\n onClear,\n children,\n value,\n onChange,\n placeholder = 'Search…',\n disabled,\n inline = false,\n className,\n suggestions,\n onSuggestionSelect,\n loadingSuggestions = false,\n renderSuggestion,\n suggestionsLabel = 'Suggestions',\n ...props\n}: SearchBarProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n\n const listboxId = useId();\n const optionIdPrefix = useId();\n\n const [activeIndex, setActiveIndex] = useState(-1);\n const [dropdownPos, setDropdownPos] = useState<DropdownPos | null>(null);\n\n const hasSuggestions = (suggestions?.length ?? 0) > 0;\n const showDropdown = open && (loadingSuggestions || hasSuggestions);\n\n // Reset active index whenever the suggestion list changes\n useEffect(() => {\n setActiveIndex(-1);\n }, []);\n\n // Auto-focus when opening\n useEffect(() => {\n if (open) {\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n\n return () => cancelAnimationFrame(id);\n }\n }, [open]);\n\n // Position the suggestions dropdown below the wrapper\n useEffect(() => {\n if (!showDropdown || !wrapperRef.current) {\n setDropdownPos(null);\n\n return;\n }\n\n function updatePos() {\n if (!wrapperRef.current) {\n return;\n }\n\n const r = wrapperRef.current.getBoundingClientRect();\n\n setDropdownPos({ top: r.bottom, left: r.left, width: r.width });\n }\n updatePos();\n window.addEventListener('scroll', updatePos, { passive: true, capture: true });\n window.addEventListener('resize', updatePos, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', updatePos, { capture: true });\n window.removeEventListener('resize', updatePos);\n };\n }, [showDropdown]);\n\n // Scroll the active option into view\n useEffect(() => {\n if (activeIndex < 0 || !listboxRef.current) {\n return;\n }\n\n (listboxRef.current.children[activeIndex] as HTMLElement | undefined)?.scrollIntoView({\n block: 'nearest',\n });\n }, [activeIndex]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (showDropdown && hasSuggestions && suggestions) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, suggestions.length - 1));\n\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, -1));\n\n return;\n }\n\n if (e.key === 'Enter' && activeIndex >= 0) {\n e.preventDefault();\n onSuggestionSelect?.(suggestions[activeIndex]);\n\n return;\n }\n }\n\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose?.();\n }\n\n props.onKeyDown?.(e);\n },\n [onClose, props, showDropdown, hasSuggestions, suggestions, activeIndex, onSuggestionSelect],\n );\n\n const hasValue = value !== undefined && value !== '';\n const activeOptionId =\n activeIndex >= 0 && suggestions?.[activeIndex]\n ? `${optionIdPrefix}-${suggestions[activeIndex].id}`\n : undefined;\n\n const dropdown =\n showDropdown && dropdownPos\n ? createPortal(\n <ul\n ref={listboxRef}\n aria-label={suggestionsLabel}\n id={listboxId}\n className={styles.suggestionsPanel}\n style={{ top: dropdownPos.top, left: dropdownPos.left, width: dropdownPos.width }}\n onMouseDown={(e) => e.preventDefault()} // keep focus on input\n >\n {loadingSuggestions && (\n <li role=\"presentation\" className={styles.suggestionsLoading}>\n <Spinner size=\"sm\" label=\"Loading suggestions…\" />\n </li>\n )}\n {!loadingSuggestions &&\n suggestions?.map((item, index) => (\n <li\n key={item.id}\n id={`${optionIdPrefix}-${item.id}`}\n aria-selected={index === activeIndex}\n className={[\n styles.suggestionItem,\n index === activeIndex ? styles.suggestionItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => setActiveIndex(index)}\n onMouseLeave={() => setActiveIndex(-1)}\n onClick={() => onSuggestionSelect?.(item)}\n >\n {renderSuggestion ? renderSuggestion(item) : item.label}\n </li>\n ))}\n </ul>,\n document.body,\n )\n : null;\n\n return (\n <>\n <div\n ref={wrapperRef}\n className={[styles.wrapper, open ? styles.open : null, className].filter(Boolean).join(' ')}\n aria-hidden={!open}\n >\n <div\n className={[styles.bar, inline ? styles.inline : null, disabled ? styles.disabled : null]\n .filter(Boolean)\n .join(' ')}\n >\n <span className={styles.searchIcon} aria-hidden>\n <Icon icon={Search} size=\"md\" />\n </span>\n\n <input\n ref={inputRef}\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={showDropdown}\n aria-controls={showDropdown ? listboxId : undefined}\n aria-activedescendant={activeOptionId}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n disabled={disabled}\n tabIndex={open ? undefined : -1}\n className={styles.input}\n onKeyDown={handleKeyDown}\n {...props}\n />\n\n {hasValue && (\n <button\n type=\"button\"\n className={styles.clearButton}\n aria-label=\"Clear search\"\n tabIndex={open ? undefined : -1}\n disabled={disabled}\n onClick={() => {\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n <Icon icon={Close} size=\"md\" />\n </button>\n )}\n </div>\n\n {children && <div className={styles.filterRow}>{children}</div>}\n </div>\n\n {typeof document !== 'undefined' && dropdown}\n </>\n );\n}\n"],"mappings":";;;;;;;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/SearchBar/SearchBar.tsx"],"sourcesContent":["import { Close, Search } from '@gnome-ui/icons';\nimport {\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { Icon } from '../Icon';\nimport { Spinner } from '../Spinner';\n\nimport styles from './SearchBar.module.css';\n\nexport interface Suggestion {\n id: string;\n label: string;\n}\n\nexport interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * Whether the search bar is visible/expanded.\n * When `false` the bar collapses to zero height and is hidden from AT.\n */\n open: boolean;\n /** Called when the user presses Escape or clicks the clear button with empty value. */\n onClose?: () => void;\n /** Called when the clear (×) button is clicked. Also clears the input value. */\n onClear?: () => void;\n /**\n * Content to render below the search bar (e.g. filter chips).\n * Only visible while `open` is true.\n */\n children?: ReactNode;\n /**\n * Removes the header-bar background so the bar blends into any surface.\n * Mirrors the `.inline` style class.\n */\n inline?: boolean;\n /** Suggestion items to show in the autocomplete popover. */\n suggestions?: Suggestion[];\n /** Called when the user selects a suggestion. */\n onSuggestionSelect?: (item: Suggestion) => void;\n /** Shows a spinner inside the suggestions popover while fetching async results. */\n loadingSuggestions?: boolean;\n /** Custom row renderer for each suggestion. */\n renderSuggestion?: (item: Suggestion) => ReactNode;\n /** `aria-label` for the suggestions listbox. Defaults to `\"Suggestions\"`. */\n suggestionsLabel?: string;\n}\n\ninterface DropdownPos {\n top: number;\n left: number;\n width: number;\n}\n\n/**\n * Collapsible search bar following the Adwaita `AdwSearchBar` pattern.\n *\n * - Slides in/out with a CSS height transition.\n * - Auto-focuses the input when `open` becomes `true`.\n * - Escape key calls `onClose`.\n * - Shows a clear (×) button whenever the input has a value.\n * - Optional `suggestions` / `loadingSuggestions` props show an autocomplete\n * popover anchored below the bar — follows the GTK4 pattern of\n * `AdwSearchBar` + `GtkPopover` + `GtkListView` (replaces `GtkEntryCompletion`).\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SearchBar.html\n */\nexport const SearchBar = ({\n open,\n onClose,\n onClear,\n children,\n value,\n onChange,\n placeholder = 'Search…',\n disabled,\n inline = false,\n className,\n suggestions,\n onSuggestionSelect,\n loadingSuggestions = false,\n renderSuggestion,\n suggestionsLabel = 'Suggestions',\n ...props\n}: SearchBarProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n\n const listboxId = useId();\n const optionIdPrefix = useId();\n\n const [activeIndex, setActiveIndex] = useState(-1);\n const [dropdownPos, setDropdownPos] = useState<DropdownPos | null>(null);\n\n const hasSuggestions = (suggestions?.length ?? 0) > 0;\n const showDropdown = open && (loadingSuggestions || hasSuggestions);\n\n // Reset active index whenever the suggestion list changes\n useEffect(() => {\n setActiveIndex(-1);\n }, []);\n\n // Auto-focus when opening\n useEffect(() => {\n if (open) {\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n\n return () => cancelAnimationFrame(id);\n }\n }, [open]);\n\n // Position the suggestions dropdown below the wrapper\n useEffect(() => {\n if (!showDropdown || !wrapperRef.current) {\n setDropdownPos(null);\n\n return;\n }\n\n function updatePos() {\n if (!wrapperRef.current) {\n return;\n }\n\n const r = wrapperRef.current.getBoundingClientRect();\n\n setDropdownPos({ top: r.bottom, left: r.left, width: r.width });\n }\n updatePos();\n window.addEventListener('scroll', updatePos, { passive: true, capture: true });\n window.addEventListener('resize', updatePos, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', updatePos, { capture: true });\n window.removeEventListener('resize', updatePos);\n };\n }, [showDropdown]);\n\n // Scroll the active option into view\n useEffect(() => {\n if (activeIndex < 0 || !listboxRef.current) {\n return;\n }\n\n (listboxRef.current.children[activeIndex] as HTMLElement | undefined)?.scrollIntoView({\n block: 'nearest',\n });\n }, [activeIndex]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (showDropdown && hasSuggestions && suggestions) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, suggestions.length - 1));\n\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, -1));\n\n return;\n }\n\n if (e.key === 'Enter' && activeIndex >= 0) {\n e.preventDefault();\n onSuggestionSelect?.(suggestions[activeIndex]);\n\n return;\n }\n }\n\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose?.();\n }\n\n props.onKeyDown?.(e);\n },\n [onClose, props, showDropdown, hasSuggestions, suggestions, activeIndex, onSuggestionSelect],\n );\n\n const hasValue = value !== undefined && value !== '';\n const activeOptionId =\n activeIndex >= 0 && suggestions?.[activeIndex]\n ? `${optionIdPrefix}-${suggestions[activeIndex].id}`\n : undefined;\n\n const dropdown =\n showDropdown && dropdownPos\n ? createPortal(\n <ul\n ref={listboxRef}\n aria-label={suggestionsLabel}\n id={listboxId}\n className={styles.suggestionsPanel}\n style={{ top: dropdownPos.top, left: dropdownPos.left, width: dropdownPos.width }}\n onMouseDown={(e) => e.preventDefault()} // keep focus on input\n >\n {loadingSuggestions && (\n <li role=\"presentation\" className={styles.suggestionsLoading}>\n <Spinner size=\"sm\" label=\"Loading suggestions…\" />\n </li>\n )}\n {!loadingSuggestions &&\n suggestions?.map((item, index) => (\n <li\n key={item.id}\n id={`${optionIdPrefix}-${item.id}`}\n aria-selected={index === activeIndex}\n className={[\n styles.suggestionItem,\n index === activeIndex ? styles.suggestionItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => setActiveIndex(index)}\n onMouseLeave={() => setActiveIndex(-1)}\n onClick={() => onSuggestionSelect?.(item)}\n >\n {renderSuggestion ? renderSuggestion(item) : item.label}\n </li>\n ))}\n </ul>,\n document.body,\n )\n : null;\n\n return (\n <>\n <div\n ref={wrapperRef}\n className={[styles.wrapper, open ? styles.open : null, className].filter(Boolean).join(' ')}\n aria-hidden={!open}\n >\n <div\n className={[styles.bar, inline ? styles.inline : null, disabled ? styles.disabled : null]\n .filter(Boolean)\n .join(' ')}\n >\n <span className={styles.searchIcon} aria-hidden>\n <Icon icon={Search} size=\"md\" />\n </span>\n\n <input\n ref={inputRef}\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={showDropdown}\n aria-controls={showDropdown ? listboxId : undefined}\n aria-activedescendant={activeOptionId}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n disabled={disabled}\n tabIndex={open ? undefined : -1}\n className={styles.input}\n onKeyDown={handleKeyDown}\n {...props}\n />\n\n {hasValue && (\n <button\n type=\"button\"\n className={styles.clearButton}\n aria-label=\"Clear search\"\n tabIndex={open ? undefined : -1}\n disabled={disabled}\n onClick={() => {\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n <Icon icon={Close} size=\"md\" />\n </button>\n )}\n </div>\n\n {children && <div className={styles.filterRow}>{children}</div>}\n </div>\n\n {typeof document !== 'undefined' && dropdown}\n </>\n );\n};\n"],"mappings":";;;;;;;;AA0EA,IAAa,KAAa,EACxB,SACA,YACA,YACA,aACA,UACA,aACA,iBAAc,WACd,aACA,YAAS,IACT,cACA,gBACA,uBACA,wBAAqB,IACrB,qBACA,sBAAmB,eACnB,GAAG,QACiB;CACpB,IAAM,IAAW,EAAyB,IAAI,GACxC,IAAa,EAAuB,IAAI,GACxC,IAAa,EAAyB,IAAI,GAE1C,IAAY,EAAM,GAClB,IAAiB,EAAM,GAEvB,CAAC,GAAa,KAAkB,EAAS,EAAE,GAC3C,CAAC,GAAa,KAAkB,EAA6B,IAAI,GAEjE,KAAkB,GAAa,UAAU,KAAK,GAC9C,IAAe,MAAS,KAAsB;CA4CpD,AAzCA,QAAgB;EACd,EAAe,EAAE;CACnB,GAAG,CAAC,CAAC,GAGL,QAAgB;EACd,IAAI,GAAM;GACR,IAAM,IAAK,4BAA4B,EAAS,SAAS,MAAM,CAAC;GAEhE,aAAa,qBAA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AAM,WAAW,EAAO;KAAY,eAAA;eAClC,kBAAC,GAAD;MAAM,MAAM;MAAQ,MAAK;KAAM,CAAA;IAC3B,CAAA;IAEN,kBAAC,SAAD;KACE,KAAK;KACL,MAAK;KACL,MAAK;KACL,qBAAkB;KAClB,iBAAe;KACf,iBAAe,IAAe,IAAY,KAAA;KAC1C,yBAAuB;KAChB;KACG;KACG;KACH;KACV,UAAU,IAAO,KAAA,IAAY;KAC7B,WAAW,EAAO;KAClB,WAAW;KACX,GAAI;IACL,CAAA;IAEA,KACC,kBAAC,UAAD;KACE,MAAK;KACL,WAAW,EAAO;KAClB,cAAW;KACX,UAAU,IAAO,KAAA,IAAY;KACnB;KACV,eAAe;MAEb,AADA,IAAU,GACV,EAAS,SAAS,MAAM;KAC1B;eAEA,kBAAC,GAAD;MAAM,MAAM;MAAO,MAAK;KAAM,CAAA;IACxB,CAAA;GAEP;MAEJ,KAAY,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAY;EAAc,CAAA,CAC3D;KAEJ,OAAO,WAAa,OAAe,CACpC,EAAA,CAAA;AAEN"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./SearchBar/SearchBar.cjs`);exports.SearchBar=e.SearchBar;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SearchBar/SearchBar.cjs");exports.SearchBar=e.SearchBar;
@@ -1,2 +1,2 @@
1
- const e=require(`../Tooltip/Tooltip.cjs`),t=require(`./SegmentedBar.module.css.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);var i=8,a=(0,n.memo)(function({values:a,className:o,"aria-label":s,...c}){let[l,u]=(0,n.useState)(null),d=a.reduce((e,t)=>e+t.value,0)||100,f=a.map(e=>`${e.label} ${e.value}%`).join(`, `);return(0,r.jsx)(`div`,{role:`img`,"aria-label":s??f,className:[t.default.track,o].filter(Boolean).join(` `),...c,children:a.map((n,a)=>{let o=`${n.value/d*100}%`,s=n.value%1==0?n.value:n.value.toFixed(1);return(0,r.jsx)(e.Tooltip,{label:`${n.label}: ${s}%`,placement:`top`,delay:200,children:(0,r.jsx)(`div`,{className:[t.default.segment,n.color?null:t.default[`color${a%i}`],l!==null&&l!==a?t.default.dimmed:null,l===a?t.default.highlighted:null].filter(Boolean).join(` `),style:{width:o,...n.color?{backgroundColor:n.color}:{}},onMouseEnter:()=>u(a),onMouseLeave:()=>u(null)})},n.label)})})});exports.SegmentedBar=a;
1
+ const e=require("../Tooltip/Tooltip.cjs"),t=require("./SegmentedBar.module.css.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=8,a=(0,n.memo)(function({values:a,className:o,"aria-label":s,...c}){let[l,u]=(0,n.useState)(null),d=a.reduce((e,t)=>e+t.value,0)||100,f=a.map(e=>`${e.label} ${e.value}%`).join(`, `);return(0,r.jsx)(`div`,{role:`img`,"aria-label":s??f,className:[t.default.track,o].filter(Boolean).join(` `),...c,children:a.map((n,a)=>{let o=`${n.value/d*100}%`,s=n.value%1==0?n.value:n.value.toFixed(1);return(0,r.jsx)(e.Tooltip,{label:`${n.label}: ${s}%`,placement:`top`,delay:200,children:(0,r.jsx)(`div`,{className:[t.default.segment,n.color?null:t.default[`color${a%i}`],l!==null&&l!==a?t.default.dimmed:null,l===a?t.default.highlighted:null].filter(Boolean).join(` `),style:{width:o,...n.color?{backgroundColor:n.color}:{}},onMouseEnter:()=>u(a),onMouseLeave:()=>u(null)})},n.label)})})});exports.SegmentedBar=a;
2
2
  //# sourceMappingURL=SegmentedBar.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedBar.cjs","names":[],"sources":["../../../src/components/SegmentedBar/SegmentedBar.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { memo, useState } from 'react';\n\nimport { Tooltip } from '../Tooltip';\n\nimport styles from './SegmentedBar.module.css';\n\nexport interface SegmentedBarSegment {\n /** Category name shown in the tooltip. */\n label: string;\n /**\n * Percentage value 0–100.\n * The sum of all segments should equal 100.\n * If it does not, values are redistributed proportionally.\n */\n value: number;\n /**\n * CSS color string for this segment.\n * When omitted, a cycling palette of GNOME design tokens is used.\n */\n color?: string;\n}\n\nexport interface SegmentedBarProps extends HTMLAttributes<HTMLDivElement> {\n /** Segments to display. Each segment contributes its share of the full bar width. */\n values: SegmentedBarSegment[];\n /**\n * Accessible label for the bar as a whole.\n * Auto-generated from `values` when omitted (e.g. \"TypeScript 45%, JavaScript 30%\").\n */\n 'aria-label'?: string;\n}\n\nconst COLOR_COUNT = 8;\n\n/**\n * Horizontal bar split into proportional segments, one per category.\n *\n * Hover a segment to highlight it and see its tooltip with label and percentage.\n * Typical use case: repository language distribution.\n *\n * ```tsx\n * <SegmentedBar\n * values={[\n * { label: \"TypeScript\", value: 60, color: \"#3178c6\" },\n * { label: \"JavaScript\", value: 30, color: \"#f7df1e\" },\n * { label: \"CSS\", value: 10, color: \"#563d7c\" },\n * ]}\n * />\n * ```\n */\nexport const SegmentedBar = memo(function SegmentedBar({\n values,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: SegmentedBarProps) {\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const total = values.reduce((sum, s) => sum + s.value, 0) || 100;\n\n const defaultLabel = values.map((s) => `${s.label} ${s.value}%`).join(', ');\n\n return (\n <div\n role=\"img\"\n aria-label={ariaLabel ?? defaultLabel}\n className={[styles.track, className].filter(Boolean).join(' ')}\n {...props}\n >\n {values.map((segment, i) => {\n const width = `${(segment.value / total) * 100}%`;\n const pct = segment.value % 1 === 0 ? segment.value : segment.value.toFixed(1);\n const tooltipLabel = `${segment.label}: ${pct}%`;\n\n return (\n <Tooltip key={segment.label} label={tooltipLabel} placement=\"top\" delay={200}>\n <div\n className={[\n styles.segment,\n !segment.color ? styles[`color${i % COLOR_COUNT}`] : null,\n activeIndex !== null && activeIndex !== i ? styles.dimmed : null,\n activeIndex === i ? styles.highlighted : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n width,\n ...(segment.color ? { backg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BAAoB,EAAe,KAAK,CACxC,CAAA,CACM,CAjBI,EAAQ,MAiBZ,EAEZ,CACE,CAAA,EAER"}
1
+ {"version":3,"file":"SegmentedBar.cjs","names":[],"sources":["../../../src/components/SegmentedBar/SegmentedBar.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { memo, useState } from 'react';\n\nimport { Tooltip } from '../Tooltip';\n\nimport styles from './SegmentedBar.module.css';\n\nexport interface SegmentedBarSegment {\n /** Category name shown in the tooltip. */\n label: string;\n /**\n * Percentage value 0–100.\n * The sum of all segments should equal 100.\n * If it does not, values are redistributed proportionally.\n */\n value: number;\n /**\n * CSS color string for this segment.\n * When omitted, a cycling palette of GNOME design tokens is used.\n */\n color?: string;\n}\n\nexport interface SegmentedBarProps extends HTMLAttributes<HTMLDivElement> {\n /** Segments to display. Each segment contributes its share of the full bar width. */\n values: SegmentedBarSegment[];\n /**\n * Accessible label for the bar as a whole.\n * Auto-generated from `values` when omitted (e.g. \"TypeScript 45%, JavaScript 30%\").\n */\n 'aria-label'?: string;\n}\n\nconst COLOR_COUNT = 8;\n\n/**\n * Horizontal bar split into proportional segments, one per category.\n *\n * Hover a segment to highlight it and see its tooltip with label and percentage.\n * Typical use case: repository language distribution.\n *\n * ```tsx\n * <SegmentedBar\n * values={[\n * { label: \"TypeScript\", value: 60, color: \"#3178c6\" },\n * { label: \"JavaScript\", value: 30, color: \"#f7df1e\" },\n * { label: \"CSS\", value: 10, color: \"#563d7c\" },\n * ]}\n * />\n * ```\n */\nexport const SegmentedBar = memo(function SegmentedBar({\n values,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: SegmentedBarProps) {\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const total = values.reduce((sum, s) => sum + s.value, 0) || 100;\n\n const defaultLabel = values.map((s) => `${s.label} ${s.value}%`).join(', ');\n\n return (\n <div\n role=\"img\"\n aria-label={ariaLabel ?? defaultLabel}\n className={[styles.track, className].filter(Boolean).join(' ')}\n {...props}\n >\n {values.map((segment, i) => {\n const width = `${(segment.value / total) * 100}%`;\n const pct = segment.value % 1 === 0 ? segment.value : segment.value.toFixed(1);\n const tooltipLabel = `${segment.label}: ${pct}%`;\n\n return (\n <Tooltip key={segment.label} label={tooltipLabel} placement=\"top\" delay={200}>\n <div\n className={[\n styles.segment,\n !segment.color ? styles[`color${i % COLOR_COUNT}`] : null,\n activeIndex !== null && activeIndex !== i ? styles.dimmed : null,\n activeIndex === i ? styles.highlighted : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n width,\n ...(segment.color ? { backgroundColor: segment.color } : {}),\n }}\n onMouseEnter={() => setActiveIndex(i)}\n onMouseLeave={() => setActiveIndex(null)}\n />\n </Tooltip>\n );\n })}\n </div>\n );\n});\n"],"mappings":"2IAiCA,IAAM,EAAc,EAkBP,GAAA,EAAA,EAAA,MAAoB,SAAsB,CACrD,SACA,YACA,aAAc,EACd,GAAG,GACiB,CACpB,GAAM,CAAC,EAAa,IAAA,EAAA,EAAA,UAA0C,IAAI,EAE5D,EAAQ,EAAO,QAAQ,EAAK,IAAM,EAAM,EAAE,MAAO,CAAC,GAAK,IAEvD,EAAe,EAAO,IAAK,GAAM,GAAG,EAAE,MAAM,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,EAE1E,OACE,EAAA,EAAA,KAAC,MAAD,CACE,KAAK,MACL,aAAY,GAAa,EACzB,UAAW,CAAC,EAAA,QAAO,MAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAC7D,GAAI,WAEH,EAAO,KAAK,EAAS,IAAM,CAC1B,IAAM,EAAQ,GAAI,EAAQ,MAAQ,EAAS,IAAI,GACzC,EAAM,EAAQ,MAAQ,GAAM,EAAI,EAAQ,MAAQ,EAAQ,MAAM,QAAQ,CAAC,EAG7E,OACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAA6B,MAAO,GAHd,EAAQ,MAAM,IAAI,EAAI,GAGM,UAAU,MAAM,MAAO,cACvE,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,CACT,EAAA,QAAO,QACN,EAAQ,MAA4C,KAApC,EAAA,QAAO,QAAQ,EAAI,KACpC,IAAgB,MAAQ,IAAgB,EAAI,EAAA,QAAO,OAAS,KAC5D,IAAgB,EAAI,EAAA,QAAO,YAAc,IAC3C,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,MAAO,CACL,QACA,GAAI,EAAQ,MAAQ,CAAE,gBAAiB,EAAQ,KAAM,EAAI,CAAC,CAC5D,EACA,iBAAoB,EAAe,CAAC,EACpC,iBAAoB,EAAe,IAAI,CACxC,CAAA,CACM,EAjBK,EAAQ,KAiBb,CAEb,CAAC,CACE,CAAA,CAET,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedBar.js","names":[],"sources":["../../../src/components/SegmentedBar/SegmentedBar.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { memo, useState } from 'react';\n\nimport { Tooltip } from '../Tooltip';\n\nimport styles from './SegmentedBar.module.css';\n\nexport interface SegmentedBarSegment {\n /** Category name shown in the tooltip. */\n label: string;\n /**\n * Percentage value 0–100.\n * The sum of all segments should equal 100.\n * If it does not, values are redistributed proportionally.\n */\n value: number;\n /**\n * CSS color string for this segment.\n * When omitted, a cycling palette of GNOME design tokens is used.\n */\n color?: string;\n}\n\nexport interface SegmentedBarProps extends HTMLAttributes<HTMLDivElement> {\n /** Segments to display. Each segment contributes its share of the full bar width. */\n values: SegmentedBarSegment[];\n /**\n * Accessible label for the bar as a whole.\n * Auto-generated from `values` when omitted (e.g. \"TypeScript 45%, JavaScript 30%\").\n */\n 'aria-label'?: string;\n}\n\nconst COLOR_COUNT = 8;\n\n/**\n * Horizontal bar split into proportional segments, one per category.\n *\n * Hover a segment to highlight it and see its tooltip with label and percentage.\n * Typical use case: repository language distribution.\n *\n * ```tsx\n * <SegmentedBar\n * values={[\n * { label: \"TypeScript\", value: 60, color: \"#3178c6\" },\n * { label: \"JavaScript\", value: 30, color: \"#f7df1e\" },\n * { label: \"CSS\", value: 10, color: \"#563d7c\" },\n * ]}\n * />\n * ```\n */\nexport const SegmentedBar = memo(function SegmentedBar({\n values,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: SegmentedBarProps) {\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const total = values.reduce((sum, s) => sum + s.value, 0) || 100;\n\n const defaultLabel = values.map((s) => `${s.label} ${s.value}%`).join(', ');\n\n return (\n <div\n role=\"img\"\n aria-label={ariaLabel ?? defaultLabel}\n className={[styles.track, className].filter(Boolean).join(' ')}\n {...props}\n >\n {values.map((segment, i) => {\n const width = `${(segment.value / total) * 100}%`;\n const pct = segment.value % 1 === 0 ? segment.value : segment.value.toFixed(1);\n const tooltipLabel = `${segment.label}: ${pct}%`;\n\n return (\n <Tooltip key={segment.label} label={tooltipLabel} placement=\"top\" delay={200}>\n <div\n className={[\n styles.segment,\n !segment.color ? styles[`color${i % COLOR_COUNT}`] : null,\n activeIndex !== null && activeIndex !== i ? styles.dimmed : null,\n activeIndex === i ? styles.highlighted : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n width,\n ...(segment.color ? { backgroundColor: segment.color } : {}),\n }}\n onMouseEnter={() => setActiveIndex(i)}\n onMouseLeave={() => setActiveIndex(null)}\n />\n </Tooltip>\n );\n })}\n </div>\n );\n});\n"],"mappings":";;;;;AAiCA,IAAM,IAAc,GAkBP,IAAe,EAAK,SAAsB,EACrD,WACA,cACA,cAAc,GACd,GAAG,KACiB;CACpB,IAAM,CAAC,GAAa,KAAkB,EAAwB,KAAK,EAE7D,IAAQ,EAAO,QAAQ,GAAK,MAAM,IAAM,EAAE,OAAO,EAAE,IAAI,KAEvD,IAAe,EAAO,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,KAAK;AAE3E,QACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAY,KAAa;EACzB,WAAW,CAAC,EAAO,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAC9D,GAAI;YAEH,EAAO,KAAK,GAAS,MAAM;GAC1B,IAAM,IAAQ,GAAI,EAAQ,QAAQ,IAAS,IAAI,IACzC,IAAM,EAAQ,QAAQ,KAAM,IAAI,EAAQ,QAAQ,EAAQ,MAAM,QAAQ,EAAE;AAG9E,UACE,kBAAC,GAAD;IAA6B,OAHV,GAAG,EAAQ,MAAM,IAAI,EAAI;IAGM,WAAU;IAAM,OAAO;cACvE,kBAAC,OAAD;KACE,WAAW;MACT,EAAO;MACN,EAAQ,QAA4C,OAApC,EAAO,QAAQ,IAAI;MACpC,MAAgB,QAAQ,MAAgB,IAAI,EAAO,SAAS;MAC5D,MAAgB,IAAI,EAAO,cAAc;MAC1C,CACE,OAAO,QAAQ,CACf,KAAK,IAAI;KACZ,OAAO;MACL;MACA,GAAI,EAAQ,QAAQ,EAAE,iBAAiB,EAAQ,OAAO,GAAG,EAAE;MAC5D;KACD,oBAAoB,EAAe,EAAE;KACrC,oBAAoB,EAAe,KAAK;KACxC,CAAA;IACM,EAjBI,EAAQ,MAiBZ;IAEZ;EACE,CAAA;EAER"}
1
+ {"version":3,"file":"SegmentedBar.js","names":[],"sources":["../../../src/components/SegmentedBar/SegmentedBar.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { memo, useState } from 'react';\n\nimport { Tooltip } from '../Tooltip';\n\nimport styles from './SegmentedBar.module.css';\n\nexport interface SegmentedBarSegment {\n /** Category name shown in the tooltip. */\n label: string;\n /**\n * Percentage value 0–100.\n * The sum of all segments should equal 100.\n * If it does not, values are redistributed proportionally.\n */\n value: number;\n /**\n * CSS color string for this segment.\n * When omitted, a cycling palette of GNOME design tokens is used.\n */\n color?: string;\n}\n\nexport interface SegmentedBarProps extends HTMLAttributes<HTMLDivElement> {\n /** Segments to display. Each segment contributes its share of the full bar width. */\n values: SegmentedBarSegment[];\n /**\n * Accessible label for the bar as a whole.\n * Auto-generated from `values` when omitted (e.g. \"TypeScript 45%, JavaScript 30%\").\n */\n 'aria-label'?: string;\n}\n\nconst COLOR_COUNT = 8;\n\n/**\n * Horizontal bar split into proportional segments, one per category.\n *\n * Hover a segment to highlight it and see its tooltip with label and percentage.\n * Typical use case: repository language distribution.\n *\n * ```tsx\n * <SegmentedBar\n * values={[\n * { label: \"TypeScript\", value: 60, color: \"#3178c6\" },\n * { label: \"JavaScript\", value: 30, color: \"#f7df1e\" },\n * { label: \"CSS\", value: 10, color: \"#563d7c\" },\n * ]}\n * />\n * ```\n */\nexport const SegmentedBar = memo(function SegmentedBar({\n values,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: SegmentedBarProps) {\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const total = values.reduce((sum, s) => sum + s.value, 0) || 100;\n\n const defaultLabel = values.map((s) => `${s.label} ${s.value}%`).join(', ');\n\n return (\n <div\n role=\"img\"\n aria-label={ariaLabel ?? defaultLabel}\n className={[styles.track, className].filter(Boolean).join(' ')}\n {...props}\n >\n {values.map((segment, i) => {\n const width = `${(segment.value / total) * 100}%`;\n const pct = segment.value % 1 === 0 ? segment.value : segment.value.toFixed(1);\n const tooltipLabel = `${segment.label}: ${pct}%`;\n\n return (\n <Tooltip key={segment.label} label={tooltipLabel} placement=\"top\" delay={200}>\n <div\n className={[\n styles.segment,\n !segment.color ? styles[`color${i % COLOR_COUNT}`] : null,\n activeIndex !== null && activeIndex !== i ? styles.dimmed : null,\n activeIndex === i ? styles.highlighted : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n width,\n ...(segment.color ? { backgroundColor: segment.color } : {}),\n }}\n onMouseEnter={() => setActiveIndex(i)}\n onMouseLeave={() => setActiveIndex(null)}\n />\n </Tooltip>\n );\n })}\n </div>\n );\n});\n"],"mappings":";;;;;AAiCA,IAAM,IAAc,GAkBP,IAAe,EAAK,SAAsB,EACrD,WACA,cACA,cAAc,GACd,GAAG,KACiB;CACpB,IAAM,CAAC,GAAa,KAAkB,EAAwB,IAAI,GAE5D,IAAQ,EAAO,QAAQ,GAAK,MAAM,IAAM,EAAE,OAAO,CAAC,KAAK,KAEvD,IAAe,EAAO,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI;CAE1E,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAY,KAAa;EACzB,WAAW,CAAC,EAAO,OAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;EAC7D,GAAI;YAEH,EAAO,KAAK,GAAS,MAAM;GAC1B,IAAM,IAAQ,GAAI,EAAQ,QAAQ,IAAS,IAAI,IACzC,IAAM,EAAQ,QAAQ,KAAM,IAAI,EAAQ,QAAQ,EAAQ,MAAM,QAAQ,CAAC;GAG7E,OACE,kBAAC,GAAD;IAA6B,OAAO,GAHd,EAAQ,MAAM,IAAI,EAAI;IAGM,WAAU;IAAM,OAAO;cACvE,kBAAC,OAAD;KACE,WAAW;MACT,EAAO;MACN,EAAQ,QAA4C,OAApC,EAAO,QAAQ,IAAI;MACpC,MAAgB,QAAQ,MAAgB,IAAI,EAAO,SAAS;MAC5D,MAAgB,IAAI,EAAO,cAAc;KAC3C,EACG,OAAO,OAAO,EACd,KAAK,GAAG;KACX,OAAO;MACL;MACA,GAAI,EAAQ,QAAQ,EAAE,iBAAiB,EAAQ,MAAM,IAAI,CAAC;KAC5D;KACA,oBAAoB,EAAe,CAAC;KACpC,oBAAoB,EAAe,IAAI;IACxC,CAAA;GACM,GAjBK,EAAQ,KAiBb;EAEb,CAAC;CACE,CAAA;AAET,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./SegmentedBar/SegmentedBar.cjs`);exports.SegmentedBar=e.SegmentedBar;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SegmentedBar/SegmentedBar.cjs");exports.SegmentedBar=e.SegmentedBar;
@@ -1,2 +1,2 @@
1
- const e=require(`./Separator.module.css.cjs`);let t=require(`react/jsx-runtime`);function n({orientation:n=`horizontal`,className:r,...i}){let a=[e.default.separator,n===`vertical`?e.default.vertical:e.default.horizontal,r].filter(Boolean).join(` `);return n===`vertical`?(0,t.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:a,...i}):(0,t.jsx)(`hr`,{className:a,...i})}exports.Separator=n;
1
+ const e=require("./Separator.module.css.cjs");let t=require("react/jsx-runtime");var n=({orientation:n=`horizontal`,className:r,...i})=>{let a=[e.default.separator,n===`vertical`?e.default.vertical:e.default.horizontal,r].filter(Boolean).join(` `);return n===`vertical`?(0,t.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:a,...i}):(0,t.jsx)(`hr`,{className:a,...i})};exports.Separator=n;
2
2
  //# sourceMappingURL=Separator.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.cjs","names":[],"sources":["../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './Separator.module.css';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {\n /** Direction of the dividing line. Defaults to `\"horizontal\"`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Thin dividing line that separates groups of content.\n *\n * Renders as `<hr>` (horizontal) or a `<div role=\"separator\">` (vertical).\n * Color is driven entirely by design tokens and adapts to dark mode automatically.\n *\n * @see https://developer.gnome.org/hig/patterns/containers.html\n */\nexport function Separator({ orientation = 'horizontal', className, ...props }: SeparatorProps) {\n const classes = [\n styles.separator,\n orientation === 'vertical' ? styles.vertical : styles.horizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={classes}\n {...(props as HTMLAttributes<HTMLDivElement>)}\n />\n );\n }\n\n return <hr className={classes} {...props} />;\n}\n"],"mappings":"iFAmBA,SAAgB,EAAU,CAAE,cAAc,aAAc,YAAW,GAAG,GAAyB,CAC7F,IAAM,EAAU,CACd,EAAA,QAAO,UACP,IAAgB,WAAa,EAAA,QAAO,SAAW,EAAA,QAAO,WACtD,EACD,CACE,OAAO,QAAQ,CACf,KAAK,IAAI,CAaZ,OAXI,IAAgB,YAEhB,EAAA,EAAA,KAAC,MAAD,CACE,KAAK,YACL,mBAAiB,WACjB,UAAW,EACX,GAAK,EACL,CAAA,EAIC,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAS,GAAI,EAAS,CAAA"}
1
+ {"version":3,"file":"Separator.cjs","names":[],"sources":["../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './Separator.module.css';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {\n /** Direction of the dividing line. Defaults to `\"horizontal\"`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Thin dividing line that separates groups of content.\n *\n * Renders as `<hr>` (horizontal) or a `<div role=\"separator\">` (vertical).\n * Color is driven entirely by design tokens and adapts to dark mode automatically.\n *\n * @see https://developer.gnome.org/hig/patterns/containers.html\n */\nexport const Separator = ({ orientation = 'horizontal', className, ...props }: SeparatorProps) => {\n const classes = [\n styles.separator,\n orientation === 'vertical' ? styles.vertical : styles.horizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={classes}\n {...(props as HTMLAttributes<HTMLDivElement>)}\n />\n );\n }\n\n return <hr className={classes} {...props} />;\n};\n"],"mappings":"iFAmBA,IAAa,GAAa,CAAE,cAAc,aAAc,YAAW,GAAG,KAA4B,CAChG,IAAM,EAAU,CACd,EAAA,QAAO,UACP,IAAgB,WAAa,EAAA,QAAO,SAAW,EAAA,QAAO,WACtD,CACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EAaX,OAXI,IAAgB,YAEhB,EAAA,EAAA,KAAC,MAAD,CACE,KAAK,YACL,mBAAiB,WACjB,UAAW,EACX,GAAK,CACN,CAAA,GAIE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAS,GAAI,CAAQ,CAAA,CAC7C"}
@@ -12,4 +12,4 @@ export interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {
12
12
  *
13
13
  * @see https://developer.gnome.org/hig/patterns/containers.html
14
14
  */
15
- export declare function Separator({ orientation, className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare const Separator: ({ orientation, className, ...props }: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import e from "./Separator.module.css.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  //#region src/components/Separator/Separator.tsx
4
- function n({ orientation: n = "horizontal", className: r, ...i }) {
4
+ var n = ({ orientation: n = "horizontal", className: r, ...i }) => {
5
5
  let a = [
6
6
  e.separator,
7
7
  n === "vertical" ? e.vertical : e.horizontal,
@@ -16,7 +16,7 @@ function n({ orientation: n = "horizontal", className: r, ...i }) {
16
16
  className: a,
17
17
  ...i
18
18
  });
19
- }
19
+ };
20
20
  //#endregion
21
21
  export { n as Separator };
22
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.js","names":[],"sources":["../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './Separator.module.css';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {\n /** Direction of the dividing line. Defaults to `\"horizontal\"`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Thin dividing line that separates groups of content.\n *\n * Renders as `<hr>` (horizontal) or a `<div role=\"separator\">` (vertical).\n * Color is driven entirely by design tokens and adapts to dark mode automatically.\n *\n * @see https://developer.gnome.org/hig/patterns/containers.html\n */\nexport function Separator({ orientation = 'horizontal', className, ...props }: SeparatorProps) {\n const classes = [\n styles.separator,\n orientation === 'vertical' ? styles.vertical : styles.horizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={classes}\n {...(props as HTMLAttributes<HTMLDivElement>)}\n />\n );\n }\n\n return <hr className={classes} {...props} />;\n}\n"],"mappings":";;;AAmBA,SAAgB,EAAU,EAAE,iBAAc,cAAc,cAAW,GAAG,KAAyB;CAC7F,IAAM,IAAU;EACd,EAAO;EACP,MAAgB,aAAa,EAAO,WAAW,EAAO;EACtD;EACD,CACE,OAAO,QAAQ,CACf,KAAK,IAAI;AAaZ,QAXI,MAAgB,aAEhB,kBAAC,OAAD;EACE,MAAK;EACL,oBAAiB;EACjB,WAAW;EACX,GAAK;EACL,CAAA,GAIC,kBAAC,MAAD;EAAI,WAAW;EAAS,GAAI;EAAS,CAAA"}
1
+ {"version":3,"file":"Separator.js","names":[],"sources":["../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './Separator.module.css';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {\n /** Direction of the dividing line. Defaults to `\"horizontal\"`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Thin dividing line that separates groups of content.\n *\n * Renders as `<hr>` (horizontal) or a `<div role=\"separator\">` (vertical).\n * Color is driven entirely by design tokens and adapts to dark mode automatically.\n *\n * @see https://developer.gnome.org/hig/patterns/containers.html\n */\nexport const Separator = ({ orientation = 'horizontal', className, ...props }: SeparatorProps) => {\n const classes = [\n styles.separator,\n orientation === 'vertical' ? styles.vertical : styles.horizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={classes}\n {...(props as HTMLAttributes<HTMLDivElement>)}\n />\n );\n }\n\n return <hr className={classes} {...props} />;\n};\n"],"mappings":";;;AAmBA,IAAa,KAAa,EAAE,iBAAc,cAAc,cAAW,GAAG,QAA4B;CAChG,IAAM,IAAU;EACd,EAAO;EACP,MAAgB,aAAa,EAAO,WAAW,EAAO;EACtD;CACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;CAaX,OAXI,MAAgB,aAEhB,kBAAC,OAAD;EACE,MAAK;EACL,oBAAiB;EACjB,WAAW;EACX,GAAK;CACN,CAAA,IAIE,kBAAC,MAAD;EAAI,WAAW;EAAS,GAAI;CAAQ,CAAA;AAC7C"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./Separator/Separator.cjs`);exports.Separator=e.Separator;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./Separator/Separator.cjs");exports.Separator=e.Separator;
@@ -1,2 +1,2 @@
1
- const e=require(`./ShortcutLabel.module.css.cjs`);let t=require(`react/jsx-runtime`);var n={ctrl:`⌃`,control:`⌃`,shift:`⇧`,alt:`⌥`,option:`⌥`,super:`⊞`,win:`⊞`,cmd:`⌘`,command:`⌘`,meta:`⌘`,up:`↑`,down:`↓`,left:`←`,right:`→`,enter:`↵`,return:`↵`,backspace:`⌫`,delete:`⌦`,escape:`⎋`,esc:`⎋`,tab:`⇥`,space:`␣`,pageup:`⇞`,pagedown:`⇟`,home:`⇱`,end:`⇲`};function r({shortcut:r,symbols:i=!0,className:a,...o}){let s=r.split(`+`).map(e=>e.trim()).filter(Boolean);return(0,t.jsx)(`span`,{className:[e.default.label,a].filter(Boolean).join(` `),"aria-label":r,...o,children:s.map((r,a)=>{let o=i?n[r.toLowerCase()]??r:r;return(0,t.jsx)(`kbd`,{className:e.default.key,children:o},a)})})}exports.ShortcutLabel=r;
1
+ const e=require("./ShortcutLabel.module.css.cjs");let t=require("react/jsx-runtime");var n={ctrl:`⌃`,control:`⌃`,shift:`⇧`,alt:`⌥`,option:`⌥`,super:`⊞`,win:`⊞`,cmd:`⌘`,command:`⌘`,meta:`⌘`,up:`↑`,down:`↓`,left:`←`,right:`→`,enter:`↵`,return:`↵`,backspace:`⌫`,delete:`⌦`,escape:`⎋`,esc:`⎋`,tab:`⇥`,space:`␣`,pageup:`⇞`,pagedown:`⇟`,home:`⇱`,end:`⇲`},r=({shortcut:r,symbols:i=!0,className:a,...o})=>{let s=r.split(`+`).map(e=>e.trim()).filter(Boolean);return(0,t.jsx)(`span`,{className:[e.default.label,a].filter(Boolean).join(` `),"aria-label":r,...o,children:s.map((r,a)=>{let o=i?n[r.toLowerCase()]??r:r;return(0,t.jsx)(`kbd`,{className:e.default.key,children:o},a)})})};exports.ShortcutLabel=r;
2
2
  //# sourceMappingURL=ShortcutLabel.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutLabel.cjs","names":[],"sources":["../../../src/components/ShortcutLabel/ShortcutLabel.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './ShortcutLabel.module.css';\n\nexport interface ShortcutLabelProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Keyboard shortcut string.\n *\n * Tokens are separated by `+`. Each token is rendered as its own key cap.\n * Common modifiers are normalised to their symbol:\n * - `Ctrl` / `Control` → `⌃`\n * - `Shift` → `⇧`\n * - `Alt` / `Option` → `⌥`\n * - `Super` / `Win` / `Cmd` / `Command` → `⊞`\n * - `Up` → `↑` `Down` → `↓` `Left` → `←` `Right` → `→`\n * - `Enter` / `Return` → `↵`\n * - `Backspace` → `⌫`\n * - `Delete` → `⌦`\n * - `Escape` / `Esc` → `⎋`\n * - `Tab` → `⇥`\n * - `Space` → `␣`\n *\n * @example \"Ctrl+S\" → ⌃ S\n * @example \"Ctrl+Shift+Z\" → ⌃ ⇧ Z\n */\n shortcut: string;\n /** When true, modifier tokens are shown as symbols. Defaults to `true`. */\n symbols?: boolean;\n}\n\nconst SYMBOL_MAP: Record<string, string> = {\n ctrl: '⌃',\n control: '⌃',\n shift: '⇧',\n alt: '⌥',\n option: '⌥',\n super: '⊞',\n win: '⊞',\n cmd: '⌘',\n command: '⌘',\n meta: '⌘',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n enter: '↵',\n return: '↵',\n backspace: '⌫',\n delete: '⌦',\n escape: '⎋',\n esc: '⎋',\n tab: '⇥',\n space: '␣',\n pageup: '⇞',\n pagedown: '⇟',\n home: '⇱',\n end: '⇲',\n};\n\n/**\n * Read-only display of a keyboard shortcut with per-key key-cap styling.\n *\n * Each token in the `shortcut` string (split by `+`) is rendered as a\n * separate `<kbd>` element. Modifier keys are normalised to their Unicode\n * symbols by default.\n *\n * Mirrors `GtkShortcutLabel`.\n *\n * @see https://docs.gtk.org/gtk4/class.ShortcutLabel.html\n */\nexport function ShortcutLabel({\n shortcut,\n symbols = true,\n className,\n ...props\n}: ShortcutLabelProps) {\n const tokens = shortcut\n .split('+')\n .map((t) => t.trim())\n .filter(Boolean);\n\n return (\n <span\n className={[styles.label, className].filter(Boolean).join(' ')}\n aria-label={shortcut}\n {...props}\n >\n {tokens.map((token, i) => {\n const display = symbols ? (SYMBOL_MAP[token.toLowerCase()] ?? token) : token;\n\n return (\n <kbd key={i} className={styles.key}>\n {display}\n </kbd>\n );\n })}\n </span>\n );\n}\n"],"mappings":"qFA8BA,IAAM,EAAqC,CACzC,KAAM,IACN,QAAS,IACT,MAAO,IACP,IAAK,IACL,OAAQ,IACR,MAAO,IACP,IAAK,IACL,IAAK,IACL,QAAS,IACT,KAAM,IACN,GAAI,IACJ,KAAM,IACN,KAAM,IACN,MAAO,IACP,MAAO,IACP,OAAQ,IACR,UAAW,IACX,OAAQ,IACR,OAAQ,IACR,IAAK,IACL,IAAK,IACL,MAAO,IACP,OAAQ,IACR,SAAU,IACV,KAAM,IACN,IAAK,IACN,CAaD,SAAgB,EAAc,CAC5B,WACA,UAAU,GACV,YACA,GAAG,GACkB,CACrB,IAAM,EAAS,EACZ,MAAM,IAAI,CACV,IAAK,GAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ,CAElB,OACE,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,CAAC,EAAA,QAAO,MAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,CAC9D,aAAY,EACZ,GAAI,WAEH,EAAO,KAAK,EAAO,IAAM,CACxB,IAAM,EAAU,EAAW,EAAW,EAAM,aAAa,GAAK,EAAS,EAEvE,OACE,EAAA,EAAA,KAAC,MAAD,CAAa,UAAW,EAAA,QAAO,aAC5B,EACG,CAFI,EAEJ,EAER,CACG,CAAA"}
1
+ {"version":3,"file":"ShortcutLabel.cjs","names":[],"sources":["../../../src/components/ShortcutLabel/ShortcutLabel.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './ShortcutLabel.module.css';\n\nexport interface ShortcutLabelProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Keyboard shortcut string.\n *\n * Tokens are separated by `+`. Each token is rendered as its own key cap.\n * Common modifiers are normalised to their symbol:\n * - `Ctrl` / `Control` → `⌃`\n * - `Shift` → `⇧`\n * - `Alt` / `Option` → `⌥`\n * - `Super` / `Win` / `Cmd` / `Command` → `⊞`\n * - `Up` → `↑` `Down` → `↓` `Left` → `←` `Right` → `→`\n * - `Enter` / `Return` → `↵`\n * - `Backspace` → `⌫`\n * - `Delete` → `⌦`\n * - `Escape` / `Esc` → `⎋`\n * - `Tab` → `⇥`\n * - `Space` → `␣`\n *\n * @example \"Ctrl+S\" → ⌃ S\n * @example \"Ctrl+Shift+Z\" → ⌃ ⇧ Z\n */\n shortcut: string;\n /** When true, modifier tokens are shown as symbols. Defaults to `true`. */\n symbols?: boolean;\n}\n\nconst SYMBOL_MAP: Record<string, string> = {\n ctrl: '⌃',\n control: '⌃',\n shift: '⇧',\n alt: '⌥',\n option: '⌥',\n super: '⊞',\n win: '⊞',\n cmd: '⌘',\n command: '⌘',\n meta: '⌘',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n enter: '↵',\n return: '↵',\n backspace: '⌫',\n delete: '⌦',\n escape: '⎋',\n esc: '⎋',\n tab: '⇥',\n space: '␣',\n pageup: '⇞',\n pagedown: '⇟',\n home: '⇱',\n end: '⇲',\n};\n\n/**\n * Read-only display of a keyboard shortcut with per-key key-cap styling.\n *\n * Each token in the `shortcut` string (split by `+`) is rendered as a\n * separate `<kbd>` element. Modifier keys are normalised to their Unicode\n * symbols by default.\n *\n * Mirrors `GtkShortcutLabel`.\n *\n * @see https://docs.gtk.org/gtk4/class.ShortcutLabel.html\n */\nexport const ShortcutLabel = ({\n shortcut,\n symbols = true,\n className,\n ...props\n}: ShortcutLabelProps) => {\n const tokens = shortcut\n .split('+')\n .map((t) => t.trim())\n .filter(Boolean);\n\n return (\n <span\n className={[styles.label, className].filter(Boolean).join(' ')}\n aria-label={shortcut}\n {...props}\n >\n {tokens.map((token, i) => {\n const display = symbols ? (SYMBOL_MAP[token.toLowerCase()] ?? token) : token;\n\n return (\n <kbd key={i} className={styles.key}>\n {display}\n </kbd>\n );\n })}\n </span>\n );\n};\n"],"mappings":"qFA8BA,IAAM,EAAqC,CACzC,KAAM,IACN,QAAS,IACT,MAAO,IACP,IAAK,IACL,OAAQ,IACR,MAAO,IACP,IAAK,IACL,IAAK,IACL,QAAS,IACT,KAAM,IACN,GAAI,IACJ,KAAM,IACN,KAAM,IACN,MAAO,IACP,MAAO,IACP,OAAQ,IACR,UAAW,IACX,OAAQ,IACR,OAAQ,IACR,IAAK,IACL,IAAK,IACL,MAAO,IACP,OAAQ,IACR,SAAU,IACV,KAAM,IACN,IAAK,GACP,EAaa,GAAiB,CAC5B,WACA,UAAU,GACV,YACA,GAAG,KACqB,CACxB,IAAM,EAAS,EACZ,MAAM,GAAG,EACT,IAAK,GAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO,EAEjB,OACE,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,CAAC,EAAA,QAAO,MAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAC7D,aAAY,EACZ,GAAI,WAEH,EAAO,KAAK,EAAO,IAAM,CACxB,IAAM,EAAU,EAAW,EAAW,EAAM,YAAY,IAAM,EAAS,EAEvE,OACE,EAAA,EAAA,KAAC,MAAD,CAAa,UAAW,EAAA,QAAO,aAC5B,CACE,EAFK,CAEL,CAET,CAAC,CACG,CAAA,CAEV"}
@@ -35,4 +35,4 @@ export interface ShortcutLabelProps extends HTMLAttributes<HTMLSpanElement> {
35
35
  *
36
36
  * @see https://docs.gtk.org/gtk4/class.ShortcutLabel.html
37
37
  */
38
- export declare function ShortcutLabel({ shortcut, symbols, className, ...props }: ShortcutLabelProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare const ShortcutLabel: ({ shortcut, symbols, className, ...props }: ShortcutLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -28,8 +28,7 @@ var n = {
28
28
  pagedown: "⇟",
29
29
  home: "⇱",
30
30
  end: "⇲"
31
- };
32
- function r({ shortcut: r, symbols: i = !0, className: a, ...o }) {
31
+ }, r = ({ shortcut: r, symbols: i = !0, className: a, ...o }) => {
33
32
  let s = r.split("+").map((e) => e.trim()).filter(Boolean);
34
33
  return /* @__PURE__ */ t("span", {
35
34
  className: [e.label, a].filter(Boolean).join(" "),
@@ -43,7 +42,7 @@ function r({ shortcut: r, symbols: i = !0, className: a, ...o }) {
43
42
  }, a);
44
43
  })
45
44
  });
46
- }
45
+ };
47
46
  //#endregion
48
47
  export { r as ShortcutLabel };
49
48
 
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutLabel.js","names":[],"sources":["../../../src/components/ShortcutLabel/ShortcutLabel.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './ShortcutLabel.module.css';\n\nexport interface ShortcutLabelProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Keyboard shortcut string.\n *\n * Tokens are separated by `+`. Each token is rendered as its own key cap.\n * Common modifiers are normalised to their symbol:\n * - `Ctrl` / `Control` → `⌃`\n * - `Shift` → `⇧`\n * - `Alt` / `Option` → `⌥`\n * - `Super` / `Win` / `Cmd` / `Command` → `⊞`\n * - `Up` → `↑` `Down` → `↓` `Left` → `←` `Right` → `→`\n * - `Enter` / `Return` → `↵`\n * - `Backspace` → `⌫`\n * - `Delete` → `⌦`\n * - `Escape` / `Esc` → `⎋`\n * - `Tab` → `⇥`\n * - `Space` → `␣`\n *\n * @example \"Ctrl+S\" → ⌃ S\n * @example \"Ctrl+Shift+Z\" → ⌃ ⇧ Z\n */\n shortcut: string;\n /** When true, modifier tokens are shown as symbols. Defaults to `true`. */\n symbols?: boolean;\n}\n\nconst SYMBOL_MAP: Record<string, string> = {\n ctrl: '⌃',\n control: '⌃',\n shift: '⇧',\n alt: '⌥',\n option: '⌥',\n super: '⊞',\n win: '⊞',\n cmd: '⌘',\n command: '⌘',\n meta: '⌘',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n enter: '↵',\n return: '↵',\n backspace: '⌫',\n delete: '⌦',\n escape: '⎋',\n esc: '⎋',\n tab: '⇥',\n space: '␣',\n pageup: '⇞',\n pagedown: '⇟',\n home: '⇱',\n end: '⇲',\n};\n\n/**\n * Read-only display of a keyboard shortcut with per-key key-cap styling.\n *\n * Each token in the `shortcut` string (split by `+`) is rendered as a\n * separate `<kbd>` element. Modifier keys are normalised to their Unicode\n * symbols by default.\n *\n * Mirrors `GtkShortcutLabel`.\n *\n * @see https://docs.gtk.org/gtk4/class.ShortcutLabel.html\n */\nexport function ShortcutLabel({\n shortcut,\n symbols = true,\n className,\n ...props\n}: ShortcutLabelProps) {\n const tokens = shortcut\n .split('+')\n .map((t) => t.trim())\n .filter(Boolean);\n\n return (\n <span\n className={[styles.label, className].filter(Boolean).join(' ')}\n aria-label={shortcut}\n {...props}\n >\n {tokens.map((token, i) => {\n const display = symbols ? (SYMBOL_MAP[token.toLowerCase()] ?? token) : token;\n\n return (\n <kbd key={i} className={styles.key}>\n {display}\n </kbd>\n );\n })}\n </span>\n );\n}\n"],"mappings":";;;AA8BA,IAAM,IAAqC;CACzC,MAAM;CACN,SAAS;CACT,OAAO;CACP,KAAK;CACL,QAAQ;CACR,OAAO;CACP,KAAK;CACL,KAAK;CACL,SAAS;CACT,MAAM;CACN,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,UAAU;CACV,MAAM;CACN,KAAK;CACN;AAaD,SAAgB,EAAc,EAC5B,aACA,aAAU,IACV,cACA,GAAG,KACkB;CACrB,IAAM,IAAS,EACZ,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ;AAElB,QACE,kBAAC,QAAD;EACE,WAAW,CAAC,EAAO,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAC9D,cAAY;EACZ,GAAI;YAEH,EAAO,KAAK,GAAO,MAAM;GACxB,IAAM,IAAU,IAAW,EAAW,EAAM,aAAa,KAAK,IAAS;AAEvE,UACE,kBAAC,OAAD;IAAa,WAAW,EAAO;cAC5B;IACG,EAFI,EAEJ;IAER;EACG,CAAA"}
1
+ {"version":3,"file":"ShortcutLabel.js","names":[],"sources":["../../../src/components/ShortcutLabel/ShortcutLabel.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './ShortcutLabel.module.css';\n\nexport interface ShortcutLabelProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Keyboard shortcut string.\n *\n * Tokens are separated by `+`. Each token is rendered as its own key cap.\n * Common modifiers are normalised to their symbol:\n * - `Ctrl` / `Control` → `⌃`\n * - `Shift` → `⇧`\n * - `Alt` / `Option` → `⌥`\n * - `Super` / `Win` / `Cmd` / `Command` → `⊞`\n * - `Up` → `↑` `Down` → `↓` `Left` → `←` `Right` → `→`\n * - `Enter` / `Return` → `↵`\n * - `Backspace` → `⌫`\n * - `Delete` → `⌦`\n * - `Escape` / `Esc` → `⎋`\n * - `Tab` → `⇥`\n * - `Space` → `␣`\n *\n * @example \"Ctrl+S\" → ⌃ S\n * @example \"Ctrl+Shift+Z\" → ⌃ ⇧ Z\n */\n shortcut: string;\n /** When true, modifier tokens are shown as symbols. Defaults to `true`. */\n symbols?: boolean;\n}\n\nconst SYMBOL_MAP: Record<string, string> = {\n ctrl: '⌃',\n control: '⌃',\n shift: '⇧',\n alt: '⌥',\n option: '⌥',\n super: '⊞',\n win: '⊞',\n cmd: '⌘',\n command: '⌘',\n meta: '⌘',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n enter: '↵',\n return: '↵',\n backspace: '⌫',\n delete: '⌦',\n escape: '⎋',\n esc: '⎋',\n tab: '⇥',\n space: '␣',\n pageup: '⇞',\n pagedown: '⇟',\n home: '⇱',\n end: '⇲',\n};\n\n/**\n * Read-only display of a keyboard shortcut with per-key key-cap styling.\n *\n * Each token in the `shortcut` string (split by `+`) is rendered as a\n * separate `<kbd>` element. Modifier keys are normalised to their Unicode\n * symbols by default.\n *\n * Mirrors `GtkShortcutLabel`.\n *\n * @see https://docs.gtk.org/gtk4/class.ShortcutLabel.html\n */\nexport const ShortcutLabel = ({\n shortcut,\n symbols = true,\n className,\n ...props\n}: ShortcutLabelProps) => {\n const tokens = shortcut\n .split('+')\n .map((t) => t.trim())\n .filter(Boolean);\n\n return (\n <span\n className={[styles.label, className].filter(Boolean).join(' ')}\n aria-label={shortcut}\n {...props}\n >\n {tokens.map((token, i) => {\n const display = symbols ? (SYMBOL_MAP[token.toLowerCase()] ?? token) : token;\n\n return (\n <kbd key={i} className={styles.key}>\n {display}\n </kbd>\n );\n })}\n </span>\n );\n};\n"],"mappings":";;;AA8BA,IAAM,IAAqC;CACzC,MAAM;CACN,SAAS;CACT,OAAO;CACP,KAAK;CACL,QAAQ;CACR,OAAO;CACP,KAAK;CACL,KAAK;CACL,SAAS;CACT,MAAM;CACN,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,UAAU;CACV,MAAM;CACN,KAAK;AACP,GAaa,KAAiB,EAC5B,aACA,aAAU,IACV,cACA,GAAG,QACqB;CACxB,IAAM,IAAS,EACZ,MAAM,GAAG,EACT,KAAK,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO;CAEjB,OACE,kBAAC,QAAD;EACE,WAAW,CAAC,EAAO,OAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;EAC7D,cAAY;EACZ,GAAI;YAEH,EAAO,KAAK,GAAO,MAAM;GACxB,IAAM,IAAU,IAAW,EAAW,EAAM,YAAY,MAAM,IAAS;GAEvE,OACE,kBAAC,OAAD;IAAa,WAAW,EAAO;cAC5B;GACE,GAFK,CAEL;EAET,CAAC;CACG,CAAA;AAEV"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./ShortcutLabel/ShortcutLabel.cjs`);exports.ShortcutLabel=e.ShortcutLabel;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ShortcutLabel/ShortcutLabel.cjs");exports.ShortcutLabel=e.ShortcutLabel;
@@ -1,2 +1,2 @@
1
- const e=require(`./ShortcutsDialog.module.css.cjs`);let t=require(`react`),n=require(`react-dom`),r=require(`react/jsx-runtime`);var i=`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`;function a({open:a,onClose:o,title:s=`Keyboard Shortcuts`,sections:c}){let[l,u]=(0,t.useState)(``),d=(0,t.useRef)(null),f=(0,t.useRef)(null),p=(0,t.useRef)(null),m=(0,t.useRef)(`shortcuts-title-${Math.random().toString(36).slice(2,9)}`);(0,t.useEffect)(()=>{a?(p.current=document.activeElement,requestAnimationFrame(()=>f.current?.focus())):(u(``),p.current?.focus())},[a]);let h=(0,t.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),o();return}if(e.key!==`Tab`)return;let t=Array.from(d.current?.querySelectorAll(i)??[]);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),n.focus())},[o]);if(!a)return null;let g=l.trim().toLowerCase(),_=c.map(e=>({...e,shortcuts:e.shortcuts.filter(({description:e,keys:t})=>!g||e.toLowerCase().includes(g)||t.some(e=>e.toLowerCase().includes(g)))})).filter(e=>e.shortcuts.length>0),v=(0,r.jsx)(`div`,{className:e.default.backdrop,onClick:o,"aria-hidden":`true`,children:(0,r.jsxs)(`div`,{ref:d,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m.current,className:e.default.dialog,onKeyDown:h,onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)(`div`,{className:e.default.header,children:[(0,r.jsx)(`span`,{id:m.current,className:e.default.title,children:s}),(0,r.jsx)(`button`,{type:`button`,className:e.default.closeBtn,"aria-label":`Close`,onClick:o,children:`×`})]}),(0,r.jsxs)(`div`,{className:e.default.searchRow,children:[(0,r.jsx)(`span`,{className:e.default.searchIcon,"aria-hidden":`true`,children:`⌕`}),(0,r.jsx)(`input`,{ref:f,type:`search`,className:e.default.searchInput,placeholder:`Search shortcuts…`,value:l,onChange:e=>u(e.target.value),"aria-label":`Search shortcuts`}),l&&(0,r.jsx)(`button`,{type:`button`,className:e.default.searchClear,"aria-label":`Clear search`,onClick:()=>{u(``),f.current?.focus()},children:`×`})]}),(0,r.jsx)(`div`,{className:e.default.body,role:`list`,children:_.length===0?(0,r.jsxs)(`p`,{className:e.default.empty,children:[`No shortcuts match "`,l,`"`]}):_.map(t=>(0,r.jsxs)(`section`,{className:e.default.section,children:[(0,r.jsx)(`h3`,{className:e.default.sectionTitle,children:t.title}),(0,r.jsx)(`ul`,{className:e.default.list,children:t.shortcuts.map(t=>(0,r.jsxs)(`li`,{className:e.default.row,children:[(0,r.jsx)(`span`,{className:e.default.keys,"aria-label":t.keys.join(` + `),children:t.keys.map((n,i)=>(0,r.jsxs)(`span`,{className:e.default.keyCap,children:[(0,r.jsx)(`kbd`,{children:n}),i<t.keys.length-1&&(0,r.jsx)(`span`,{className:e.default.plus,"aria-hidden":`true`,children:`+`})]},i))}),(0,r.jsx)(`span`,{className:e.default.description,children:t.description})]},t.description))})]},t.title))})]})});return typeof document>`u`?v:(0,n.createPortal)(v,document.body)}exports.ShortcutsDialog=a;
1
+ const e=require("../Dialog/dialogUtils.cjs"),t=require("./ShortcutsDialog.module.css.cjs");let n=require("react"),r=require("react-dom"),i=require("react/jsx-runtime");var a=`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`,o=({open:o,onClose:s,title:c=`Keyboard Shortcuts`,sections:l})=>{let[u,d]=(0,n.useState)(``),f=(0,n.useRef)(null),p=(0,n.useRef)(null),m=(0,n.useRef)(null),h=(0,n.useRef)(`shortcuts-title-${Math.random().toString(36).slice(2,9)}`);e.useBodyScrollLock(o),(0,n.useEffect)(()=>{o?(m.current=document.activeElement,requestAnimationFrame(()=>p.current?.focus())):(d(``),m.current?.focus())},[o]);let g=(0,n.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),s();return}if(e.key!==`Tab`)return;let t=Array.from(f.current?.querySelectorAll(a)??[]);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),n.focus())},[s]);if(!o)return null;let _=u.trim().toLowerCase(),v=l.map(e=>({...e,shortcuts:e.shortcuts.filter(({description:e,keys:t})=>!_||e.toLowerCase().includes(_)||t.some(e=>e.toLowerCase().includes(_)))})).filter(e=>e.shortcuts.length>0),y=(0,i.jsx)(`div`,{className:t.default.backdrop,onClick:s,children:(0,i.jsxs)(`div`,{ref:f,role:`dialog`,"aria-modal":`true`,"aria-labelledby":h.current,className:t.default.dialog,onKeyDown:g,onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(`div`,{className:t.default.header,children:[(0,i.jsx)(`span`,{id:h.current,className:t.default.title,children:c}),(0,i.jsx)(`button`,{type:`button`,className:t.default.closeBtn,"aria-label":`Close`,onClick:s,children:`×`})]}),(0,i.jsxs)(`div`,{className:t.default.searchRow,children:[(0,i.jsx)(`span`,{className:t.default.searchIcon,"aria-hidden":`true`,children:`⌕`}),(0,i.jsx)(`input`,{ref:p,type:`search`,className:t.default.searchInput,placeholder:`Search shortcuts…`,value:u,onChange:e=>d(e.target.value),"aria-label":`Search shortcuts`}),u&&(0,i.jsx)(`button`,{type:`button`,className:t.default.searchClear,"aria-label":`Clear search`,onClick:()=>{d(``),p.current?.focus()},children:`×`})]}),(0,i.jsx)(`div`,{className:t.default.body,role:`list`,children:v.length===0?(0,i.jsxs)(`p`,{className:t.default.empty,children:[`No shortcuts match "`,u,`"`]}):v.map(e=>(0,i.jsxs)(`section`,{className:t.default.section,children:[(0,i.jsx)(`h3`,{className:t.default.sectionTitle,children:e.title}),(0,i.jsx)(`ul`,{className:t.default.list,children:e.shortcuts.map(e=>(0,i.jsxs)(`li`,{className:t.default.row,children:[(0,i.jsx)(`span`,{className:t.default.keys,"aria-label":e.keys.join(` + `),children:e.keys.map((n,r)=>(0,i.jsxs)(`span`,{className:t.default.keyCap,children:[(0,i.jsx)(`kbd`,{children:n}),r<e.keys.length-1&&(0,i.jsx)(`span`,{className:t.default.plus,"aria-hidden":`true`,children:`+`})]},r))}),(0,i.jsx)(`span`,{className:t.default.description,children:e.description})]},e.description))})]},e.title))})]})});return typeof document>`u`?y:(0,r.createPortal)(y,document.body)};exports.ShortcutsDialog=o;
2
2
  //# sourceMappingURL=ShortcutsDialog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutsDialog.cjs","names":[],"sources":["../../../src/components/ShortcutsDialog/ShortcutsDialog.tsx"],"sourcesContent":["import { type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport styles from './ShortcutsDialog.module.css';\n\n// ─── Public types ─────────────────────────────────────────────────────────────\n\nexport interface ShortcutEntry {\n /**\n * Key combination tokens, e.g. `[\"Ctrl\", \"S\"]` or `[\"F5\"]`.\n * Each token is rendered as a styled `<kbd>` key cap.\n */\n keys: string[];\n /** Human-readable description of what the shortcut does. */\n description: string;\n}\n\nexport interface ShortcutsSection {\n /** Section heading, e.g. \"File\", \"Edit\". */\n title: string;\n shortcuts: ShortcutEntry[];\n}\n\nexport interface ShortcutsDialogProps {\n /** Whether the dialog is visible. */\n open: boolean;\n /** Called when the dialog is dismissed (Escape, close button). */\n onClose: () => void;\n /** Dialog heading. Defaults to `\"Keyboard Shortcuts\"`. */\n title?: string;\n /** Shortcut sections to display. */\n sections: ShortcutsSection[];\n}\n\n// ─── Focusable selector (reused from Dialog) ─────────────────────────────────\n\nconst FOCUSABLE =\n 'button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Modal dialog listing keyboard shortcuts, grouped in sections, with\n * integrated search to filter by description or key name.\n *\n * Mirrors `AdwShortcutsDialog` (libadwaita 1.8 / GNOME 49).\n *\n * - Renders into a portal (`document.body`).\n * - Traps focus; Escape closes.\n * - Search filters across all sections in real time.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ShortcutsDialog.html\n */\nexport function ShortcutsDialog({\n open,\n onClose,\n title = 'Keyboard Shortcuts',\n sections,\n}: ShortcutsDialogProps) {\n const [query, setQuery] = useState('');\n const dialogRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const previouslyFocused = useRef<Element | null>(null);\n const titleId = useRef(`shortcuts-title-${Math.random().toString(36).slice(2, 9)}`);\n\n // Save / restore focus\n useEffect(() => {\n if (open) {\n previouslyFocused.current = document.activeElement;\n // Focus the search field after mount\n requestAnimationFrame(() => searchRef.current?.focus());\n } else {\n setQuery('');\n (previouslyFocused.current as HTMLElement | null)?.focus();\n }\n }, [open]);\n\n // Focus trap + Escape\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose();\n\n return;\n }\n\n if (e.key !== 'Tab') {\n return;\n }\n\n const focusable = Array.from(\n dialogRef.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? [],\n );\n\n if (focusable.length === 0) {\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n },\n [onClose],\n );\n\n if (!open) {\n return null;\n }\n\n // Filter sections by query\n const q = query.trim().toLowerCase();\n const filtered = sections\n .map((section) => ({\n ...section,\n shortcuts: section.shortcuts.filter(\n ({ description, keys }) =>\n !q ||\n description.toLowerCase().includes(q) ||\n keys.some((k) => k.toLowerCase().includes(q)),\n ),\n }))\n .filter((s) => s.shortcuts.length > 0);\n\n const node = (\n <div className={styles.backdrop} onClick={onClose} aria-hidden=\"true\">\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId.current}\n className={styles.dialog}\n onKeyDown={handleKeyDown}\n onClick={(e) => e.stopPropagation()}\n >\n {/* ── Header ── */}\n <div className={styles.header}>\n <span id={titleId.current} className={styles.title}>\n {title}\n </span>\n <button type=\"button\" className={styles.closeBtn} aria-label=\"Close\" onClick={onClose}>\n ×\n </button>\n </div>\n\n {/* ── Search ── */}\n <div className={styles.searchRow}>\n <span className={styles.searchIcon} aria-hidden=\"true\">\n ⌕\n </span>\n <input\n ref={searchRef}\n type=\"search\"\n className={styles.searchInput}\n placeholder=\"Search shortcuts…\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n aria-label=\"Search shortcuts\"\n />\n {query && (\n <button\n type=\"button\"\n className={styles.searchClear}\n aria-label=\"Clear search\"\n onClick={() => {\n setQuery('');\n searchRef.current?.focus();\n }}\n >\n ×\n </button>\n )}\n </div>\n\n {/* ── Shortcut list ── */}\n <div className={styles.body} role=\"list\">\n {filtered.length === 0 ? (\n <p className={styles.empty}>No shortcuts match \"{query}\"</p>\n ) : (\n filtered.map((section) => (\n <section key={section.title} className={styles.section}>\n <h3 className={styles.sectionTitle}>{section.title}</h3>\n <ul className={styles.list}>\n {section.shortcuts.map((shortcut) => (\n <li key={shortcut.description} className={styles.row}>\n <span className={styles.keys} aria-label={shortcut.keys.join(' + ')}>\n {shortcut.keys.map((key, i) => (\n <span key={i} className={styles.keyCap}>\n <kbd>{key}</kbd>\n {i < shortcut.keys.length - 1 && (\n <span className={styles.plus} aria-hidden=\"true\">\n +\n </span>\n )}\n </span>\n ))}\n </span>\n <span className={styles.description}>{shortcut.description}</span>\n </li>\n ))}\n </ul>\n </section>\n ))\n )}\n </div>\n </div>\n </div>\n );\n\n if (typeof document === 'undefined') {\n return node;\n }\n\n return createPortal(node, document.body);\n}\n"],"mappings":"iIAqCA,IAAM,EACJ,yFAgBF,SAAgB,EAAgB,CAC9B,OACA,UACA,QAAQ,qBACR,YACuB,CACvB,GAAM,CAAC,EAAO,IAAA,EAAA,EAAA,UAAqB,GAAG,CAChC,GAAA,EAAA,EAAA,QAAmC,KAAK,CACxC,GAAA,EAAA,EAAA,QAAqC,KAAK,CAC1C,GAAA,EAAA,EAAA,QAA2C,KAAK,CAChD,GAAA,EAAA,EAAA,QAAiB,mBAAmB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAG,EAAE,GAAG,EAGnF,EAAA,EAAA,eAAgB,CACV,GACF,EAAkB,QAAU,SAAS,cAErC,0BAA4B,EAAU,SAAS,OAAO,CAAC,GAEvD,EAAS,GAAG,CACX,EAAkB,SAAgC,OAAO,GAE3D,CAAC,EAAK,CAAC,CAGV,IAAM,GAAA,EA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AAS,KAAK,OAAS,IAC1B,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,cAAY,gBAAO,IAE1C,CAAA,CAEJ,EAPI,EAOJ,CACP,CACG,CAAA,EACP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,qBAAc,EAAS,YAAmB,CAAA,CAC/D,EAdI,EAAS,YAcb,CACL,CACC,CAAA,CACG,EArBI,EAAQ,MAqBZ,CACV,CAEA,CAAA,CACF,GACF,CAAA,CAOR,OAJI,OAAO,SAAa,IACf,GAGT,EAAA,EAAA,cAAoB,EAAM,SAAS,KAAK"}
1
+ {"version":3,"file":"ShortcutsDialog.cjs","names":[],"sources":["../../../src/components/ShortcutsDialog/ShortcutsDialog.tsx"],"sourcesContent":["import { type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport { useBodyScrollLock } from '../Dialog/dialogUtils';\n\nimport styles from './ShortcutsDialog.module.css';\n\n// ─── Public types ─────────────────────────────────────────────────────────────\n\nexport interface ShortcutEntry {\n /**\n * Key combination tokens, e.g. `[\"Ctrl\", \"S\"]` or `[\"F5\"]`.\n * Each token is rendered as a styled `<kbd>` key cap.\n */\n keys: string[];\n /** Human-readable description of what the shortcut does. */\n description: string;\n}\n\nexport interface ShortcutsSection {\n /** Section heading, e.g. \"File\", \"Edit\". */\n title: string;\n shortcuts: ShortcutEntry[];\n}\n\nexport interface ShortcutsDialogProps {\n /** Whether the dialog is visible. */\n open: boolean;\n /** Called when the dialog is dismissed (Escape, close button). */\n onClose: () => void;\n /** Dialog heading. Defaults to `\"Keyboard Shortcuts\"`. */\n title?: string;\n /** Shortcut sections to display. */\n sections: ShortcutsSection[];\n}\n\n// ─── Focusable selector (reused from Dialog) ─────────────────────────────────\n\nconst FOCUSABLE =\n 'button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Modal dialog listing keyboard shortcuts, grouped in sections, with\n * integrated search to filter by description or key name.\n *\n * Mirrors `AdwShortcutsDialog` (libadwaita 1.8 / GNOME 49).\n *\n * - Renders into a portal (`document.body`).\n * - Traps focus; Escape closes.\n * - Search filters across all sections in real time.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ShortcutsDialog.html\n */\nexport const ShortcutsDialog = ({\n open,\n onClose,\n title = 'Keyboard Shortcuts',\n sections,\n}: ShortcutsDialogProps) => {\n const [query, setQuery] = useState('');\n const dialogRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const previouslyFocused = useRef<Element | null>(null);\n const titleId = useRef(`shortcuts-title-${Math.random().toString(36).slice(2, 9)}`);\n\n useBodyScrollLock(open);\n\n // Save / restore focus\n useEffect(() => {\n if (open) {\n previouslyFocused.current = document.activeElement;\n // Focus the search field after mount\n requestAnimationFrame(() => searchRef.current?.focus());\n } else {\n setQuery('');\n (previouslyFocused.current as HTMLElement | null)?.focus();\n }\n }, [open]);\n\n // Focus trap + Escape\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClose();\n\n return;\n }\n\n if (e.key !== 'Tab') {\n return;\n }\n\n const focusable = Array.from(\n dialogRef.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? [],\n );\n\n if (focusable.length === 0) {\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n },\n [onClose],\n );\n\n if (!open) {\n return null;\n }\n\n // Filter sections by query\n const q = query.trim().toLowerCase();\n const filtered = sections\n .map((section) => ({\n ...section,\n shortcuts: section.shortcuts.filter(\n ({ description, keys }) =>\n !q ||\n description.toLowerCase().includes(q) ||\n keys.some((k) => k.toLowerCase().includes(q)),\n ),\n }))\n .filter((s) => s.shortcuts.length > 0);\n\n const node = (\n <div className={styles.backdrop} onClick={onClose}>\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId.current}\n className={styles.dialog}\n onKeyDown={handleKeyDown}\n onClick={(e) => e.stopPropagation()}\n >\n {/* ── Header ── */}\n <div className={styles.header}>\n <span id={titleId.current} className={styles.title}>\n {title}\n </span>\n <button type=\"button\" className={styles.closeBtn} aria-label=\"Close\" onClick={onClose}>\n ×\n </button>\n </div>\n\n {/* ── Search ── */}\n <div className={styles.searchRow}>\n <span className={styles.searchIcon} aria-hidden=\"true\">\n ⌕\n </span>\n <input\n ref={searchRef}\n type=\"search\"\n className={styles.searchInput}\n placeholder=\"Search shortcuts…\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n aria-label=\"Search shortcuts\"\n />\n {query && (\n <button\n type=\"button\"\n className={styles.searchClear}\n aria-label=\"Clear search\"\n onClick={() => {\n setQuery('');\n searchRef.current?.focus();\n }}\n >\n ×\n </button>\n )}\n </div>\n\n {/* ── Shortcut list ── */}\n <div className={styles.body} role=\"list\">\n {filtered.length === 0 ? (\n <p className={styles.empty}>No shortcuts match \"{query}\"</p>\n ) : (\n filtered.map((section) => (\n <section key={section.title} className={styles.section}>\n <h3 className={styles.sectionTitle}>{section.title}</h3>\n <ul className={styles.list}>\n {section.shortcuts.map((shortcut) => (\n <li key={shortcut.description} className={styles.row}>\n <span className={styles.keys} aria-label={shortcut.keys.join(' + ')}>\n {shortcut.keys.map((key, i) => (\n <span key={i} className={styles.keyCap}>\n <kbd>{key}</kbd>\n {i < shortcut.keys.length - 1 && (\n <span className={styles.plus} aria-hidden=\"true\">\n +\n </span>\n )}\n </span>\n ))}\n </span>\n <span className={styles.description}>{shortcut.description}</span>\n </li>\n ))}\n </ul>\n </section>\n ))\n )}\n </div>\n </div>\n </div>\n );\n\n if (typeof document === 'undefined') {\n return node;\n }\n\n return create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eAArB,CAA4B,uBAAqB,EAAM,GAAI,IAE3D,EAAS,IAAK,IACZ,EAAA,EAAA,MAAC,UAAD,CAA6B,UAAW,EAAA,QAAO,iBAA/C,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAA,QAAO,sBAAe,EAAQ,KAAU,CAAA,GACvD,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAA,QAAO,cACnB,EAAQ,UAAU,IAAK,IACtB,EAAA,EAAA,MAAC,KAAD,CAA+B,UAAW,EAAA,QAAO,aAAjD,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,aAAY,EAAS,KAAK,KAAK,KAAK,WAC/D,EAAS,KAAK,KAAK,EAAK,KACvB,EAAA,EAAA,MAAC,OAAD,CAAc,UAAW,EAAA,QAAO,gBAAhC,EACE,EAAA,EAAA,KAAC,MAAD,CAAA,SAAM,CAAS,CAAA,EACd,EAAI,EAAS,KAAK,OAAS,IAC1B,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,cAAY,gBAAO,GAE3C,CAAA,CAEJ,GAPK,CAOL,CACP,CACG,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,qBAAc,EAAS,WAAkB,CAAA,CAC/D,GAdK,EAAS,WAcd,CACL,CACC,CAAA,CACG,GArBK,EAAQ,KAqBb,CACV,CAEA,CAAA,CACF,GACF,CAAA,EAOP,OAJI,OAAO,SAAa,IACf,GAGT,EAAA,EAAA,cAAoB,EAAM,SAAS,IAAI,CACzC"}
@@ -34,4 +34,4 @@ export interface ShortcutsDialogProps {
34
34
  *
35
35
  * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ShortcutsDialog.html
36
36
  */
37
- export declare function ShortcutsDialog({ open, onClose, title, sections, }: ShortcutsDialogProps): import("react/jsx-runtime").JSX.Element | null;
37
+ export declare const ShortcutsDialog: ({ open, onClose, title, sections, }: ShortcutsDialogProps) => import("react/jsx-runtime").JSX.Element | null;