@neo4j-ndl/react 4.1.4 → 4.1.6

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 (531) hide show
  1. package/lib/cjs/_common/CodeBlockWrapper.js +5 -4
  2. package/lib/cjs/_common/CodeBlockWrapper.js.map +1 -1
  3. package/lib/cjs/_common/utils.js +4 -2
  4. package/lib/cjs/_common/utils.js.map +1 -1
  5. package/lib/cjs/accordion/Accordion.js +9 -6
  6. package/lib/cjs/accordion/Accordion.js.map +1 -1
  7. package/lib/cjs/accordion/accordion-types.js.map +1 -1
  8. package/lib/cjs/accordion/stories/accordion.stories.js +1 -1
  9. package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
  10. package/lib/cjs/avatar/Avatar.js +1 -1
  11. package/lib/cjs/avatar/Avatar.js.map +1 -1
  12. package/lib/cjs/banner/Banner.js +3 -2
  13. package/lib/cjs/banner/Banner.js.map +1 -1
  14. package/lib/cjs/banner/stories/banner.stories.js +1 -1
  15. package/lib/cjs/banner/stories/banner.stories.js.map +1 -1
  16. package/lib/cjs/box/Box.js +14 -2
  17. package/lib/cjs/box/Box.js.map +1 -1
  18. package/lib/cjs/box/stories/box.stories.js +2 -2
  19. package/lib/cjs/box/stories/box.stories.js.map +1 -1
  20. package/lib/cjs/breadcrumbs/Breadcrumbs.js +10 -7
  21. package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -1
  22. package/lib/cjs/button/stories/button.stories.js +2 -2
  23. package/lib/cjs/button/stories/button.stories.js.map +1 -1
  24. package/lib/cjs/checkbox/Checkbox.js +2 -1
  25. package/lib/cjs/checkbox/Checkbox.js.map +1 -1
  26. package/lib/cjs/checkbox/stories/checkbox.stories.js +1 -1
  27. package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
  28. package/lib/cjs/clipboard-button/ClipboardButton.js +6 -3
  29. package/lib/cjs/clipboard-button/ClipboardButton.js.map +1 -1
  30. package/lib/cjs/color-picker/ColorPicker.js +2 -1
  31. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  32. package/lib/cjs/data-grid/Components.js +9 -6
  33. package/lib/cjs/data-grid/Components.js.map +1 -1
  34. package/lib/cjs/data-grid/DataGrid.js +16 -4
  35. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  36. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js +28 -14
  37. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  38. package/lib/cjs/data-grid/data-grid-nav/helpers.js +2 -1
  39. package/lib/cjs/data-grid/data-grid-nav/helpers.js.map +1 -1
  40. package/lib/cjs/data-grid/stories/datagrid-component-overriding.story.js +1 -3
  41. package/lib/cjs/data-grid/stories/datagrid-component-overriding.story.js.map +1 -1
  42. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js +2 -1
  43. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  44. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js +2 -1
  45. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  46. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -2
  47. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  48. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +13 -10
  49. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  50. package/lib/cjs/date-picker/DatePicker.js +2 -1
  51. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  52. package/lib/cjs/date-picker/stories/date-picker-range.story.js +1 -1
  53. package/lib/cjs/date-picker/stories/date-picker-range.story.js.map +1 -1
  54. package/lib/cjs/date-picker/stories/date-picker.stories.js +1 -1
  55. package/lib/cjs/date-picker/stories/date-picker.stories.js.map +1 -1
  56. package/lib/cjs/dialog/Dialog.js +20 -13
  57. package/lib/cjs/dialog/Dialog.js.map +1 -1
  58. package/lib/cjs/dialog/dialog-context.js +35 -6
  59. package/lib/cjs/dialog/dialog-context.js.map +1 -1
  60. package/lib/cjs/dialog/stories/dialog.stories.js +1 -1
  61. package/lib/cjs/dialog/stories/dialog.stories.js.map +1 -1
  62. package/lib/cjs/divider/stories/divider.stories.js +1 -1
  63. package/lib/cjs/divider/stories/divider.stories.js.map +1 -1
  64. package/lib/cjs/drawer/Drawer.js +9 -8
  65. package/lib/cjs/drawer/Drawer.js.map +1 -1
  66. package/lib/cjs/dropdown-button/DropdownButton.js +14 -2
  67. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  68. package/lib/cjs/dropzone/Dropzone.js +3 -2
  69. package/lib/cjs/dropzone/Dropzone.js.map +1 -1
  70. package/lib/cjs/dropzone/stories/dropzone-csv-files.story.js +1 -3
  71. package/lib/cjs/dropzone/stories/dropzone-csv-files.story.js.map +1 -1
  72. package/lib/cjs/dropzone/stories/dropzone-custom-extensions.story.js +1 -3
  73. package/lib/cjs/dropzone/stories/dropzone-custom-extensions.story.js.map +1 -1
  74. package/lib/cjs/dropzone/stories/dropzone-default.story.js +1 -3
  75. package/lib/cjs/dropzone/stories/dropzone-default.story.js.map +1 -1
  76. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -3
  77. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  78. package/lib/cjs/flex/Flex.js +14 -2
  79. package/lib/cjs/flex/Flex.js.map +1 -1
  80. package/lib/cjs/graph-label/GraphLabel.js +18 -4
  81. package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
  82. package/lib/cjs/icon-button/stories/icon-button.stories.js +1 -1
  83. package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
  84. package/lib/cjs/icon-button-array/IconButtonArray.js +14 -2
  85. package/lib/cjs/icon-button-array/IconButtonArray.js.map +1 -1
  86. package/lib/cjs/icon-button-array/index.js +1 -1
  87. package/lib/cjs/icon-button-array/index.js.map +1 -1
  88. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +1 -1
  89. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  90. package/lib/cjs/icons/generated/custom/index.js +4 -2
  91. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  92. package/lib/cjs/icons/wrapIcon.js +1 -1
  93. package/lib/cjs/icons/wrapIcon.js.map +1 -1
  94. package/lib/cjs/inline-edit/InlineEdit.js +18 -6
  95. package/lib/cjs/inline-edit/InlineEdit.js.map +1 -1
  96. package/lib/cjs/kbd/Kbd.js +5 -3
  97. package/lib/cjs/kbd/Kbd.js.map +1 -1
  98. package/lib/cjs/kbd/stories/kbd.stories.js +1 -1
  99. package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
  100. package/lib/cjs/loading-bar/LoadingBar.js +14 -2
  101. package/lib/cjs/loading-bar/LoadingBar.js.map +1 -1
  102. package/lib/cjs/loading-spinner/LoadingSpinner.js +1 -1
  103. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
  104. package/lib/cjs/logo/stories/logo.stories.js +1 -1
  105. package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
  106. package/lib/cjs/menu/Menu.js +9 -6
  107. package/lib/cjs/menu/Menu.js.map +1 -1
  108. package/lib/cjs/popover/Popover.js +6 -4
  109. package/lib/cjs/popover/Popover.js.map +1 -1
  110. package/lib/cjs/popover/stories/popover-custom-offset.story.js +2 -1
  111. package/lib/cjs/popover/stories/popover-custom-offset.story.js.map +1 -1
  112. package/lib/cjs/popover/stories/popover-separate-anchor.story.js +1 -1
  113. package/lib/cjs/popover/stories/popover-separate-anchor.story.js.map +1 -1
  114. package/lib/cjs/progress-bar/ProgressBar.js +1 -1
  115. package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
  116. package/lib/cjs/radio/Radio.js +2 -1
  117. package/lib/cjs/radio/Radio.js.map +1 -1
  118. package/lib/cjs/radio/stories/radio.stories.js +1 -1
  119. package/lib/cjs/radio/stories/radio.stories.js.map +1 -1
  120. package/lib/cjs/select/Overrides.js +1 -1
  121. package/lib/cjs/select/Overrides.js.map +1 -1
  122. package/lib/cjs/select/Select.js +18 -6
  123. package/lib/cjs/select/Select.js.map +1 -1
  124. package/lib/cjs/side-navigation/SideNavigation.js +5 -4
  125. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  126. package/lib/cjs/skeleton/Skeleton.js +14 -2
  127. package/lib/cjs/skeleton/Skeleton.js.map +1 -1
  128. package/lib/cjs/skeleton/stories/skeleton.stories.js +1 -1
  129. package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
  130. package/lib/cjs/spotlight/Spotlight.js +33 -14
  131. package/lib/cjs/spotlight/Spotlight.js.map +1 -1
  132. package/lib/cjs/spotlight/SpotlightProvider.js +6 -3
  133. package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -1
  134. package/lib/cjs/spotlight/SpotlightTarget.js +14 -2
  135. package/lib/cjs/spotlight/SpotlightTarget.js.map +1 -1
  136. package/lib/cjs/spotlight/SpotlightTour.js +1 -1
  137. package/lib/cjs/spotlight/SpotlightTour.js.map +1 -1
  138. package/lib/cjs/spotlight/stories/spotlight.stories.js +1 -1
  139. package/lib/cjs/spotlight/stories/spotlight.stories.js.map +1 -1
  140. package/lib/cjs/spotlight/use-indicator.js +2 -1
  141. package/lib/cjs/spotlight/use-indicator.js.map +1 -1
  142. package/lib/cjs/status-label/StatusLabel.js +1 -1
  143. package/lib/cjs/status-label/StatusLabel.js.map +1 -1
  144. package/lib/cjs/switch/Switch.js +2 -1
  145. package/lib/cjs/switch/Switch.js.map +1 -1
  146. package/lib/cjs/switch/stories/switch.stories.js +1 -1
  147. package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
  148. package/lib/cjs/tabs/stories/tabs-disabled.story.js +1 -1
  149. package/lib/cjs/tabs/stories/tabs-disabled.story.js.map +1 -1
  150. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js +1 -1
  151. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  152. package/lib/cjs/tabs/stories/tabs-overflow.story.js +1 -1
  153. package/lib/cjs/tabs/stories/tabs-overflow.story.js.map +1 -1
  154. package/lib/cjs/tabs/stories/tabs-sizes.story.js +1 -1
  155. package/lib/cjs/tabs/stories/tabs-sizes.story.js.map +1 -1
  156. package/lib/cjs/tabs/use-tabs-scroll-overflow.js +8 -4
  157. package/lib/cjs/tabs/use-tabs-scroll-overflow.js.map +1 -1
  158. package/lib/cjs/tag/Tag.js +14 -2
  159. package/lib/cjs/tag/Tag.js.map +1 -1
  160. package/lib/cjs/text-area/TextArea.js +14 -2
  161. package/lib/cjs/text-area/TextArea.js.map +1 -1
  162. package/lib/cjs/text-area/stories/text-area.stories.js +1 -1
  163. package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
  164. package/lib/cjs/text-input/TextInput.js +14 -2
  165. package/lib/cjs/text-input/TextInput.js.map +1 -1
  166. package/lib/cjs/text-link/TextLink.js +14 -2
  167. package/lib/cjs/text-link/TextLink.js.map +1 -1
  168. package/lib/cjs/text-overflow/TextOverflow.js +2 -1
  169. package/lib/cjs/text-overflow/TextOverflow.js.map +1 -1
  170. package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
  171. package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
  172. package/lib/cjs/text-overflow/text-overflow-utils.js +12 -6
  173. package/lib/cjs/text-overflow/text-overflow-utils.js.map +1 -1
  174. package/lib/cjs/text-overflow/use-ellipsis-observer.js +2 -1
  175. package/lib/cjs/text-overflow/use-ellipsis-observer.js.map +1 -1
  176. package/lib/cjs/text-overflow/use-truncate-with-button.js +4 -2
  177. package/lib/cjs/text-overflow/use-truncate-with-button.js.map +1 -1
  178. package/lib/cjs/theme/ThemeProvider.js +2 -1
  179. package/lib/cjs/theme/ThemeProvider.js.map +1 -1
  180. package/lib/cjs/time-picker/TimePicker.js +22 -8
  181. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  182. package/lib/cjs/time-picker/stories/time-picker.stories.js +1 -1
  183. package/lib/cjs/time-picker/stories/time-picker.stories.js.map +1 -1
  184. package/lib/cjs/timezone-picker/TimeZonePicker.js +8 -4
  185. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  186. package/lib/cjs/timezone-picker/generate-timezone-options.js +15 -9
  187. package/lib/cjs/timezone-picker/generate-timezone-options.js.map +1 -1
  188. package/lib/cjs/timezone-picker/stories/timezone-picker.stories.js +1 -1
  189. package/lib/cjs/timezone-picker/stories/timezone-picker.stories.js.map +1 -1
  190. package/lib/cjs/toast/Toast.js +11 -6
  191. package/lib/cjs/toast/Toast.js.map +1 -1
  192. package/lib/cjs/tooltip/Tooltip.js +35 -15
  193. package/lib/cjs/tooltip/Tooltip.js.map +1 -1
  194. package/lib/cjs/tree-view/TreeItemWrapper.js +3 -1
  195. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  196. package/lib/cjs/tree-view/TreeView.js +2 -1
  197. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  198. package/lib/cjs/tree-view/TreeViewItem.js +3 -1
  199. package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
  200. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -2
  201. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  202. package/lib/cjs/tree-view/TreeViewTrail.js +14 -2
  203. package/lib/cjs/tree-view/TreeViewTrail.js.map +1 -1
  204. package/lib/cjs/wizard/Wizard.js +3 -2
  205. package/lib/cjs/wizard/Wizard.js.map +1 -1
  206. package/lib/esm/_common/CodeBlockWrapper.js +5 -4
  207. package/lib/esm/_common/CodeBlockWrapper.js.map +1 -1
  208. package/lib/esm/_common/utils.js +4 -2
  209. package/lib/esm/_common/utils.js.map +1 -1
  210. package/lib/esm/accordion/Accordion.js +9 -6
  211. package/lib/esm/accordion/Accordion.js.map +1 -1
  212. package/lib/esm/accordion/accordion-types.js.map +1 -1
  213. package/lib/esm/accordion/stories/accordion.stories.js +1 -1
  214. package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
  215. package/lib/esm/avatar/Avatar.js +1 -1
  216. package/lib/esm/avatar/Avatar.js.map +1 -1
  217. package/lib/esm/banner/Banner.js +3 -2
  218. package/lib/esm/banner/Banner.js.map +1 -1
  219. package/lib/esm/banner/stories/banner.stories.js +1 -1
  220. package/lib/esm/banner/stories/banner.stories.js.map +1 -1
  221. package/lib/esm/box/Box.js +14 -2
  222. package/lib/esm/box/Box.js.map +1 -1
  223. package/lib/esm/box/stories/box.stories.js +2 -2
  224. package/lib/esm/box/stories/box.stories.js.map +1 -1
  225. package/lib/esm/breadcrumbs/Breadcrumbs.js +10 -7
  226. package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -1
  227. package/lib/esm/button/stories/button.stories.js +1 -1
  228. package/lib/esm/button/stories/button.stories.js.map +1 -1
  229. package/lib/esm/checkbox/Checkbox.js +2 -1
  230. package/lib/esm/checkbox/Checkbox.js.map +1 -1
  231. package/lib/esm/checkbox/stories/checkbox.stories.js +1 -1
  232. package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
  233. package/lib/esm/clipboard-button/ClipboardButton.js +6 -3
  234. package/lib/esm/clipboard-button/ClipboardButton.js.map +1 -1
  235. package/lib/esm/color-picker/ColorPicker.js +2 -1
  236. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  237. package/lib/esm/data-grid/Components.js +9 -6
  238. package/lib/esm/data-grid/Components.js.map +1 -1
  239. package/lib/esm/data-grid/DataGrid.js +16 -4
  240. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  241. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js +28 -14
  242. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  243. package/lib/esm/data-grid/data-grid-nav/helpers.js +2 -1
  244. package/lib/esm/data-grid/data-grid-nav/helpers.js.map +1 -1
  245. package/lib/esm/data-grid/stories/datagrid-component-overriding.story.js +1 -3
  246. package/lib/esm/data-grid/stories/datagrid-component-overriding.story.js.map +1 -1
  247. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js +2 -1
  248. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  249. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js +2 -1
  250. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  251. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -2
  252. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  253. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +9 -6
  254. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  255. package/lib/esm/date-picker/DatePicker.js +2 -1
  256. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  257. package/lib/esm/date-picker/stories/date-picker-range.story.js +1 -1
  258. package/lib/esm/date-picker/stories/date-picker-range.story.js.map +1 -1
  259. package/lib/esm/date-picker/stories/date-picker.stories.js +1 -1
  260. package/lib/esm/date-picker/stories/date-picker.stories.js.map +1 -1
  261. package/lib/esm/dialog/Dialog.js +20 -13
  262. package/lib/esm/dialog/Dialog.js.map +1 -1
  263. package/lib/esm/dialog/dialog-context.js +1 -2
  264. package/lib/esm/dialog/dialog-context.js.map +1 -1
  265. package/lib/esm/dialog/stories/dialog.stories.js +1 -1
  266. package/lib/esm/dialog/stories/dialog.stories.js.map +1 -1
  267. package/lib/esm/divider/stories/divider.stories.js +1 -1
  268. package/lib/esm/divider/stories/divider.stories.js.map +1 -1
  269. package/lib/esm/drawer/Drawer.js +9 -8
  270. package/lib/esm/drawer/Drawer.js.map +1 -1
  271. package/lib/esm/dropdown-button/DropdownButton.js +14 -2
  272. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  273. package/lib/esm/dropzone/Dropzone.js +3 -2
  274. package/lib/esm/dropzone/Dropzone.js.map +1 -1
  275. package/lib/esm/dropzone/stories/dropzone-csv-files.story.js +1 -3
  276. package/lib/esm/dropzone/stories/dropzone-csv-files.story.js.map +1 -1
  277. package/lib/esm/dropzone/stories/dropzone-custom-extensions.story.js +1 -3
  278. package/lib/esm/dropzone/stories/dropzone-custom-extensions.story.js.map +1 -1
  279. package/lib/esm/dropzone/stories/dropzone-default.story.js +1 -3
  280. package/lib/esm/dropzone/stories/dropzone-default.story.js.map +1 -1
  281. package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -3
  282. package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  283. package/lib/esm/flex/Flex.js +14 -2
  284. package/lib/esm/flex/Flex.js.map +1 -1
  285. package/lib/esm/graph-label/GraphLabel.js +18 -4
  286. package/lib/esm/graph-label/GraphLabel.js.map +1 -1
  287. package/lib/esm/icon-button/stories/icon-button.stories.js +1 -1
  288. package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
  289. package/lib/esm/icon-button-array/IconButtonArray.js +14 -2
  290. package/lib/esm/icon-button-array/IconButtonArray.js.map +1 -1
  291. package/lib/esm/icon-button-array/index.js +1 -1
  292. package/lib/esm/icon-button-array/index.js.map +1 -1
  293. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +1 -1
  294. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  295. package/lib/esm/icons/generated/custom/index.js +1 -0
  296. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  297. package/lib/esm/icons/wrapIcon.js +1 -1
  298. package/lib/esm/icons/wrapIcon.js.map +1 -1
  299. package/lib/esm/inline-edit/InlineEdit.js +18 -6
  300. package/lib/esm/inline-edit/InlineEdit.js.map +1 -1
  301. package/lib/esm/kbd/Kbd.js +5 -3
  302. package/lib/esm/kbd/Kbd.js.map +1 -1
  303. package/lib/esm/kbd/stories/kbd.stories.js +1 -1
  304. package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
  305. package/lib/esm/loading-bar/LoadingBar.js +14 -2
  306. package/lib/esm/loading-bar/LoadingBar.js.map +1 -1
  307. package/lib/esm/loading-spinner/LoadingSpinner.js +1 -1
  308. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
  309. package/lib/esm/logo/stories/logo.stories.js +1 -1
  310. package/lib/esm/logo/stories/logo.stories.js.map +1 -1
  311. package/lib/esm/menu/Menu.js +9 -6
  312. package/lib/esm/menu/Menu.js.map +1 -1
  313. package/lib/esm/popover/Popover.js +6 -4
  314. package/lib/esm/popover/Popover.js.map +1 -1
  315. package/lib/esm/popover/stories/popover-custom-offset.story.js +2 -1
  316. package/lib/esm/popover/stories/popover-custom-offset.story.js.map +1 -1
  317. package/lib/esm/popover/stories/popover-separate-anchor.story.js +1 -1
  318. package/lib/esm/popover/stories/popover-separate-anchor.story.js.map +1 -1
  319. package/lib/esm/progress-bar/ProgressBar.js +1 -1
  320. package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
  321. package/lib/esm/radio/Radio.js +2 -1
  322. package/lib/esm/radio/Radio.js.map +1 -1
  323. package/lib/esm/radio/stories/radio.stories.js +1 -1
  324. package/lib/esm/radio/stories/radio.stories.js.map +1 -1
  325. package/lib/esm/select/Overrides.js +1 -1
  326. package/lib/esm/select/Overrides.js.map +1 -1
  327. package/lib/esm/select/Select.js +18 -6
  328. package/lib/esm/select/Select.js.map +1 -1
  329. package/lib/esm/side-navigation/SideNavigation.js +5 -4
  330. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  331. package/lib/esm/skeleton/Skeleton.js +14 -2
  332. package/lib/esm/skeleton/Skeleton.js.map +1 -1
  333. package/lib/esm/skeleton/stories/skeleton.stories.js +1 -1
  334. package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
  335. package/lib/esm/spotlight/Spotlight.js +33 -14
  336. package/lib/esm/spotlight/Spotlight.js.map +1 -1
  337. package/lib/esm/spotlight/SpotlightProvider.js +6 -3
  338. package/lib/esm/spotlight/SpotlightProvider.js.map +1 -1
  339. package/lib/esm/spotlight/SpotlightTarget.js +14 -2
  340. package/lib/esm/spotlight/SpotlightTarget.js.map +1 -1
  341. package/lib/esm/spotlight/SpotlightTour.js +1 -1
  342. package/lib/esm/spotlight/SpotlightTour.js.map +1 -1
  343. package/lib/esm/spotlight/stories/spotlight.stories.js +1 -1
  344. package/lib/esm/spotlight/stories/spotlight.stories.js.map +1 -1
  345. package/lib/esm/spotlight/use-indicator.js +2 -1
  346. package/lib/esm/spotlight/use-indicator.js.map +1 -1
  347. package/lib/esm/status-label/StatusLabel.js +1 -1
  348. package/lib/esm/status-label/StatusLabel.js.map +1 -1
  349. package/lib/esm/switch/Switch.js +2 -1
  350. package/lib/esm/switch/Switch.js.map +1 -1
  351. package/lib/esm/switch/stories/switch.stories.js +1 -1
  352. package/lib/esm/switch/stories/switch.stories.js.map +1 -1
  353. package/lib/esm/tabs/stories/tabs-disabled.story.js +1 -1
  354. package/lib/esm/tabs/stories/tabs-disabled.story.js.map +1 -1
  355. package/lib/esm/tabs/stories/tabs-fill-variants.story.js +1 -1
  356. package/lib/esm/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  357. package/lib/esm/tabs/stories/tabs-overflow.story.js +1 -1
  358. package/lib/esm/tabs/stories/tabs-overflow.story.js.map +1 -1
  359. package/lib/esm/tabs/stories/tabs-sizes.story.js +1 -1
  360. package/lib/esm/tabs/stories/tabs-sizes.story.js.map +1 -1
  361. package/lib/esm/tabs/use-tabs-scroll-overflow.js +8 -4
  362. package/lib/esm/tabs/use-tabs-scroll-overflow.js.map +1 -1
  363. package/lib/esm/tag/Tag.js +14 -2
  364. package/lib/esm/tag/Tag.js.map +1 -1
  365. package/lib/esm/text-area/TextArea.js +14 -2
  366. package/lib/esm/text-area/TextArea.js.map +1 -1
  367. package/lib/esm/text-area/stories/text-area.stories.js +1 -1
  368. package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
  369. package/lib/esm/text-input/TextInput.js +14 -2
  370. package/lib/esm/text-input/TextInput.js.map +1 -1
  371. package/lib/esm/text-link/TextLink.js +14 -2
  372. package/lib/esm/text-link/TextLink.js.map +1 -1
  373. package/lib/esm/text-overflow/TextOverflow.js +2 -1
  374. package/lib/esm/text-overflow/TextOverflow.js.map +1 -1
  375. package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
  376. package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
  377. package/lib/esm/text-overflow/text-overflow-utils.js +12 -6
  378. package/lib/esm/text-overflow/text-overflow-utils.js.map +1 -1
  379. package/lib/esm/text-overflow/use-ellipsis-observer.js +2 -1
  380. package/lib/esm/text-overflow/use-ellipsis-observer.js.map +1 -1
  381. package/lib/esm/text-overflow/use-truncate-with-button.js +4 -2
  382. package/lib/esm/text-overflow/use-truncate-with-button.js.map +1 -1
  383. package/lib/esm/theme/ThemeProvider.js +2 -1
  384. package/lib/esm/theme/ThemeProvider.js.map +1 -1
  385. package/lib/esm/time-picker/TimePicker.js +22 -8
  386. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  387. package/lib/esm/time-picker/stories/time-picker.stories.js +1 -1
  388. package/lib/esm/time-picker/stories/time-picker.stories.js.map +1 -1
  389. package/lib/esm/timezone-picker/TimeZonePicker.js +8 -4
  390. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  391. package/lib/esm/timezone-picker/generate-timezone-options.js +15 -9
  392. package/lib/esm/timezone-picker/generate-timezone-options.js.map +1 -1
  393. package/lib/esm/timezone-picker/stories/timezone-picker.stories.js +1 -1
  394. package/lib/esm/timezone-picker/stories/timezone-picker.stories.js.map +1 -1
  395. package/lib/esm/toast/Toast.js +11 -6
  396. package/lib/esm/toast/Toast.js.map +1 -1
  397. package/lib/esm/tooltip/Tooltip.js +35 -15
  398. package/lib/esm/tooltip/Tooltip.js.map +1 -1
  399. package/lib/esm/tree-view/TreeItemWrapper.js +3 -1
  400. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  401. package/lib/esm/tree-view/TreeView.js +2 -1
  402. package/lib/esm/tree-view/TreeView.js.map +1 -1
  403. package/lib/esm/tree-view/TreeViewItem.js +3 -1
  404. package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
  405. package/lib/esm/tree-view/TreeViewTextItem.js +1 -2
  406. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  407. package/lib/esm/tree-view/TreeViewTrail.js +14 -2
  408. package/lib/esm/tree-view/TreeViewTrail.js.map +1 -1
  409. package/lib/esm/wizard/Wizard.js +3 -2
  410. package/lib/esm/wizard/Wizard.js.map +1 -1
  411. package/lib/types/_common/CodeBlockWrapper.d.ts +1 -1
  412. package/lib/types/_common/CodeBlockWrapper.d.ts.map +1 -1
  413. package/lib/types/_common/utils.d.ts.map +1 -1
  414. package/lib/types/accordion/Accordion.d.ts +4 -4
  415. package/lib/types/accordion/Accordion.d.ts.map +1 -1
  416. package/lib/types/accordion/accordion-types.d.ts +1 -1
  417. package/lib/types/accordion/accordion-types.d.ts.map +1 -1
  418. package/lib/types/accordion/stories/accordion.stories.d.ts +4 -4
  419. package/lib/types/avatar/Avatar.d.ts.map +1 -1
  420. package/lib/types/banner/Banner.d.ts +1 -1
  421. package/lib/types/banner/Banner.d.ts.map +1 -1
  422. package/lib/types/box/Box.d.ts +1 -1
  423. package/lib/types/box/Box.d.ts.map +1 -1
  424. package/lib/types/box/stories/box.stories.d.ts +1 -1
  425. package/lib/types/breadcrumbs/Breadcrumbs.d.ts +3 -3
  426. package/lib/types/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  427. package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +3 -3
  428. package/lib/types/button/stories/button.stories.d.ts +1 -1
  429. package/lib/types/button/stories/button.stories.d.ts.map +1 -1
  430. package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
  431. package/lib/types/clipboard-button/ClipboardButton.d.ts.map +1 -1
  432. package/lib/types/color-picker/ColorPicker.d.ts.map +1 -1
  433. package/lib/types/data-grid/Components.d.ts.map +1 -1
  434. package/lib/types/data-grid/DataGrid.d.ts +23 -23
  435. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  436. package/lib/types/data-grid/data-grid-nav/data-grid-nav.d.ts.map +1 -1
  437. package/lib/types/data-grid/data-grid-nav/helpers.d.ts.map +1 -1
  438. package/lib/types/data-grid/stories/datagrid-component-overriding.story.d.ts.map +1 -1
  439. package/lib/types/data-grid/stories/datagrid-in-dialog.story.d.ts.map +1 -1
  440. package/lib/types/data-grid/stories/datagrid-keyboard-navigation.story.d.ts.map +1 -1
  441. package/lib/types/data-grid/stories/datagrid-kitchen-sink.story.d.ts.map +1 -1
  442. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +1 -1
  443. package/lib/types/data-grid/stories/datagrid-placeholder-states.stories.d.ts +1 -1
  444. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +1 -1
  445. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
  446. package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
  447. package/lib/types/date-picker/stories/date-picker-range.story.d.ts.map +1 -1
  448. package/lib/types/dialog/Dialog.d.ts +6 -6
  449. package/lib/types/dialog/Dialog.d.ts.map +1 -1
  450. package/lib/types/dialog/dialog-context.d.ts.map +1 -1
  451. package/lib/types/drawer/Drawer.d.ts +3 -3
  452. package/lib/types/drawer/Drawer.d.ts.map +1 -1
  453. package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
  454. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  455. package/lib/types/dropzone/Dropzone.d.ts.map +1 -1
  456. package/lib/types/flex/Flex.d.ts +1 -1
  457. package/lib/types/flex/Flex.d.ts.map +1 -1
  458. package/lib/types/flex/stories/flex.stories.d.ts +1 -1
  459. package/lib/types/graph-label/GraphLabel.d.ts +1 -1
  460. package/lib/types/graph-label/GraphLabel.d.ts.map +1 -1
  461. package/lib/types/icon-button-array/IconButtonArray.d.ts +2 -2
  462. package/lib/types/icon-button-array/IconButtonArray.d.ts.map +1 -1
  463. package/lib/types/icon-button-array/index.d.ts +1 -1
  464. package/lib/types/icon-button-array/index.d.ts.map +1 -1
  465. package/lib/types/icons/generated/custom/index.d.ts +1 -0
  466. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  467. package/lib/types/inline-edit/InlineEdit.d.ts +1 -1
  468. package/lib/types/inline-edit/InlineEdit.d.ts.map +1 -1
  469. package/lib/types/kbd/Kbd.d.ts.map +1 -1
  470. package/lib/types/loading-bar/LoadingBar.d.ts +1 -1
  471. package/lib/types/loading-bar/LoadingBar.d.ts.map +1 -1
  472. package/lib/types/menu/Menu.d.ts +2 -2
  473. package/lib/types/menu/Menu.d.ts.map +1 -1
  474. package/lib/types/popover/Popover.d.ts +1 -1
  475. package/lib/types/popover/Popover.d.ts.map +1 -1
  476. package/lib/types/popover/stories/popover-custom-offset.story.d.ts.map +1 -1
  477. package/lib/types/radio/Radio.d.ts.map +1 -1
  478. package/lib/types/select/Overrides.d.ts +1 -2
  479. package/lib/types/select/Overrides.d.ts.map +1 -1
  480. package/lib/types/select/Select.d.ts +1 -1
  481. package/lib/types/select/Select.d.ts.map +1 -1
  482. package/lib/types/side-navigation/SideNavigation.d.ts +1 -1
  483. package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
  484. package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
  485. package/lib/types/skeleton/Skeleton.d.ts +1 -1
  486. package/lib/types/skeleton/Skeleton.d.ts.map +1 -1
  487. package/lib/types/skeleton/stories/skeleton.stories.d.ts +1 -1
  488. package/lib/types/spotlight/Spotlight.d.ts +6 -6
  489. package/lib/types/spotlight/Spotlight.d.ts.map +1 -1
  490. package/lib/types/spotlight/SpotlightProvider.d.ts.map +1 -1
  491. package/lib/types/spotlight/SpotlightTarget.d.ts +1 -1
  492. package/lib/types/spotlight/SpotlightTarget.d.ts.map +1 -1
  493. package/lib/types/spotlight/use-indicator.d.ts.map +1 -1
  494. package/lib/types/switch/Switch.d.ts.map +1 -1
  495. package/lib/types/tabs/use-tabs-scroll-overflow.d.ts.map +1 -1
  496. package/lib/types/tag/Tag.d.ts +1 -1
  497. package/lib/types/tag/Tag.d.ts.map +1 -1
  498. package/lib/types/text-area/TextArea.d.ts +1 -1
  499. package/lib/types/text-area/TextArea.d.ts.map +1 -1
  500. package/lib/types/text-input/TextInput.d.ts +1 -1
  501. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  502. package/lib/types/text-link/TextLink.d.ts +1 -1
  503. package/lib/types/text-link/TextLink.d.ts.map +1 -1
  504. package/lib/types/text-overflow/TextOverflow.d.ts.map +1 -1
  505. package/lib/types/text-overflow/text-overflow-utils.d.ts.map +1 -1
  506. package/lib/types/text-overflow/use-ellipsis-observer.d.ts.map +1 -1
  507. package/lib/types/text-overflow/use-truncate-with-button.d.ts.map +1 -1
  508. package/lib/types/theme/ThemeProvider.d.ts.map +1 -1
  509. package/lib/types/time-picker/TimePicker.d.ts +1 -1
  510. package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
  511. package/lib/types/time-picker/stories/time-picker.stories.d.ts +1 -1
  512. package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
  513. package/lib/types/timezone-picker/generate-timezone-options.d.ts.map +1 -1
  514. package/lib/types/toast/Toast.d.ts +1 -1
  515. package/lib/types/toast/Toast.d.ts.map +1 -1
  516. package/lib/types/tooltip/Tooltip.d.ts +8 -7
  517. package/lib/types/tooltip/Tooltip.d.ts.map +1 -1
  518. package/lib/types/tree-view/TreeItemWrapper.d.ts.map +1 -1
  519. package/lib/types/tree-view/TreeView.d.ts.map +1 -1
  520. package/lib/types/tree-view/TreeViewItem.d.ts.map +1 -1
  521. package/lib/types/tree-view/TreeViewTrail.d.ts +2 -1
  522. package/lib/types/tree-view/TreeViewTrail.d.ts.map +1 -1
  523. package/lib/types/wizard/Wizard.d.ts +1 -1
  524. package/lib/types/wizard/Wizard.d.ts.map +1 -1
  525. package/package.json +1 -1
  526. package/lib/cjs/dropdown-button/avatar-test.stories.tsx.js +0 -31
  527. package/lib/cjs/dropdown-button/avatar-test.stories.tsx.js.map +0 -1
  528. package/lib/esm/dropdown-button/avatar-test.stories.tsx.js +0 -27
  529. package/lib/esm/dropdown-button/avatar-test.stories.tsx.js.map +0 -1
  530. package/lib/types/dropdown-button/avatar-test.stories.tsx.d.ts +0 -24
  531. package/lib/types/dropdown-button/avatar-test.stories.tsx.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/loading-spinner/LoadingSpinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAiBpC;;;;;;GAMG;AAEI,MAAM,cAAc,GAAG,CAAsC,EAOnB,EAAE,EAAE;QAPe,EAClE,EAAE,EACF,IAAI,GAAG,OAAO,EACd,SAAS,EACT,cAAc,EACd,GAAG,OAE4C,EAD5C,SAAS,cANsD,oDAOnE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,IAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,kBAAkB,EAAE,SAAS,EAAE;QACxD,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,eAClB,QAAQ,EAClB,GAAG,EAAE,GAAG,IACJ,cAAc,EACd,SAAS,cAEb,gCAAK,SAAS,EAAC,UAAU,GAAG,IAClB,CACb,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype LoadingSpinnerProps = {\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n *\n *\n * LoadingSpinner Component\n *\n *\n */\n\nexport const LoadingSpinner = <T extends React.ElementType = 'div'>({\n as,\n size = 'small',\n className,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, LoadingSpinnerProps>) => {\n const Component: React.ElementType = as || 'div';\n const classes = classNames('ndl-spin-wrapper', className, {\n 'ndl-small': size === 'small',\n 'ndl-medium': size === 'medium',\n 'ndl-large': size === 'large',\n });\n\n return (\n <Component\n className={classes}\n role=\"status\"\n aria-label=\"Loading content\"\n aria-live=\"polite\"\n ref={ref}\n {...htmlAttributes}\n {...restProps}\n >\n <div className=\"ndl-spin\" />\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/loading-spinner/LoadingSpinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAiBpC;;;;;;GAMG;AAEI,MAAM,cAAc,GAAG,CAAsC,EAOnB,EAAE,EAAE;QAPe,EAClE,EAAE,EACF,IAAI,GAAG,OAAO,EACd,SAAS,EACT,cAAc,EACd,GAAG,OAE4C,EAD5C,SAAS,cANsD,oDAOnE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,IAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,kBAAkB,EAAE,SAAS,EAAE;QACxD,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,eAClB,QAAQ,EAClB,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAElB,gCAAK,SAAS,EAAC,UAAU,GAAG,IAClB,CACb,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype LoadingSpinnerProps = {\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n *\n *\n * LoadingSpinner Component\n *\n *\n */\n\nexport const LoadingSpinner = <T extends React.ElementType = 'div'>({\n as,\n size = 'small',\n className,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, LoadingSpinnerProps>) => {\n const Component: React.ElementType = as || 'div';\n const classes = classNames('ndl-spin-wrapper', className, {\n 'ndl-small': size === 'small',\n 'ndl-medium': size === 'medium',\n 'ndl-large': size === 'large',\n });\n\n return (\n <Component\n className={classes}\n role=\"status\"\n aria-label=\"Loading content\"\n aria-live=\"polite\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-spin\" />\n </Component>\n );\n};\n"]}
@@ -23,7 +23,7 @@
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Icon = exports.Black = exports.Default = void 0;
25
25
  const index_1 = require("../../index");
26
- const _1 = require("./");
26
+ const _1 = require(".");
27
27
  const componentMeta = {
28
28
  title: 'Components/Logo',
29
29
  id: 'components-logo',
@@ -1 +1 @@
1
- {"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../../src/logo/stories/logo.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAmC;AACnC,yBAOY;AAEZ,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,iBAAiB;IACxB,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,YAAI;IACf,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;CAC0B,CAAC;AAE9B,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,YAAS;IACjB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAY;aACnB;SACF;KACF;CACF,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,WAAQ;IAChB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,cAAW;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Logo } from '../../index';\nimport {\n LogoBlack,\n LogoBlackSrc,\n LogoDefault,\n LogoDefaultSrc,\n LogoIcon,\n LogoIconSrc,\n} from './';\n\nconst componentMeta = {\n title: 'Components/Logo',\n id: 'components-logo',\n component: Logo,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n} satisfies Meta<typeof Logo>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoDefaultSrc,\n },\n },\n },\n};\n\nexport const Black: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoBlack,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoBlackSrc,\n },\n },\n },\n};\n\nexport const Icon: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoIcon,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoIconSrc,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../../src/logo/stories/logo.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAmC;AACnC,wBAOW;AAEX,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,iBAAiB;IACxB,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,YAAI;IACf,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;CAC0B,CAAC;AAE9B,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,YAAS;IACjB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAY;aACnB;SACF;KACF;CACF,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,WAAQ;IAChB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,cAAW;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Logo } from '../../index';\nimport {\n LogoBlack,\n LogoBlackSrc,\n LogoDefault,\n LogoDefaultSrc,\n LogoIcon,\n LogoIconSrc,\n} from '.';\n\nconst componentMeta = {\n title: 'Components/Logo',\n id: 'components-logo',\n component: Logo,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n} satisfies Meta<typeof Logo>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoDefaultSrc,\n },\n },\n },\n};\n\nexport const Black: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoBlack,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoBlackSrc,\n },\n },\n },\n};\n\nexport const Icon: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoIcon,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoIconSrc,\n },\n },\n },\n};\n"]}
@@ -149,8 +149,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
149
149
  // This effect closes all menus when an item gets clicked anywhere
150
150
  // in the tree.
151
151
  (0, react_2.useEffect)(() => {
152
- if (!tree)
152
+ if (!tree) {
153
153
  return;
154
+ }
154
155
  function handleTreeClick(data) {
155
156
  if (controlledOpen === undefined) {
156
157
  setIsOpen(false);
@@ -204,7 +205,7 @@ const MenuItemComponent = (_a) => {
204
205
  'ndl-disabled': isDisabled,
205
206
  });
206
207
  const Component = as !== null && as !== void 0 ? as : 'button';
207
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, type: "button", role: "menuitem", disabled: isDisabled, style: style }, htmlAttributes, restProps, { children: (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-inner", children: [Boolean(leadingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-leading-content", children: leadingContent })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-title-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-title", children: title }), Boolean(description) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-description", children: description }))] }), Boolean(trailingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-trailing-content", children: trailingContent }))] }) })));
208
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, type: "button", role: "menuitem", disabled: isDisabled, style: style }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-inner", children: [Boolean(leadingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-leading-content", children: leadingContent })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-title-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-title", children: title }), Boolean(description) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-description", children: description }))] }), Boolean(trailingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-trailing-content", children: trailingContent }))] }) })));
208
209
  };
209
210
  const MenuItem = ({ title, className, style, leadingVisual, trailingContent, description, isDisabled, as, onClick, onFocus, htmlAttributes, id, ref, }) => {
210
211
  const menu = (0, react_2.useContext)(MenuContext);
@@ -245,15 +246,17 @@ const NestedMenuItem = ({ title, isDisabled, description, leadingVisual, as, onF
245
246
  },
246
247
  })), { id: id }) }));
247
248
  };
248
- const CategoryItem = ({ children, className, style, as, htmlAttributes, ref, }) => {
249
+ const CategoryItem = (_a) => {
250
+ var { children, className, style, as, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "as", "htmlAttributes", "ref"]);
249
251
  const classes = (0, classnames_1.default)('ndl-menu-category-item', className);
250
252
  const Component = as !== null && as !== void 0 ? as : 'div';
251
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, { children: children })));
253
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: children })));
252
254
  };
253
- const MenuItems = ({ as, children, className, htmlAttributes, style, ref, }) => {
255
+ const MenuItems = (_a) => {
256
+ var { as, children, className, htmlAttributes, style, ref } = _a, restProps = __rest(_a, ["as", "children", "className", "htmlAttributes", "style", "ref"]);
254
257
  const classes = (0, classnames_1.default)('ndl-menu-items', className);
255
258
  const Component = as !== null && as !== void 0 ? as : 'div';
256
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, { children: children })));
259
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: children })));
257
260
  };
258
261
  const Menu = Object.assign(MenuWrapper, {
259
262
  CategoryItem: CategoryItem,
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/menu/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAwB4B;AAC5B,4DAAoC;AAEpC,iCAA+E;AAG/E,0DAAsD;AACtD,6DAA6D;AAC7D,wCAAqC;AACrC,oCAAmD;AACnD,wCAAkD;AAClD,oCAA0C;AAU1C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAQ9B;IACD,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK;IACb,gEAAgE;IAChE,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gEAAgE;IAChE,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,KAAiD,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,IAAA,+BAAuB,GAAE,CAAC;IAE3C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,CACL,uBAAC,oBAAY,cACX,uBAAC,aAAa,oBAAK,KAAK,IAAE,MAAM,UAAG,GACtB,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,uBAAC,aAAa,oBAAK,KAAK,EAAI,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAsC,EAC1D,QAAQ,EACR,MAAM,EAAE,cAAc,EACtB,OAAO,EACP,MAAM,EACN,SAAS,EACT,EAAE,EACF,SAAS,EACT,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,EACV,WAAW,EACX,IAAI,EACJ,UAAU,GAAG,IAAI,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,GAAG,E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AE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAM,cAAc,cACtE,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACtC,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,iBAAO;IAChB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AACM,oBAAI","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) return;\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n }}\n {...getFloatingProps()}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...htmlAttributes}\n {...restProps}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n id: id,\n style: style,\n }),\n }}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component className={classes} style={style} ref={ref} {...htmlAttributes}>\n {children}\n </Component>\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component className={classes} style={style} ref={ref} {...htmlAttributes}>\n {children}\n </Component>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Item: MenuItem,\n Items: MenuItems,\n});\nexport { Menu };\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/menu/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAwB4B;AAC5B,4DAAoC;AAEpC,iCAA+E;AAG/E,0DAAsD;AACtD,6DAA6D;AAC7D,wCAAqC;AACrC,oCAAmD;AACnD,wCAAkD;AAClD,oCAA0C;AAU1C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAQ9B;IACD,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK;IACb,gEAAgE;IAChE,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gEAAgE;IAChE,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,KAAiD,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,IAAA,+BAAuB,GAAE,CAAC;IAE3C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,CACL,uBAAC,oBAAY,cACX,uBAAC,aAAa,oBAAK,KAAK,IAAE,MAAM,UAAG,GACtB,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,uBAAC,aAAa,oBAAK,KAAK,EAAI,CAAC;AACtC,CA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,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAsC,EAQZ,EAAE,EAAE;QARQ,EACtD,EAAE,EACF,QAAQ,EACR,SAAS,EACT,cAAc,EACd,KAAK,EACL,GAAG,OAEuC,EADvC,SAAS,cAP0C,iEAQvD,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IACjD,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACtC,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,iBAAO;IAChB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AACM,oBAAI","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) {\n return;\n }\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n }}\n {...getFloatingProps()}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n id: id,\n style: style,\n }),\n }}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Item: MenuItem,\n Items: MenuItems,\n});\nexport { Menu };\n"]}
@@ -106,8 +106,9 @@ const PopoverTrigger = (_a) => {
106
106
  }
107
107
  return ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: context.refs.setReference, type: "button", "data-state": context.isOpen ? 'open' : 'closed' }, context.getReferenceProps(props), { children: children })));
108
108
  };
109
- const PopoverContent = ({ as, className, style, children, htmlAttributes, ref, }) => {
110
- const _a = (0, exports.usePopoverContext)(), { context: floatingContext } = _a, context = __rest(_a, ["context"]);
109
+ const PopoverContent = (_a) => {
110
+ var { as, className, style, children, htmlAttributes, ref } = _a, restProps = __rest(_a, ["as", "className", "style", "children", "htmlAttributes", "ref"]);
111
+ const _b = (0, exports.usePopoverContext)(), { context: floatingContext } = _b, context = __rest(_b, ["context"]);
111
112
  const refs = (0, react_1.useMergeRefs)([context.refs.setFloating, ref]);
112
113
  const { themeClassName } = (0, ThemeProvider_1.useNeedleTheme)();
113
114
  const classes = (0, classnames_1.default)('ndl-popover', themeClassName, className);
@@ -116,14 +117,15 @@ const PopoverContent = ({ as, className, style, children, htmlAttributes, ref, }
116
117
  // To be noted is that axe gives us a false positive error here since the focus guards directly pass focus to other elements
117
118
  // https://github.com/floating-ui/floating-ui/issues/2462
118
119
  (0, usePatchFloatingFocusGuards_1.usePatchFloatingFocusGuards)();
119
- if (!floatingContext.open)
120
+ if (!floatingContext.open) {
120
121
  return null;
122
+ }
121
123
  return ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: context.isPortaled, wrap: (wrapChildren) => {
122
124
  var _a;
123
125
  return ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { root: ((_a = context.anchorElementAsPortalAnchor) !== null && _a !== void 0 ? _a : false)
124
126
  ? context.refs.reference.current
125
127
  : undefined, children: wrapChildren }));
126
- }, children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: floatingContext, modal: context.shouldCaptureFocus, initialFocus: context.initialFocus, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, "aria-labelledby": context.labelId, "aria-describedby": context.descriptionId, style: Object.assign(Object.assign(Object.assign({}, context.floatingStyles), context.transitionStyles), style), ref: refs }, context.getFloatingProps(Object.assign({}, htmlAttributes)), { children: children })) }) }));
128
+ }, children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: floatingContext, modal: context.shouldCaptureFocus, initialFocus: context.initialFocus, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, "aria-labelledby": context.labelId, "aria-describedby": context.descriptionId, style: Object.assign(Object.assign(Object.assign({}, context.floatingStyles), context.transitionStyles), style), ref: refs }, context.getFloatingProps(Object.assign({}, htmlAttributes)), restProps, { children: children })) }) }));
127
129
  };
128
130
  const Popover = Object.assign(PopoverComponent, {
129
131
  Content: PopoverContent,
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAM4B;AAC5B,4DAAoC;AACpC,kDAA0B;AAM1B,0DAAsD;AACtD,6DAA6D;AAC7D,0DAAwD;AACxD,+CAA2C;AAC3C,+EAA4E;AAgB/D,QAAA,oBAAoB,GAAwC;IACvE,oBAAoB,EAAE,YAAY;IAClC,wBAAwB,EAAE,cAAc;IACxC,0BAA0B,EAAE,QAAQ;IACpC,oBAAoB,EAAE,SAAS;IAC/B,wBAAwB,EAAE,WAAW;IACrC,0BAA0B,EAAE,KAAK;IACjC,yBAAyB,EAAE,UAAU;IACrC,mBAAmB,EAAE,YAAY;IACjC,yBAAyB,EAAE,MAAM;IACjC,yBAAyB,EAAE,WAAW;IACtC,mBAAmB,EAAE,aAAa;IAClC,yBAAyB,EAAE,OAAO;CACnC,CAAC;AA4CF,MAAM,cAAc,GAAG,eAAK,CAAC,aAAa,CAAc,IAAI,CAAC,CAAC;AAEvD,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,eAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAEF,MAAM,gBAAgB,GAAG,CAAC,EACxB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,MAAM,EACN,cAAc,EACd,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,GAAG,KAAK,EAC1B,YAAY,EACZ,Y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AS,CAAC,CAAC;IACrE,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IAEjD,mDAAmD;IACnD,4HAA4H;IAC5H,yDAAyD;IACzD,IAAA,yDAA2B,GAAE,CAAC;IAE9B,IAAI,CAAC,eAAe,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,uBAAC,kCAAe,IACd,UAAU,EAAE,OAAO,CAAC,UAAU,EAC9B,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;;YAAC,OAAA,CACtB,uBAAC,sBAAc,IACb,IAAI,EACF,CAAC,MAAA,OAAO,CAAC,2BAA2B,mCAAI,KAAK,CAAC;oBAC5C,CAAC,CAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAA8B;oBACxD,CAAC,CAAC,SAAS,YAGd,YAAY,GACE,CAClB,CAAA;SAAA,YAED,uBAAC,4BAAoB,IACnB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,OAAO,CAAC,kBAAkB,EACjC,YAAY,EAAE,OAAO,CAAC,YAAY,YAElC,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,qBACD,OAAO,CAAC,OAAO,sBACd,OAAO,CAAC,aAAa,EACvC,KAAK,gDACA,OAAO,CAAC,cAAc,GACtB,OAAO,CAAC,gBAAgB,GACxB,KAAK,GAEV,GAAG,EAAE,IAAI,IACL,OAAO,CAAC,gBAAgB,mBAAM,cAAc,EAAG,cAElD,QAAQ,IACC,GACS,GACP,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC9C,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AAEM,0BAAO","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n FloatingFocusManager,\n FloatingPortal,\n type OffsetOptions,\n type Placement,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme/ThemeProvider';\nimport { usePopover } from './use-popover';\nimport { usePatchFloatingFocusGuards } from './usePatchFloatingFocusGuards';\n\ntype PlacementOptions =\n | 'bottom-end-top-end'\n | 'bottom-start-top-start'\n | 'bottom-middle-top-middle'\n | 'top-end-bottom-end'\n | 'top-start-bottom-start'\n | 'top-middle-bottom-middle'\n | 'bottom-start-bottom-end'\n | 'top-start-top-end'\n | 'middle-start-middle-end'\n | 'bottom-end-bottom-start'\n | 'top-end-top-start'\n | 'middle-end-middle-start';\n\nexport const placementTranslation: Record<PlacementOptions, Placement> = {\n 'bottom-end-top-end': 'bottom-end',\n 'bottom-start-top-start': 'bottom-start',\n 'bottom-middle-top-middle': 'bottom',\n 'top-end-bottom-end': 'top-end',\n 'top-start-bottom-start': 'top-start',\n 'top-middle-bottom-middle': 'top',\n 'bottom-start-bottom-end': 'left-end',\n 'top-start-top-end': 'left-start',\n 'middle-start-middle-end': 'left',\n 'bottom-end-bottom-start': 'right-end',\n 'top-end-top-start': 'right-start',\n 'middle-end-middle-start': 'right',\n};\ntype PopoverProps = {\n /** if the popover is open */\n isOpen?: boolean;\n /** The content of the popover */\n children?: React.ReactNode;\n /** Can be used if the anchor should be separated from the trigger */\n anchorElement?: Element | null;\n /** If the anchorPosition is provided the anchorElement will be ignored */\n anchorPosition?: {\n x: number;\n y: number;\n };\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: PlacementOptions;\n /** can take either a number, an object or a function. Full documentation here: https://floating-ui.com/docs/offset */\n offset?: OffsetOptions;\n /** Called when the floating element is opened or closed */\n onOpenChange?: (isOpen: boolean, event?: Event) => void;\n /** Use anchorEl for portal's container. Should be used if the popover is portaled and is inside a Dialog for example. */\n hasAnchorPortal?: boolean;\n /** If the popover should constrain the focus inside the popover while open */\n shouldCaptureFocus?: boolean;\n /** Which element to initially focus. **/\n initialFocus?: number | React.RefObject<HTMLElement | null>;\n /** The role of the popover */\n role?:\n | 'tooltip'\n | 'dialog'\n | 'alertdialog'\n | 'menu'\n | 'listbox'\n | 'grid'\n | 'tree';\n /** If the popover should close when the user clicks outside of it */\n closeOnClickOutside?: boolean;\n /** The strategy of the popover. Fixed should be used when the popover is inside a Dialog. */\n strategy?: 'fixed' | 'absolute';\n /** Whether the content is rendered in a portal */\n isPortaled?: boolean;\n};\n\ntype ContextType = ReturnType<typeof usePopover> | null;\n\nconst PopoverContext = React.createContext<ContextType>(null);\n\nexport const usePopoverContext = () => {\n const context = React.useContext(PopoverContext);\n\n if (context === null) {\n throw new Error('Popover components must be wrapped in <Popover />');\n }\n\n return context;\n};\n\nconst PopoverComponent = ({\n children,\n anchorElement,\n placement,\n isOpen,\n offset,\n anchorPosition,\n hasAnchorPortal: hasAnchorPortalProp,\n shouldCaptureFocus = false,\n initialFocus,\n onOpenChange,\n role,\n closeOnClickOutside = true,\n isPortaled: isPortaledProp,\n strategy: strategyProp,\n}: PopoverProps) => {\n const isInsideDialog = useIsInsideDialog();\n\n const strategy = isInsideDialog ? 'fixed' : 'absolute';\n const hasAnchorPortal = isInsideDialog;\n const isPortaled = !isInsideDialog;\n\n const popover = usePopover({\n placement: placement ? placementTranslation[placement] : undefined,\n isOpen: isOpen,\n offsetOption: offset,\n anchorElement: anchorElement,\n anchorElementAsPortalAnchor: hasAnchorPortalProp ?? hasAnchorPortal,\n anchorPosition,\n onOpenChange: onOpenChange,\n shouldCaptureFocus: shouldCaptureFocus,\n initialFocus,\n role,\n closeOnClickOutside,\n strategy: strategyProp ?? strategy,\n isPortaled: isPortaledProp ?? isPortaled,\n });\n\n return (\n <PopoverContext.Provider value={popover}>\n {children}\n </PopoverContext.Provider>\n );\n};\n\ntype PopoverTriggerProps = {\n /** The content of the trigger */\n children: React.ReactNode;\n /** Whether the trigger should render a button element, or pass its props to the child element */\n hasButtonWrapper?: boolean;\n};\n\nconst PopoverTrigger = ({\n children,\n hasButtonWrapper = false,\n ref,\n ...props\n}: CommonProps<'button', PopoverTriggerProps>) => {\n const context = usePopoverContext();\n // Example from floating UI\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const childrenProps = (children as any).props;\n const mergedRefs = useMergeRefs([\n context.refs.setReference,\n ref,\n childrenProps?.ref,\n ]);\n\n // `hasButtonWrapper` allows the user to pass any element as the anchor\n if (hasButtonWrapper && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ...props,\n ...childrenProps,\n 'data-state': context.isOpen ? 'open' : 'closed',\n ref: mergedRefs,\n }),\n );\n }\n return (\n <button\n ref={context.refs.setReference}\n type=\"button\"\n data-state={context.isOpen ? 'open' : 'closed'}\n {...context.getReferenceProps(props)}\n >\n {children}\n </button>\n );\n};\n\ntype PopoverContentProps = {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n};\n\nconst PopoverContent = <T extends React.ElementType = 'div'>({\n as,\n className,\n style,\n children,\n htmlAttributes,\n ref,\n}: PolymorphicCommonProps<T, PopoverContentProps>) => {\n const { context: floatingContext, ...context } = usePopoverContext();\n\n const refs = useMergeRefs([context.refs.setFloating, ref]);\n\n const { themeClassName } = useNeedleTheme();\n\n const classes = classNames('ndl-popover', themeClassName, className);\n const Component: React.ElementType = as ?? 'div';\n\n // Patch to not get axe errors for the focus guards\n // To be noted is that axe gives us a false positive error here since the focus guards directly pass focus to other elements\n // https://github.com/floating-ui/floating-ui/issues/2462\n usePatchFloatingFocusGuards();\n\n if (!floatingContext.open) return null;\n\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal\n root={\n (context.anchorElementAsPortalAnchor ?? false)\n ? (context.refs.reference.current as HTMLElement | null)\n : undefined\n }\n >\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={floatingContext}\n modal={context.shouldCaptureFocus}\n initialFocus={context.initialFocus}\n >\n <Component\n className={classes}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n style={{\n ...context.floatingStyles,\n ...context.transitionStyles,\n ...style,\n }}\n ref={refs}\n {...context.getFloatingProps({ ...htmlAttributes })}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n );\n};\n\nconst Popover = Object.assign(PopoverComponent, {\n Content: PopoverContent,\n Trigger: PopoverTrigger,\n});\n\nexport { Popover };\n"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAM4B;AAC5B,4DAAoC;AACpC,kDAA0B;AAM1B,0DAAsD;AACtD,6DAA6D;AAC7D,0DAAwD;AACxD,+CAA2C;AAC3C,+EAA4E;AAgB/D,QAAA,oBAAoB,GAAwC;IACvE,oBAAoB,EAAE,YAAY;IAClC,wBAAwB,EAAE,cAAc;IACxC,0BAA0B,EAAE,QAAQ;IACpC,oBAAoB,EAAE,SAAS;IAC/B,wBAAwB,EAAE,WAAW;IACrC,0BAA0B,EAAE,KAAK;IACjC,yBAAyB,EAAE,UAAU;IACrC,mBAAmB,EAAE,Y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CAAC,SAAS,YAGd,YAAY,GACE,CAClB,CAAA;SAAA,YAED,uBAAC,4BAAoB,IACnB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,OAAO,CAAC,kBAAkB,EACjC,YAAY,EAAE,OAAO,CAAC,YAAY,YAElC,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,qBACD,OAAO,CAAC,OAAO,sBACd,OAAO,CAAC,aAAa,EACvC,KAAK,gDACA,OAAO,CAAC,cAAc,GACtB,OAAO,CAAC,gBAAgB,GACxB,KAAK,GAEV,GAAG,EAAE,IAAI,IACL,OAAO,CAAC,gBAAgB,mBAAM,cAAc,EAAG,EAC/C,SAAS,cAEZ,QAAQ,IACC,GACS,GACP,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC9C,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AAEM,0BAAO","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n FloatingFocusManager,\n FloatingPortal,\n type OffsetOptions,\n type Placement,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme/ThemeProvider';\nimport { usePopover } from './use-popover';\nimport { usePatchFloatingFocusGuards } from './usePatchFloatingFocusGuards';\n\ntype PlacementOptions =\n | 'bottom-end-top-end'\n | 'bottom-start-top-start'\n | 'bottom-middle-top-middle'\n | 'top-end-bottom-end'\n | 'top-start-bottom-start'\n | 'top-middle-bottom-middle'\n | 'bottom-start-bottom-end'\n | 'top-start-top-end'\n | 'middle-start-middle-end'\n | 'bottom-end-bottom-start'\n | 'top-end-top-start'\n | 'middle-end-middle-start';\n\nexport const placementTranslation: Record<PlacementOptions, Placement> = {\n 'bottom-end-top-end': 'bottom-end',\n 'bottom-start-top-start': 'bottom-start',\n 'bottom-middle-top-middle': 'bottom',\n 'top-end-bottom-end': 'top-end',\n 'top-start-bottom-start': 'top-start',\n 'top-middle-bottom-middle': 'top',\n 'bottom-start-bottom-end': 'left-end',\n 'top-start-top-end': 'left-start',\n 'middle-start-middle-end': 'left',\n 'bottom-end-bottom-start': 'right-end',\n 'top-end-top-start': 'right-start',\n 'middle-end-middle-start': 'right',\n};\ntype PopoverProps = {\n /** if the popover is open */\n isOpen?: boolean;\n /** The content of the popover */\n children?: React.ReactNode;\n /** Can be used if the anchor should be separated from the trigger */\n anchorElement?: Element | null;\n /** If the anchorPosition is provided the anchorElement will be ignored */\n anchorPosition?: {\n x: number;\n y: number;\n };\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: PlacementOptions;\n /** can take either a number, an object or a function. Full documentation here: https://floating-ui.com/docs/offset */\n offset?: OffsetOptions;\n /** Called when the floating element is opened or closed */\n onOpenChange?: (isOpen: boolean, event?: Event) => void;\n /** Use anchorEl for portal's container. Should be used if the popover is portaled and is inside a Dialog for example. */\n hasAnchorPortal?: boolean;\n /** If the popover should constrain the focus inside the popover while open */\n shouldCaptureFocus?: boolean;\n /** Which element to initially focus. **/\n initialFocus?: number | React.RefObject<HTMLElement | null>;\n /** The role of the popover */\n role?:\n | 'tooltip'\n | 'dialog'\n | 'alertdialog'\n | 'menu'\n | 'listbox'\n | 'grid'\n | 'tree';\n /** If the popover should close when the user clicks outside of it */\n closeOnClickOutside?: boolean;\n /** The strategy of the popover. Fixed should be used when the popover is inside a Dialog. */\n strategy?: 'fixed' | 'absolute';\n /** Whether the content is rendered in a portal */\n isPortaled?: boolean;\n};\n\ntype ContextType = ReturnType<typeof usePopover> | null;\n\nconst PopoverContext = React.createContext<ContextType>(null);\n\nexport const usePopoverContext = () => {\n const context = React.useContext(PopoverContext);\n\n if (context === null) {\n throw new Error('Popover components must be wrapped in <Popover />');\n }\n\n return context;\n};\n\nconst PopoverComponent = ({\n children,\n anchorElement,\n placement,\n isOpen,\n offset,\n anchorPosition,\n hasAnchorPortal: hasAnchorPortalProp,\n shouldCaptureFocus = false,\n initialFocus,\n onOpenChange,\n role,\n closeOnClickOutside = true,\n isPortaled: isPortaledProp,\n strategy: strategyProp,\n}: PopoverProps) => {\n const isInsideDialog = useIsInsideDialog();\n\n const strategy = isInsideDialog ? 'fixed' : 'absolute';\n const hasAnchorPortal = isInsideDialog;\n const isPortaled = !isInsideDialog;\n\n const popover = usePopover({\n placement: placement ? placementTranslation[placement] : undefined,\n isOpen: isOpen,\n offsetOption: offset,\n anchorElement: anchorElement,\n anchorElementAsPortalAnchor: hasAnchorPortalProp ?? hasAnchorPortal,\n anchorPosition,\n onOpenChange: onOpenChange,\n shouldCaptureFocus: shouldCaptureFocus,\n initialFocus,\n role,\n closeOnClickOutside,\n strategy: strategyProp ?? strategy,\n isPortaled: isPortaledProp ?? isPortaled,\n });\n\n return (\n <PopoverContext.Provider value={popover}>\n {children}\n </PopoverContext.Provider>\n );\n};\n\ntype PopoverTriggerProps = {\n /** The content of the trigger */\n children: React.ReactNode;\n /** Whether the trigger should render a button element, or pass its props to the child element */\n hasButtonWrapper?: boolean;\n};\n\nconst PopoverTrigger = ({\n children,\n hasButtonWrapper = false,\n ref,\n ...props\n}: CommonProps<'button', PopoverTriggerProps>) => {\n const context = usePopoverContext();\n // Example from floating UI\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const childrenProps = (children as any).props;\n const mergedRefs = useMergeRefs([\n context.refs.setReference,\n ref,\n childrenProps?.ref,\n ]);\n\n // `hasButtonWrapper` allows the user to pass any element as the anchor\n if (hasButtonWrapper && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ...props,\n ...childrenProps,\n 'data-state': context.isOpen ? 'open' : 'closed',\n ref: mergedRefs,\n }),\n );\n }\n return (\n <button\n ref={context.refs.setReference}\n type=\"button\"\n data-state={context.isOpen ? 'open' : 'closed'}\n {...context.getReferenceProps(props)}\n >\n {children}\n </button>\n );\n};\n\ntype PopoverContentProps = {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n};\n\nconst PopoverContent = <T extends React.ElementType = 'div'>({\n as,\n className,\n style,\n children,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, PopoverContentProps>) => {\n const { context: floatingContext, ...context } = usePopoverContext();\n\n const refs = useMergeRefs([context.refs.setFloating, ref]);\n\n const { themeClassName } = useNeedleTheme();\n\n const classes = classNames('ndl-popover', themeClassName, className);\n const Component: React.ElementType = as ?? 'div';\n\n // Patch to not get axe errors for the focus guards\n // To be noted is that axe gives us a false positive error here since the focus guards directly pass focus to other elements\n // https://github.com/floating-ui/floating-ui/issues/2462\n usePatchFloatingFocusGuards();\n\n if (!floatingContext.open) {\n return null;\n }\n\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal\n root={\n (context.anchorElementAsPortalAnchor ?? false)\n ? (context.refs.reference.current as HTMLElement | null)\n : undefined\n }\n >\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={floatingContext}\n modal={context.shouldCaptureFocus}\n initialFocus={context.initialFocus}\n >\n <Component\n className={classes}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n style={{\n ...context.floatingStyles,\n ...context.transitionStyles,\n ...style,\n }}\n ref={refs}\n {...context.getFloatingProps({ ...htmlAttributes })}\n {...restProps}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n );\n};\n\nconst Popover = Object.assign(PopoverComponent, {\n Content: PopoverContent,\n Trigger: PopoverTrigger,\n});\n\nexport { Popover };\n"]}
@@ -61,8 +61,9 @@ const Component = () => {
61
61
  return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-32 n-items-center", children: [(0, jsx_runtime_1.jsxs)(react_1.Popover, { offset: offsetTranslation[selectedPosition], children: [(0, jsx_runtime_1.jsx)(react_1.Popover.Trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { children: "Open Popover" }) }), (0, jsx_runtime_1.jsx)(react_1.Popover.Content, { className: "n-p-token-16", children: "Popover content" })] }), (0, jsx_runtime_1.jsx)(react_1.Select, { type: "select", label: "Example positions", selectProps: {
62
62
  defaultValue: offsetOptions[0],
63
63
  onChange: (e) => {
64
- if (e)
64
+ if (e) {
65
65
  setSelectedPosition(e.value);
66
+ }
66
67
  },
67
68
  options: offsetOptions,
68
69
  } })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"popover-custom-offset.story.js","sourceRoot":"","sources":["../../../../src/popover/stories/popover-custom-offset.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiE;AACjE,iCAAiC;AAEjC,MAAM,aAAa,GAAG;IACpB;QACE,KAAK,EAAE,gCAAgC;QACvC,KAAK,EAAE,gCAAgC;KACxC;IACD;QACE,KAAK,EAAE,yCAAyC;QAChD,KAAK,EAAE,yCAAyC;KACjD;IACD;QACE,KAAK,EAAE,2CAA2C;QAClD,KAAK,EAAE,2CAA2C;KACnD;IACD;QACE,KAAK,EAAE,kCAAkC;QACzC,KAAK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,CAAC,CAAC,KAAK,CAAC,CAAC;oBACtC,CAAC;oBACD,OAAO,EAAE,aAAa;iBACvB,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, Popover, Select } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst offsetOptions = [\n {\n label: 'crossAxis-anchor-element-width',\n value: 'crossAxis-anchor-element-width',\n },\n {\n label: 'crossAxis-anchor-element-negative-width',\n value: 'crossAxis-anchor-element-negative-width',\n },\n {\n label: 'crossAxis-floating-element-negative-width',\n value: 'crossAxis-floating-element-negative-width',\n },\n {\n label: 'crossAxis-floating-element-width',\n value: 'crossAxis-floating-element-width',\n },\n];\n\nconst offsetTranslation: Record<\n string,\n React.ComponentProps<typeof Popover>['offset']\n> = {\n 'crossAxis-anchor-element-negative-width': ({ rects }) => ({\n crossAxis: -rects.reference.width,\n }),\n 'crossAxis-anchor-element-width': ({ rects }) => ({\n crossAxis: rects.reference.width,\n }),\n 'crossAxis-floating-element-negative-width': ({ rects }) => ({\n crossAxis: -rects.floating.width,\n }),\n 'crossAxis-floating-element-width': ({ rects }) => ({\n crossAxis: rects.floating.width,\n }),\n};\n\nconst Component = () => {\n const [selectedPosition, setSelectedPosition] = useState(\n offsetOptions[0].value,\n );\n\n return (\n <div className=\"n-flex n-flex-col n-gap-token-32 n-items-center\">\n <Popover offset={offsetTranslation[selectedPosition]}>\n <Popover.Trigger hasButtonWrapper>\n <FilledButton>Open Popover</FilledButton>\n </Popover.Trigger>\n <Popover.Content className=\"n-p-token-16\">\n Popover content\n </Popover.Content>\n </Popover>\n\n <Select\n type=\"select\"\n label=\"Example positions\"\n selectProps={{\n defaultValue: offsetOptions[0],\n onChange: (e) => {\n if (e) setSelectedPosition(e.value);\n },\n options: offsetOptions,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"popover-custom-offset.story.js","sourceRoot":"","sources":["../../../../src/popover/stories/popover-custom-offset.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiE;AACjE,iCAAiC;AAEjC,MAAM,aAAa,GAAG;IACpB;QACE,KAAK,EAAE,gCAAgC;QACvC,KAAK,EAAE,gCAAgC;KACxC;IACD;QACE,KAAK,EAAE,yCAAyC;QAChD,KAAK,EAAE,yCAAyC;KACjD;IACD;QACE,KAAK,EAAE,2CAA2C;QAClD,KAAK,EAAE,2CAA2C;KACnD;IACD;QACE,KAAK,EAAE,kCAAkC;QACzC,KAAK,EAAE,kCAAkC;KAC1C;CACF,CAAC;AAEF,MAAM,iBAAiB,GAGnB;IACF,yCAAyC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACzD,SAAS,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK;KAClC,CAAC;IACF,gCAAgC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAChD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK;KACjC,CAAC;IACF,2CAA2C,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3D,SAAS,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK;KACjC,CAAC;IACF,kCAAkC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAClD,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;KAChC,CAAC;CACH,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EACtD,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CACvB,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,wBAAC,eAAO,IAAC,MAAM,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,aAClD,uBAAC,eAAO,CAAC,OAAO,IAAC,gBAAgB,kBAC/B,uBAAC,oBAAY,+BAA4B,GACzB,EAClB,uBAAC,eAAO,CAAC,OAAO,IAAC,SAAS,EAAC,cAAc,gCAEvB,IACV,EAEV,uBAAC,cAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,mBAAmB,EACzB,WAAW,EAAE;oBACX,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;oBAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;wBACd,IAAI,CAAC,EAAE,CAAC;4BACN,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;wBAC/B,CAAC;oBACH,CAAC;oBACD,OAAO,EAAE,aAAa;iBACvB,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, Popover, Select } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst offsetOptions = [\n {\n label: 'crossAxis-anchor-element-width',\n value: 'crossAxis-anchor-element-width',\n },\n {\n label: 'crossAxis-anchor-element-negative-width',\n value: 'crossAxis-anchor-element-negative-width',\n },\n {\n label: 'crossAxis-floating-element-negative-width',\n value: 'crossAxis-floating-element-negative-width',\n },\n {\n label: 'crossAxis-floating-element-width',\n value: 'crossAxis-floating-element-width',\n },\n];\n\nconst offsetTranslation: Record<\n string,\n React.ComponentProps<typeof Popover>['offset']\n> = {\n 'crossAxis-anchor-element-negative-width': ({ rects }) => ({\n crossAxis: -rects.reference.width,\n }),\n 'crossAxis-anchor-element-width': ({ rects }) => ({\n crossAxis: rects.reference.width,\n }),\n 'crossAxis-floating-element-negative-width': ({ rects }) => ({\n crossAxis: -rects.floating.width,\n }),\n 'crossAxis-floating-element-width': ({ rects }) => ({\n crossAxis: rects.floating.width,\n }),\n};\n\nconst Component = () => {\n const [selectedPosition, setSelectedPosition] = useState(\n offsetOptions[0].value,\n );\n\n return (\n <div className=\"n-flex n-flex-col n-gap-token-32 n-items-center\">\n <Popover offset={offsetTranslation[selectedPosition]}>\n <Popover.Trigger hasButtonWrapper>\n <FilledButton>Open Popover</FilledButton>\n </Popover.Trigger>\n <Popover.Content className=\"n-p-token-16\">\n Popover content\n </Popover.Content>\n </Popover>\n\n <Select\n type=\"select\"\n label=\"Example positions\"\n selectProps={{\n defaultValue: offsetOptions[0],\n onChange: (e) => {\n if (e) {\n setSelectedPosition(e.value);\n }\n },\n options: offsetOptions,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -27,7 +27,7 @@ const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const anchorRef = (0, react_2.useRef)(null);
29
29
  const [isOpen, setIsOpen] = (0, react_2.useState)(false);
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-between n-w-full", children: [(0, jsx_runtime_1.jsx)("div", { ref: anchorRef, children: "Anchor Element" }), (0, jsx_runtime_1.jsxs)(react_1.Popover, { anchorElement: anchorRef.current, isOpen: isOpen, onOpenChange: (open, event) => setIsOpen(open), children: [(0, jsx_runtime_1.jsx)(react_1.Popover.Trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsOpen(true), children: "Open Popover" }) }), (0, jsx_runtime_1.jsx)(react_1.Popover.Content, { className: "n-p-token-16", children: "Popover content" })] })] }));
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-between n-w-full", children: [(0, jsx_runtime_1.jsx)("div", { ref: anchorRef, children: "Anchor Element" }), (0, jsx_runtime_1.jsxs)(react_1.Popover, { anchorElement: anchorRef.current, isOpen: isOpen, onOpenChange: (open) => setIsOpen(open), children: [(0, jsx_runtime_1.jsx)(react_1.Popover.Trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsOpen(true), children: "Open Popover" }) }), (0, jsx_runtime_1.jsx)(react_1.Popover.Content, { className: "n-p-token-16", children: "Popover content" })] })] }));
31
31
  };
32
32
  exports.default = Component;
33
33
  //# sourceMappingURL=popover-separate-anchor.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-separate-anchor.story.js","sourceRoot":"","sources":["../../../../src/popover/stories/popover-separate-anchor.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAyD;AACzD,iCAAyC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,SAAS,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,iCAAK,SAAS,EAAC,mCAAmC,aAChD,gCAAK,GAAG,EAAE,SAAS,+BAAsB,EACzC,wBAAC,eAAO,IACN,aAAa,EAAE,SAAS,CAAC,OAAO,EAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,aAE9C,uBAAC,eAAO,CAAC,OAAO,IAAC,gBAAgB,kBAC/B,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,6BAE7B,GACC,EAClB,uBAAC,eAAO,CAAC,OAAO,IAAC,SAAS,EAAC,cAAc,gCAEvB,IACV,IACN,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, Popover } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <div className=\"n-flex n-justify-between n-w-full\">\n <div ref={anchorRef}>Anchor Element</div>\n <Popover\n anchorElement={anchorRef.current}\n isOpen={isOpen}\n onOpenChange={(open, event) => setIsOpen(open)}\n >\n <Popover.Trigger hasButtonWrapper>\n <FilledButton onClick={() => setIsOpen(true)}>\n Open Popover\n </FilledButton>\n </Popover.Trigger>\n <Popover.Content className=\"n-p-token-16\">\n Popover content\n </Popover.Content>\n </Popover>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"popover-separate-anchor.story.js","sourceRoot":"","sources":["../../../../src/popover/stories/popover-separate-anchor.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAyD;AACzD,iCAAyC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,SAAS,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,iCAAK,SAAS,EAAC,mCAAmC,aAChD,gCAAK,GAAG,EAAE,SAAS,+BAAsB,EACzC,wBAAC,eAAO,IACN,aAAa,EAAE,SAAS,CAAC,OAAO,EAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,aAEvC,uBAAC,eAAO,CAAC,OAAO,IAAC,gBAAgB,kBAC/B,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,6BAE7B,GACC,EAClB,uBAAC,eAAO,CAAC,OAAO,IAAC,SAAS,EAAC,cAAc,gCAEvB,IACV,IACN,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, Popover } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <div className=\"n-flex n-justify-between n-w-full\">\n <div ref={anchorRef}>Anchor Element</div>\n <Popover\n anchorElement={anchorRef.current}\n isOpen={isOpen}\n onOpenChange={(open) => setIsOpen(open)}\n >\n <Popover.Trigger hasButtonWrapper>\n <FilledButton onClick={() => setIsOpen(true)}>\n Open Popover\n </FilledButton>\n </Popover.Trigger>\n <Popover.Content className=\"n-p-token-16\">\n Popover content\n </Popover.Content>\n </Popover>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -44,7 +44,7 @@ const ProgressBar = (_a) => {
44
44
  'ndl-small': size === 'small',
45
45
  });
46
46
  const Component = as !== null && as !== void 0 ? as : 'div';
47
- return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, restProps, { children: [heading && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-header", children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-heading", children: heading }), (0, jsx_runtime_1.jsx)("span", { className: "ndl-progress-number", children: value + '%' })] })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-progress-bar-wrapper-inner", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar-container", role: "progressbar", title: "progress bar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": value, children: (0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar", style: { width: value + '%' } }) }), (0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar-shadow", style: { width: value + '%' } })] })] })));
47
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: [heading && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-header", children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-heading", children: heading }), (0, jsx_runtime_1.jsx)("span", { className: "ndl-progress-number", children: `${value}%` })] })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-progress-bar-wrapper-inner", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar-container", role: "progressbar", title: "progress bar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": value, children: (0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar", style: { width: `${value}%` } }) }), (0, jsx_runtime_1.jsx)("div", { className: "ndl-progress-bar-shadow", style: { width: `${value}%` } })] })] })));
48
48
  };
49
49
  exports.ProgressBar = ProgressBar;
50
50
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../src/progress-bar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAqB7B,MAAM,WAAW,GAAG,CAAsC,EAUnB,EAAE,EAAE;QAVe,EAC/D,EAAE,EACF,OAAO,EACP,KAAK,EACL,IAAI,GAAG,OAAO,EACd,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEyC,EADzC,SAAS,cATmD,iFAUhE,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,0BAA0B,EAAE,SAAS,EAAE;QAChE,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IACH,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IAEjD,OAAO,CACL,wBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,cAAc,EACd,SAAS,eAEZ,OAAO,IAAI,CACV,iCAAK,SAAS,EAAC,YAAY,aACzB,iCAAM,SAAS,EAAC,aAAa,YAAE,OAAO,GAAQ,EAC9C,iCAAM,SAAS,EAAC,qBAAqB,YAAE,KAAK,GAAG,GAAG,GAAQ,IACtD,CACP,EACD,iCAAK,SAAS,EAAC,gCAAgC,aAC7C,gCACE,SAAS,EAAC,4BAA4B,EACtC,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,cAAc,mBACL,CAAC,mBACD,GAAG,mBACH,KAAK,YAEpB,gCAAK,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,EAAE,GAAI,GAC/D,EACN,gCACE,SAAS,EAAC,yBAAyB,EACnC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,EAAE,GAC7B,IACE,KACI,CACb,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,WAAW,eAiDtB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\n\ntype ProgressBarProps = {\n /** The heading displayed above the progress bar */\n heading?: string;\n /** The current progress value, should be between 0 and 100 */\n value: number;\n /** Size of the progress bar */\n size: 'small' | 'large';\n /** Additional class names */\n className?: string;\n /** Additional HTML attributes */\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nexport const ProgressBar = <T extends React.ElementType = 'div'>({\n as,\n heading,\n value,\n size = 'small',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, ProgressBarProps>) => {\n const classes = classNames('ndl-progress-bar-wrapper', className, {\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n const Component: React.ElementType = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...htmlAttributes}\n {...restProps}\n >\n {heading && (\n <div className=\"ndl-header\">\n <span className=\"ndl-heading\">{heading}</span>\n <span className=\"ndl-progress-number\">{value + '%'}</span>\n </div>\n )}\n <div className=\"ndl-progress-bar-wrapper-inner\">\n <div\n className=\"ndl-progress-bar-container\"\n role=\"progressbar\"\n title=\"progress bar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={value}\n >\n <div className=\"ndl-progress-bar\" style={{ width: value + '%' }} />\n </div>\n <div\n className=\"ndl-progress-bar-shadow\"\n style={{ width: value + '%' }}\n />\n </div>\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../src/progress-bar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAqB7B,MAAM,WAAW,GAAG,CAAsC,EAUnB,EAAE,EAAE;QAVe,EAC/D,EAAE,EACF,OAAO,EACP,KAAK,EACL,IAAI,GAAG,OAAO,EACd,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEyC,EADzC,SAAS,cATmD,iFAUhE,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,0BAA0B,EAAE,SAAS,EAAE;QAChE,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IACH,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IAEjD,OAAO,CACL,wBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,eAEjB,OAAO,IAAI,CACV,iCAAK,SAAS,EAAC,YAAY,aACzB,iCAAM,SAAS,EAAC,aAAa,YAAE,OAAO,GAAQ,EAC9C,iCAAM,SAAS,EAAC,qBAAqB,YAAE,GAAG,KAAK,GAAG,GAAQ,IACtD,CACP,EACD,iCAAK,SAAS,EAAC,gCAAgC,aAC7C,gCACE,SAAS,EAAC,4BAA4B,EACtC,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,cAAc,mBACL,CAAC,mBACD,GAAG,mBACH,KAAK,YAEpB,gCAAK,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,EAAE,GAAI,GAC/D,EACN,gCACE,SAAS,EAAC,yBAAyB,EACnC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,EAAE,GAC7B,IACE,KACI,CACb,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,WAAW,eAiDtB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\n\ntype ProgressBarProps = {\n /** The heading displayed above the progress bar */\n heading?: string;\n /** The current progress value, should be between 0 and 100 */\n value: number;\n /** Size of the progress bar */\n size: 'small' | 'large';\n /** Additional class names */\n className?: string;\n /** Additional HTML attributes */\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nexport const ProgressBar = <T extends React.ElementType = 'div'>({\n as,\n heading,\n value,\n size = 'small',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, ProgressBarProps>) => {\n const classes = classNames('ndl-progress-bar-wrapper', className, {\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n const Component: React.ElementType = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {heading && (\n <div className=\"ndl-header\">\n <span className=\"ndl-heading\">{heading}</span>\n <span className=\"ndl-progress-number\">{`${value}%`}</span>\n </div>\n )}\n <div className=\"ndl-progress-bar-wrapper-inner\">\n <div\n className=\"ndl-progress-bar-container\"\n role=\"progressbar\"\n title=\"progress bar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={value}\n >\n <div className=\"ndl-progress-bar\" style={{ width: `${value}%` }} />\n </div>\n <div\n className=\"ndl-progress-bar-shadow\"\n style={{ width: `${value}%` }}\n />\n </div>\n </Component>\n );\n};\n"]}
@@ -58,8 +58,9 @@ const Radio = (_a) => {
58
58
  });
59
59
  /** TODO: Label handling. We can get rid of this annoying stuff as soon as we do proper form control. */
60
60
  const labelContent = (0, react_1.useMemo)(() => {
61
- if (Boolean(label) === false)
61
+ if (Boolean(label) === false) {
62
62
  return null;
63
+ }
63
64
  if (typeof label === 'string') {
64
65
  return ((0, jsx_runtime_1.jsx)("span", { title: label, className: "ndl-radio-label-text", children: label }));
65
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,iCAA2C;AAG3C,oFAA8E;AAC9E,4CAAwD;AAgCjD,MAAM,KAAK,GAAG,CAAC,EAgBa,EAAE,EAAE;;QAhBjB,EACpB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,gBAAgB,EAChB,KAAK,EACL,OAAO,GAAG,KAAK,EACf,SAAS,EACT,eAAe,EACf,QAAQ,EACR,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,OAE8B,EAD9B,SAAS,cAfQ,kLAgBrB,CADa;IAEZ,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,IAAA,kDAAsB,EAAC;QAChE,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,SAAS,KAAK,SAAS;QACrC,QAAQ;QACR,KAAK,EAAE,MAAA,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,gBAAgB,mCAAI,KAAK;KAC9C,CAAC,CAAC;IAEH,MAAM,oBAAoB,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE;QACzD,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,OAAO;KACrB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,IAAA,oBAAU,EAAC,WAAW,EAAE,SAAS,EAAE;QACtD,cAAc,EAAE,UAAU;KAC3B,CAAC,CAAC;IAEH,wGAAwG;IACxG,MAAM,YAAY,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC;QAE1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CACL,iCAAM,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,sBAAsB,YACjD,KAAK,GACD,CACR,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE,CAAC;YAC7D,IAAA,4BAAoB,EAClB,4GAA4G,CAC7G,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,mCAAO,SAAS,EAAE,oBAAoB,aACnC,eAAe,KAAK,IAAI,IAAI,YAAY,EACzC,gDACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,gBACA,SAAS,EACrB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,YAAY,IACnB,SAAS,EACT,cAAc,EAClB,EACD,OAAO,CAAC,eAAe,CAAC,KAAK,KAAK,IAAI,YAAY,IAC7C,CACT,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,KAAK,SA2EhB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport { useEffect, useMemo } from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\n\ntype RadioProps = {\n /** Whether the radio is checked */\n isChecked?: boolean;\n /** Selects the radio by default in uncontrolled mode */\n isDefaultChecked?: boolean;\n /** Whether the radio is disabled */\n isDisabled?: boolean;\n /** Whether the radio & label should take the full available width of its container */\n isFluid?: boolean;\n /** Whether the label should be displayed before the radio */\n hasLeadingLabel?: boolean;\n /** The callback function triggered when the radio value changes */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /** The value of the radio */\n value?: HtmlAttributes<'input'>['value'];\n /** The callback function triggered when the radio is clicked */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n} & (\n | {\n /** The aria label of the radio. Required if the label is not a string. */\n ariaLabel: string;\n /** The label of the radio. If not a string, supply an aria label for screen reader support. */\n label?: undefined;\n }\n | {\n ariaLabel?: string;\n label: React.ReactNode;\n }\n);\n\nexport const Radio = ({\n ariaLabel,\n isDisabled = false,\n isDefaultChecked,\n label,\n isFluid = false,\n isChecked,\n hasLeadingLabel,\n onChange,\n className,\n style,\n onClick,\n value,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'input', RadioProps>) => {\n const [isCheckedState, internalOnChange] = useSemiControlledInput({\n inputType: 'radio',\n isControlled: isChecked !== undefined,\n onChange,\n state: isChecked ?? isDefaultChecked ?? false,\n });\n\n const labelWrappingClasses = classNames('ndl-radio-label', {\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n });\n\n const radioClasses = classNames('ndl-radio', className, {\n 'ndl-disabled': isDisabled,\n });\n\n /** TODO: Label handling. We can get rid of this annoying stuff as soon as we do proper form control. */\n const labelContent = useMemo(() => {\n if (Boolean(label) === false) return null;\n\n if (typeof label === 'string') {\n return (\n <span title={label} className=\"ndl-radio-label-text\">\n {label}\n </span>\n );\n }\n return label;\n }, [label]);\n\n useEffect(() => {\n if (Boolean(label) === false && Boolean(ariaLabel) === false) {\n needleWarningMessage(\n 'Radio needs a valid label or ariaLabel: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n }, [ariaLabel, label]);\n\n return (\n <label className={labelWrappingClasses}>\n {hasLeadingLabel === true && labelContent}\n <input\n ref={ref}\n type=\"radio\"\n aria-label={ariaLabel}\n disabled={isDisabled}\n checked={isCheckedState}\n onClick={onClick}\n onChange={internalOnChange}\n value={value}\n style={style}\n className={radioClasses}\n {...restProps}\n {...htmlAttributes}\n />\n {Boolean(hasLeadingLabel) === false && labelContent}\n </label>\n );\n};\n"]}
1
+ {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,iCAA2C;AAG3C,oFAA8E;AAC9E,4CAAwD;AAgCjD,MAAM,KAAK,GAAG,CAAC,EAgBa,EAAE,EAAE;;QAhBjB,EACpB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,gBAAgB,EAChB,KAAK,EACL,OAAO,GAAG,KAAK,EACf,SAAS,EACT,eAAe,EACf,QAAQ,EACR,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,OAE8B,EAD9B,SAAS,cAfQ,kLAgBrB,CADa;IAEZ,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,IAAA,kDAAsB,EAAC;QAChE,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,SAAS,KAAK,SAAS;QACrC,QAAQ;QACR,KAAK,EAAE,MAAA,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,gBAAgB,mCAAI,KAAK;KAC9C,CAAC,CAAC;IAEH,MAAM,oBAAoB,GAAG,IAAA,oBAAU,EA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,KAAK,IAAI,YAAY,IAC7C,CACT,CAAC;AACJ,CAAC,CAAC;AA7EW,QAAA,KAAK,SA6EhB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport { useEffect, useMemo } from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\n\ntype RadioProps = {\n /** Whether the radio is checked */\n isChecked?: boolean;\n /** Selects the radio by default in uncontrolled mode */\n isDefaultChecked?: boolean;\n /** Whether the radio is disabled */\n isDisabled?: boolean;\n /** Whether the radio & label should take the full available width of its container */\n isFluid?: boolean;\n /** Whether the label should be displayed before the radio */\n hasLeadingLabel?: boolean;\n /** The callback function triggered when the radio value changes */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /** The value of the radio */\n value?: HtmlAttributes<'input'>['value'];\n /** The callback function triggered when the radio is clicked */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n} & (\n | {\n /** The aria label of the radio. Required if the label is not a string. */\n ariaLabel: string;\n /** The label of the radio. If not a string, supply an aria label for screen reader support. */\n label?: undefined;\n }\n | {\n ariaLabel?: string;\n label: React.ReactNode;\n }\n);\n\nexport const Radio = ({\n ariaLabel,\n isDisabled = false,\n isDefaultChecked,\n label,\n isFluid = false,\n isChecked,\n hasLeadingLabel,\n onChange,\n className,\n style,\n onClick,\n value,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'input', RadioProps>) => {\n const [isCheckedState, internalOnChange] = useSemiControlledInput({\n inputType: 'radio',\n isControlled: isChecked !== undefined,\n onChange,\n state: isChecked ?? isDefaultChecked ?? false,\n });\n\n const labelWrappingClasses = classNames('ndl-radio-label', {\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n });\n\n const radioClasses = classNames('ndl-radio', className, {\n 'ndl-disabled': isDisabled,\n });\n\n /** TODO: Label handling. We can get rid of this annoying stuff as soon as we do proper form control. */\n const labelContent = useMemo(() => {\n if (Boolean(label) === false) {\n return null;\n }\n\n if (typeof label === 'string') {\n return (\n <span title={label} className=\"ndl-radio-label-text\">\n {label}\n </span>\n );\n }\n return label;\n }, [label]);\n\n useEffect(() => {\n if (Boolean(label) === false && Boolean(ariaLabel) === false) {\n needleWarningMessage(\n 'Radio needs a valid label or ariaLabel: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n }, [ariaLabel, label]);\n\n return (\n <label className={labelWrappingClasses}>\n {hasLeadingLabel === true && labelContent}\n <input\n ref={ref}\n type=\"radio\"\n aria-label={ariaLabel}\n disabled={isDisabled}\n checked={isCheckedState}\n onClick={onClick}\n onChange={internalOnChange}\n value={value}\n style={style}\n className={radioClasses}\n {...restProps}\n {...htmlAttributes}\n />\n {Boolean(hasLeadingLabel) === false && labelContent}\n </label>\n );\n};\n"]}
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Controlled = exports.TruncatedLabel = exports.CustomLabel = exports.Disabled = exports.HasLeadingLabel = exports.NoLabel = exports.Default = void 0;
25
25
  const jsx_runtime_1 = require("react/jsx-runtime");
26
26
  const index_1 = require("../../index");
27
- const _1 = require("./");
27
+ const _1 = require(".");
28
28
  const componentMeta = {
29
29
  component: index_1.Radio,
30
30
  decorators: [
@@ -1 +1 @@
1
- {"version":3,"file":"radio.stories.js","sourceRoot":"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M,EAAE;gBACN,IAAI,EAAE,mBAAgB;gBACtB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAa;CACtB,CAAC;AAEW,QAAA,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,sBAAmB;CAC5B,CAAC;AAEW,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAkB;gBACxB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Radio } from '../../index';\nimport {\n RadioControlled,\n RadioControlledSrc,\n RadioCustomLabel,\n RadioCustomLabelSrc,\n RadioDefault,\n RadioDefaultSrc,\n RadioDisabled,\n RadioDisabledSrc,\n RadioHasLabelBefore,\n RadioHasLabelBeforeSrc,\n RadioNoLabel,\n RadioNoLabelSrc,\n RadioTruncatedLabel,\n RadioTruncatedLabelSrc,\n} from './';\n\nconst componentMeta: Meta<typeof Radio> = {\n component: Radio,\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n id: 'components-radio',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/Radio',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioDefault,\n};\n\nexport const NoLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioNoLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioNoLabel,\n};\n\nexport const HasLeadingLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioHasLabelBeforeSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioHasLabelBefore,\n};\n\nexport const Disabled: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioDisabledSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioDisabled,\n};\n\nexport const CustomLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioCustomLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioCustomLabel,\n};\n\nexport const TruncatedLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioTruncatedLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioTruncatedLabel,\n};\n\nexport const Controlled: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioControlledSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioControlled,\n};\n"]}
1
+ {"version":3,"file":"radio.stories.js","sourceRoot":"","sources":["../../../../src/radio/stories/radio.stories.tsx"],"names":[],"mappings":";;;;AAsBA,uCAAoC;AACpC,wBAeW;AAEX,MAAM,aAAa,GAAuB;IACxC,SAAS,EAAE,aAAK;IAChB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,gCAAK,SAAS,EAAC,yBAAyB,YACtC,uBAAC,KAAK,KAAG,GACL,CACP;KACF;IACD,EAAE,EAAE,kBAAkB;IACtB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,kBAAkB;CAC1B,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAe;gBACrB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAY;CACrB,CAAC;AAEW,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAe;gBACrB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAY;CACrB,CAAC;AAEW,QAAA,eAAe,GAAU;IACpC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,sBAAmB;CAC5B,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,mBAAgB;gBACtB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAa;CACtB,CAAC;AAEW,QAAA,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,sBAAmB;CAC5B,CAAC;AAEW,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAkB;gBACxB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Radio } from '../../index';\nimport {\n RadioControlled,\n RadioControlledSrc,\n RadioCustomLabel,\n RadioCustomLabelSrc,\n RadioDefault,\n RadioDefaultSrc,\n RadioDisabled,\n RadioDisabledSrc,\n RadioHasLabelBefore,\n RadioHasLabelBeforeSrc,\n RadioNoLabel,\n RadioNoLabelSrc,\n RadioTruncatedLabel,\n RadioTruncatedLabelSrc,\n} from '.';\n\nconst componentMeta: Meta<typeof Radio> = {\n component: Radio,\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n id: 'components-radio',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/Radio',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioDefault,\n};\n\nexport const NoLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioNoLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioNoLabel,\n};\n\nexport const HasLeadingLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioHasLabelBeforeSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioHasLabelBefore,\n};\n\nexport const Disabled: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioDisabledSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioDisabled,\n};\n\nexport const CustomLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioCustomLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioCustomLabel,\n};\n\nexport const TruncatedLabel: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioTruncatedLabelSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioTruncatedLabel,\n};\n\nexport const Controlled: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: RadioControlledSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: RadioControlled,\n};\n"]}
@@ -146,7 +146,7 @@ const CustomValueContainer = ({ size, }) => function Component(_a) {
146
146
  };
147
147
  exports.CustomValueContainer = CustomValueContainer;
148
148
  const CustomInput = ({ size, }) => function Component(_a) {
149
- var { children, className } = _a, restProps = __rest(_a, ["children", "className"]);
149
+ var { className } = _a, restProps = __rest(_a, ["className"]);
150
150
  const classes = (0, classnames_1.default)('ndl-select-input', className, {
151
151
  'ndl-is-multi': restProps.isMulti,
152
152
  'ndl-disabled': restProps.isDisabled,