@neo4j-ndl/react 4.3.6 → 4.4.1

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 (515) hide show
  1. package/lib/cjs/_common/types.js.map +1 -1
  2. package/lib/cjs/_common/utils.js +4 -4
  3. package/lib/cjs/_common/utils.js.map +1 -1
  4. package/lib/cjs/accordion/Accordion.js +5 -5
  5. package/lib/cjs/accordion/Accordion.js.map +1 -1
  6. package/lib/cjs/accordion/accordion-context.js +1 -1
  7. package/lib/cjs/accordion/accordion-context.js.map +1 -1
  8. package/lib/cjs/accordion/stories/accordion.stories.js +20 -20
  9. package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
  10. package/lib/cjs/ai/presence/Presence.js +1 -0
  11. package/lib/cjs/ai/presence/Presence.js.map +1 -1
  12. package/lib/cjs/avatar/stories/avatar.stories.js +18 -18
  13. package/lib/cjs/avatar/stories/avatar.stories.js.map +1 -1
  14. package/lib/cjs/banner/Banner.js +1 -1
  15. package/lib/cjs/banner/Banner.js.map +1 -1
  16. package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
  17. package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
  18. package/lib/cjs/checkbox/stories/checkbox-full.story.js +2 -2
  19. package/lib/cjs/checkbox/stories/checkbox-full.story.js.map +1 -1
  20. package/lib/cjs/checkbox/stories/checkbox.stories.js +19 -19
  21. package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
  22. package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
  23. package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
  24. package/lib/cjs/code-block/stories/code-disabled.story.js +2 -2
  25. package/lib/cjs/code-block/stories/code-disabled.story.js.map +1 -1
  26. package/lib/cjs/code-block/stories/code-full.story.js +2 -2
  27. package/lib/cjs/code-block/stories/code-full.story.js.map +1 -1
  28. package/lib/cjs/code-block/stories/code-with-actions.story.js +2 -2
  29. package/lib/cjs/code-block/stories/code-with-actions.story.js.map +1 -1
  30. package/lib/cjs/code-block/themes/ndl-code-dark.js +64 -64
  31. package/lib/cjs/code-block/themes/ndl-code-dark.js.map +1 -1
  32. package/lib/cjs/code-block/themes/ndl-code-light.js +64 -64
  33. package/lib/cjs/code-block/themes/ndl-code-light.js.map +1 -1
  34. package/lib/cjs/color-picker/ColorPicker.js +1 -1
  35. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  36. package/lib/cjs/color-picker/stories/color-picker.stories.js +4 -4
  37. package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -1
  38. package/lib/cjs/data-grid/Components.js +14 -12
  39. package/lib/cjs/data-grid/Components.js.map +1 -1
  40. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  41. package/lib/cjs/data-grid/data-grid-context.js +1 -1
  42. package/lib/cjs/data-grid/data-grid-context.js.map +1 -1
  43. package/lib/cjs/data-grid/data-grid-nav/index.js +1 -1
  44. package/lib/cjs/data-grid/data-grid-nav/index.js.map +1 -1
  45. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
  46. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  47. package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js +0 -24
  48. package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
  49. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  50. package/lib/cjs/date-picker/stories/date-picker-full.story.js +9 -9
  51. package/lib/cjs/date-picker/stories/date-picker-full.story.js.map +1 -1
  52. package/lib/cjs/divider/stories/divider-horizontal.story.js +1 -1
  53. package/lib/cjs/divider/stories/divider-horizontal.story.js.map +1 -1
  54. package/lib/cjs/divider/stories/divider-vertical.story.js +1 -1
  55. package/lib/cjs/divider/stories/divider-vertical.story.js.map +1 -1
  56. package/lib/cjs/drawer/stories/drawer.stories.js +19 -19
  57. package/lib/cjs/drawer/stories/drawer.stories.js.map +1 -1
  58. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  59. package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js +18 -18
  60. package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
  61. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -1
  62. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  63. package/lib/cjs/dropzone/stories/dropzone-full.story.js +11 -11
  64. package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
  65. package/lib/cjs/dropzone/stories/dropzone.stories.js +10 -10
  66. package/lib/cjs/dropzone/stories/dropzone.stories.js.map +1 -1
  67. package/lib/cjs/flex/Flex.js +4 -4
  68. package/lib/cjs/flex/Flex.js.map +1 -1
  69. package/lib/cjs/graph-label/stories/graph-label.stories.js +20 -20
  70. package/lib/cjs/graph-label/stories/graph-label.stories.js.map +1 -1
  71. package/lib/cjs/hooks/index.js +3 -3
  72. package/lib/cjs/hooks/index.js.map +1 -1
  73. package/lib/cjs/icon-button/stories/icon-button.stories.js +12 -12
  74. package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
  75. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +16 -16
  76. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  77. package/lib/cjs/icon-button-base/IconButtonBase.js +5 -3
  78. package/lib/cjs/icon-button-base/IconButtonBase.js.map +1 -1
  79. package/lib/cjs/icons/generated/custom/DatabaseCross.js +1 -1
  80. package/lib/cjs/icons/generated/custom/DatabaseCross.js.map +1 -1
  81. package/lib/cjs/icons/generated/custom/DatabasePlus.js +1 -1
  82. package/lib/cjs/icons/generated/custom/DatabasePlus.js.map +1 -1
  83. package/lib/cjs/icons/generated/custom/GlobePin.js +1 -1
  84. package/lib/cjs/icons/generated/custom/GlobePin.js.map +1 -1
  85. package/lib/cjs/icons/generated/custom/PanelBottom.js +1 -1
  86. package/lib/cjs/icons/generated/custom/PanelBottom.js.map +1 -1
  87. package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js +30 -0
  88. package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
  89. package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js +30 -0
  90. package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
  91. package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js +30 -0
  92. package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
  93. package/lib/cjs/icons/generated/custom/PanelRightExpanded.js +30 -0
  94. package/lib/cjs/icons/generated/custom/PanelRightExpanded.js.map +1 -0
  95. package/lib/cjs/icons/generated/custom/ThreePanel.js +1 -1
  96. package/lib/cjs/icons/generated/custom/ThreePanel.js.map +1 -1
  97. package/lib/cjs/icons/generated/custom/index.js +9 -1
  98. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  99. package/lib/cjs/icons/wrapIcon.js +2 -2
  100. package/lib/cjs/icons/wrapIcon.js.map +1 -1
  101. package/lib/cjs/kbd/stories/kbd.stories.js +7 -7
  102. package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
  103. package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
  104. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
  105. package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js +10 -10
  106. package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
  107. package/lib/cjs/logo/Logo.js +6 -6
  108. package/lib/cjs/logo/Logo.js.map +1 -1
  109. package/lib/cjs/logo/stories/logo.stories.js +9 -9
  110. package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
  111. package/lib/cjs/menu/Menu.js +3 -3
  112. package/lib/cjs/menu/Menu.js.map +1 -1
  113. package/lib/cjs/menu/stories/menu-custom-items.story.js +3 -1
  114. package/lib/cjs/menu/stories/menu-custom-items.story.js.map +1 -1
  115. package/lib/cjs/menu/stories/menu-default.story.js +3 -1
  116. package/lib/cjs/menu/stories/menu-default.story.js.map +1 -1
  117. package/lib/cjs/menu/stories/menu-in-dialog.story.js +5 -1
  118. package/lib/cjs/menu/stories/menu-in-dialog.story.js.map +1 -1
  119. package/lib/cjs/menu/stories/menu-in-popover.story.js +3 -1
  120. package/lib/cjs/menu/stories/menu-in-popover.story.js.map +1 -1
  121. package/lib/cjs/menu/stories/menu-nested.story.js +3 -1
  122. package/lib/cjs/menu/stories/menu-nested.story.js.map +1 -1
  123. package/lib/cjs/menu/stories/menu-placements.story.js +3 -1
  124. package/lib/cjs/menu/stories/menu-placements.story.js.map +1 -1
  125. package/lib/cjs/menu/stories/menu-with-category.story.js +1 -2
  126. package/lib/cjs/menu/stories/menu-with-category.story.js.map +1 -1
  127. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js +1 -2
  128. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  129. package/lib/cjs/menu/stories/menu-with-divider.story.js +1 -2
  130. package/lib/cjs/menu/stories/menu-with-divider.story.js.map +1 -1
  131. package/lib/cjs/menu/stories/menu-with-icon.story.js +3 -1
  132. package/lib/cjs/menu/stories/menu-with-icon.story.js.map +1 -1
  133. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
  134. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  135. package/lib/cjs/popover/Popover.js +15 -15
  136. package/lib/cjs/popover/Popover.js.map +1 -1
  137. package/lib/cjs/popover/use-popover.js +9 -9
  138. package/lib/cjs/popover/use-popover.js.map +1 -1
  139. package/lib/cjs/progress-bar/stories/progress-bar.stories.js +3 -3
  140. package/lib/cjs/progress-bar/stories/progress-bar.stories.js.map +1 -1
  141. package/lib/cjs/segmented-control/SegmentedControl.js +1 -1
  142. package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
  143. package/lib/cjs/select/Overrides.js +41 -41
  144. package/lib/cjs/select/Overrides.js.map +1 -1
  145. package/lib/cjs/select/Select.js +25 -3
  146. package/lib/cjs/select/Select.js.map +1 -1
  147. package/lib/cjs/select/stories/select-async.story.js +4 -4
  148. package/lib/cjs/select/stories/select-async.story.js.map +1 -1
  149. package/lib/cjs/select/stories/select-controlled.story.js +4 -4
  150. package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
  151. package/lib/cjs/select/stories/select-creatable.story.js +1 -1
  152. package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
  153. package/lib/cjs/select/stories/select-custom-label.story.js +1 -1
  154. package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
  155. package/lib/cjs/select/stories/select-disabled.story.js +1 -1
  156. package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
  157. package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -1
  158. package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
  159. package/lib/cjs/side-navigation/SideNavigation.js +1 -1
  160. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  161. package/lib/cjs/side-navigation/stories/side-nav.stories.js +1 -1
  162. package/lib/cjs/side-navigation/stories/side-nav.stories.js.map +1 -1
  163. package/lib/cjs/skeleton/stories/skeleton.stories.js +28 -28
  164. package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
  165. package/lib/cjs/slider/Slider.js +2 -1
  166. package/lib/cjs/slider/Slider.js.map +1 -1
  167. package/lib/cjs/status-indicator/stories/status-indicator.stories.js +2 -2
  168. package/lib/cjs/status-indicator/stories/status-indicator.stories.js.map +1 -1
  169. package/lib/cjs/switch/stories/switch.stories.js +7 -7
  170. package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
  171. package/lib/cjs/tabs/Tabs.js +2 -2
  172. package/lib/cjs/tabs/Tabs.js.map +1 -1
  173. package/lib/cjs/tabs/stories/tabs-overflow.story.js +1 -1
  174. package/lib/cjs/tabs/stories/tabs-overflow.story.js.map +1 -1
  175. package/lib/cjs/tag/Tag.js +2 -2
  176. package/lib/cjs/tag/Tag.js.map +1 -1
  177. package/lib/cjs/tag/stories/tag.stories.js +10 -10
  178. package/lib/cjs/tag/stories/tag.stories.js.map +1 -1
  179. package/lib/cjs/text-area/TextArea.js +5 -5
  180. package/lib/cjs/text-area/TextArea.js.map +1 -1
  181. package/lib/cjs/text-area/stories/text-area.stories.js +25 -25
  182. package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
  183. package/lib/cjs/text-input/stories/text-input-number.story.js +2 -2
  184. package/lib/cjs/text-input/stories/text-input-number.story.js.map +1 -1
  185. package/lib/cjs/text-link/stories/text-link.stories.js +11 -11
  186. package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
  187. package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
  188. package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
  189. package/lib/cjs/theme/ThemeProvider.js.map +1 -1
  190. package/lib/cjs/theme/agnostic.js +1 -1
  191. package/lib/cjs/theme/agnostic.js.map +1 -1
  192. package/lib/cjs/time-picker/TimePicker.js +4 -4
  193. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  194. package/lib/cjs/time-picker/time-picker-hooks.js +1 -1
  195. package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -1
  196. package/lib/cjs/timezone-picker/TimeZonePicker.js +5 -5
  197. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  198. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
  199. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  200. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  201. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  202. package/lib/cjs/toast/Toast.js +12 -12
  203. package/lib/cjs/toast/Toast.js.map +1 -1
  204. package/lib/cjs/toast/stories/toast-action-story.js +1 -1
  205. package/lib/cjs/toast/stories/toast-action-story.js.map +1 -1
  206. package/lib/cjs/toast/stories/toast-controlled-story.js +2 -2
  207. package/lib/cjs/toast/stories/toast-controlled-story.js.map +1 -1
  208. package/lib/cjs/toast/stories/toast-progress-bar.js +1 -1
  209. package/lib/cjs/toast/stories/toast-progress-bar.js.map +1 -1
  210. package/lib/cjs/toast/stories/toast.stories.js +18 -18
  211. package/lib/cjs/toast/stories/toast.stories.js.map +1 -1
  212. package/lib/cjs/tooltip/Tooltip.js +1 -1
  213. package/lib/cjs/tooltip/Tooltip.js.map +1 -1
  214. package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js +1 -1
  215. package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
  216. package/lib/cjs/tooltip/stories/tooltip-placements.story.js +8 -8
  217. package/lib/cjs/tooltip/stories/tooltip-placements.story.js.map +1 -1
  218. package/lib/cjs/tooltip/stories/tooltip.stories.js +29 -29
  219. package/lib/cjs/tooltip/stories/tooltip.stories.js.map +1 -1
  220. package/lib/cjs/tooltip/use-tooltip.js +10 -10
  221. package/lib/cjs/tooltip/use-tooltip.js.map +1 -1
  222. package/lib/cjs/tree-view/TreeItemWrapper.js +2 -2
  223. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  224. package/lib/cjs/tree-view/TreeView.js +12 -12
  225. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  226. package/lib/cjs/tree-view/TreeViewItem.js +1 -1
  227. package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
  228. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
  229. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  230. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js +2 -2
  231. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  232. package/lib/cjs/wizard/Wizard.js +3 -3
  233. package/lib/cjs/wizard/Wizard.js.map +1 -1
  234. package/lib/cjs/wizard/stories/wizard.stories.js +14 -14
  235. package/lib/cjs/wizard/stories/wizard.stories.js.map +1 -1
  236. package/lib/esm/_common/types.js.map +1 -1
  237. package/lib/esm/_common/utils.js +4 -4
  238. package/lib/esm/_common/utils.js.map +1 -1
  239. package/lib/esm/accordion/Accordion.js +5 -5
  240. package/lib/esm/accordion/Accordion.js.map +1 -1
  241. package/lib/esm/accordion/accordion-context.js +1 -1
  242. package/lib/esm/accordion/accordion-context.js.map +1 -1
  243. package/lib/esm/accordion/stories/accordion.stories.js +20 -20
  244. package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
  245. package/lib/esm/ai/presence/Presence.js +1 -0
  246. package/lib/esm/ai/presence/Presence.js.map +1 -1
  247. package/lib/esm/avatar/stories/avatar.stories.js +18 -18
  248. package/lib/esm/avatar/stories/avatar.stories.js.map +1 -1
  249. package/lib/esm/banner/Banner.js +1 -1
  250. package/lib/esm/banner/Banner.js.map +1 -1
  251. package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
  252. package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
  253. package/lib/esm/checkbox/stories/checkbox-full.story.js +2 -2
  254. package/lib/esm/checkbox/stories/checkbox-full.story.js.map +1 -1
  255. package/lib/esm/checkbox/stories/checkbox.stories.js +19 -19
  256. package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
  257. package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
  258. package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
  259. package/lib/esm/code-block/stories/code-disabled.story.js +2 -2
  260. package/lib/esm/code-block/stories/code-disabled.story.js.map +1 -1
  261. package/lib/esm/code-block/stories/code-full.story.js +2 -2
  262. package/lib/esm/code-block/stories/code-full.story.js.map +1 -1
  263. package/lib/esm/code-block/stories/code-with-actions.story.js +2 -2
  264. package/lib/esm/code-block/stories/code-with-actions.story.js.map +1 -1
  265. package/lib/esm/code-block/themes/ndl-code-dark.js +64 -64
  266. package/lib/esm/code-block/themes/ndl-code-dark.js.map +1 -1
  267. package/lib/esm/code-block/themes/ndl-code-light.js +64 -64
  268. package/lib/esm/code-block/themes/ndl-code-light.js.map +1 -1
  269. package/lib/esm/color-picker/ColorPicker.js +1 -1
  270. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  271. package/lib/esm/color-picker/stories/color-picker.stories.js +4 -4
  272. package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -1
  273. package/lib/esm/data-grid/Components.js +14 -12
  274. package/lib/esm/data-grid/Components.js.map +1 -1
  275. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  276. package/lib/esm/data-grid/data-grid-context.js +1 -1
  277. package/lib/esm/data-grid/data-grid-context.js.map +1 -1
  278. package/lib/esm/data-grid/data-grid-nav/index.js +1 -1
  279. package/lib/esm/data-grid/data-grid-nav/index.js.map +1 -1
  280. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
  281. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  282. package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js +0 -24
  283. package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
  284. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  285. package/lib/esm/date-picker/stories/date-picker-full.story.js +9 -9
  286. package/lib/esm/date-picker/stories/date-picker-full.story.js.map +1 -1
  287. package/lib/esm/divider/stories/divider-horizontal.story.js +1 -1
  288. package/lib/esm/divider/stories/divider-horizontal.story.js.map +1 -1
  289. package/lib/esm/divider/stories/divider-vertical.story.js +1 -1
  290. package/lib/esm/divider/stories/divider-vertical.story.js.map +1 -1
  291. package/lib/esm/drawer/stories/drawer.stories.js +19 -19
  292. package/lib/esm/drawer/stories/drawer.stories.js.map +1 -1
  293. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  294. package/lib/esm/dropdown-button/stories/dropdown-button.stories.js +18 -18
  295. package/lib/esm/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
  296. package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -1
  297. package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  298. package/lib/esm/dropzone/stories/dropzone-full.story.js +11 -11
  299. package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
  300. package/lib/esm/dropzone/stories/dropzone.stories.js +10 -10
  301. package/lib/esm/dropzone/stories/dropzone.stories.js.map +1 -1
  302. package/lib/esm/flex/Flex.js +4 -4
  303. package/lib/esm/flex/Flex.js.map +1 -1
  304. package/lib/esm/graph-label/stories/graph-label.stories.js +20 -20
  305. package/lib/esm/graph-label/stories/graph-label.stories.js.map +1 -1
  306. package/lib/esm/hooks/index.js +3 -3
  307. package/lib/esm/hooks/index.js.map +1 -1
  308. package/lib/esm/icon-button/stories/icon-button.stories.js +12 -12
  309. package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
  310. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +16 -16
  311. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  312. package/lib/esm/icon-button-base/IconButtonBase.js +5 -3
  313. package/lib/esm/icon-button-base/IconButtonBase.js.map +1 -1
  314. package/lib/esm/icons/generated/custom/DatabaseCross.js +2 -2
  315. package/lib/esm/icons/generated/custom/DatabaseCross.js.map +1 -1
  316. package/lib/esm/icons/generated/custom/DatabasePlus.js +1 -1
  317. package/lib/esm/icons/generated/custom/DatabasePlus.js.map +1 -1
  318. package/lib/esm/icons/generated/custom/GlobePin.js +1 -1
  319. package/lib/esm/icons/generated/custom/GlobePin.js.map +1 -1
  320. package/lib/esm/icons/generated/custom/PanelBottom.js +1 -1
  321. package/lib/esm/icons/generated/custom/PanelBottom.js.map +1 -1
  322. package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js +28 -0
  323. package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
  324. package/lib/esm/icons/generated/custom/PanelLeftExpanded.js +28 -0
  325. package/lib/esm/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
  326. package/lib/esm/icons/generated/custom/PanelRightCollapsed.js +28 -0
  327. package/lib/esm/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
  328. package/lib/esm/icons/generated/custom/PanelRightExpanded.js +28 -0
  329. package/lib/esm/icons/generated/custom/PanelRightExpanded.js.map +1 -0
  330. package/lib/esm/icons/generated/custom/ThreePanel.js +1 -1
  331. package/lib/esm/icons/generated/custom/ThreePanel.js.map +1 -1
  332. package/lib/esm/icons/generated/custom/index.js +4 -0
  333. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  334. package/lib/esm/icons/wrapIcon.js +2 -2
  335. package/lib/esm/icons/wrapIcon.js.map +1 -1
  336. package/lib/esm/kbd/stories/kbd.stories.js +7 -7
  337. package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
  338. package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
  339. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
  340. package/lib/esm/loading-spinner/stories/loading-spinner.stories.js +10 -10
  341. package/lib/esm/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
  342. package/lib/esm/logo/Logo.js +6 -6
  343. package/lib/esm/logo/Logo.js.map +1 -1
  344. package/lib/esm/logo/stories/logo.stories.js +9 -9
  345. package/lib/esm/logo/stories/logo.stories.js.map +1 -1
  346. package/lib/esm/menu/Menu.js +3 -3
  347. package/lib/esm/menu/Menu.js.map +1 -1
  348. package/lib/esm/menu/stories/menu-custom-items.story.js +3 -1
  349. package/lib/esm/menu/stories/menu-custom-items.story.js.map +1 -1
  350. package/lib/esm/menu/stories/menu-default.story.js +3 -1
  351. package/lib/esm/menu/stories/menu-default.story.js.map +1 -1
  352. package/lib/esm/menu/stories/menu-in-dialog.story.js +5 -1
  353. package/lib/esm/menu/stories/menu-in-dialog.story.js.map +1 -1
  354. package/lib/esm/menu/stories/menu-in-popover.story.js +3 -1
  355. package/lib/esm/menu/stories/menu-in-popover.story.js.map +1 -1
  356. package/lib/esm/menu/stories/menu-nested.story.js +3 -1
  357. package/lib/esm/menu/stories/menu-nested.story.js.map +1 -1
  358. package/lib/esm/menu/stories/menu-placements.story.js +3 -1
  359. package/lib/esm/menu/stories/menu-placements.story.js.map +1 -1
  360. package/lib/esm/menu/stories/menu-with-category.story.js +1 -2
  361. package/lib/esm/menu/stories/menu-with-category.story.js.map +1 -1
  362. package/lib/esm/menu/stories/menu-with-disabled-item.story.js +1 -2
  363. package/lib/esm/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  364. package/lib/esm/menu/stories/menu-with-divider.story.js +1 -2
  365. package/lib/esm/menu/stories/menu-with-divider.story.js.map +1 -1
  366. package/lib/esm/menu/stories/menu-with-icon.story.js +3 -1
  367. package/lib/esm/menu/stories/menu-with-icon.story.js.map +1 -1
  368. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
  369. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  370. package/lib/esm/popover/Popover.js +15 -15
  371. package/lib/esm/popover/Popover.js.map +1 -1
  372. package/lib/esm/popover/use-popover.js +9 -9
  373. package/lib/esm/popover/use-popover.js.map +1 -1
  374. package/lib/esm/progress-bar/stories/progress-bar.stories.js +3 -3
  375. package/lib/esm/progress-bar/stories/progress-bar.stories.js.map +1 -1
  376. package/lib/esm/segmented-control/SegmentedControl.js +1 -1
  377. package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
  378. package/lib/esm/select/Overrides.js +41 -41
  379. package/lib/esm/select/Overrides.js.map +1 -1
  380. package/lib/esm/select/Select.js +26 -4
  381. package/lib/esm/select/Select.js.map +1 -1
  382. package/lib/esm/select/stories/select-async.story.js +4 -4
  383. package/lib/esm/select/stories/select-async.story.js.map +1 -1
  384. package/lib/esm/select/stories/select-controlled.story.js +4 -4
  385. package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
  386. package/lib/esm/select/stories/select-creatable.story.js +1 -1
  387. package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
  388. package/lib/esm/select/stories/select-custom-label.story.js +1 -1
  389. package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
  390. package/lib/esm/select/stories/select-disabled.story.js +1 -1
  391. package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
  392. package/lib/esm/select/stories/select-inside-dialog.story.js +1 -1
  393. package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
  394. package/lib/esm/side-navigation/SideNavigation.js +1 -1
  395. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  396. package/lib/esm/side-navigation/stories/side-nav.stories.js +1 -1
  397. package/lib/esm/side-navigation/stories/side-nav.stories.js.map +1 -1
  398. package/lib/esm/skeleton/stories/skeleton.stories.js +28 -28
  399. package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
  400. package/lib/esm/slider/Slider.js +2 -1
  401. package/lib/esm/slider/Slider.js.map +1 -1
  402. package/lib/esm/status-indicator/stories/status-indicator.stories.js +2 -2
  403. package/lib/esm/status-indicator/stories/status-indicator.stories.js.map +1 -1
  404. package/lib/esm/switch/stories/switch.stories.js +7 -7
  405. package/lib/esm/switch/stories/switch.stories.js.map +1 -1
  406. package/lib/esm/tabs/Tabs.js +2 -2
  407. package/lib/esm/tabs/Tabs.js.map +1 -1
  408. package/lib/esm/tabs/stories/tabs-overflow.story.js +1 -1
  409. package/lib/esm/tabs/stories/tabs-overflow.story.js.map +1 -1
  410. package/lib/esm/tag/Tag.js +2 -2
  411. package/lib/esm/tag/Tag.js.map +1 -1
  412. package/lib/esm/tag/stories/tag.stories.js +10 -10
  413. package/lib/esm/tag/stories/tag.stories.js.map +1 -1
  414. package/lib/esm/text-area/TextArea.js +5 -5
  415. package/lib/esm/text-area/TextArea.js.map +1 -1
  416. package/lib/esm/text-area/stories/text-area.stories.js +25 -25
  417. package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
  418. package/lib/esm/text-input/stories/text-input-number.story.js +2 -2
  419. package/lib/esm/text-input/stories/text-input-number.story.js.map +1 -1
  420. package/lib/esm/text-link/stories/text-link.stories.js +11 -11
  421. package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
  422. package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
  423. package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
  424. package/lib/esm/theme/ThemeProvider.js.map +1 -1
  425. package/lib/esm/theme/agnostic.js +1 -1
  426. package/lib/esm/theme/agnostic.js.map +1 -1
  427. package/lib/esm/time-picker/TimePicker.js +4 -4
  428. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  429. package/lib/esm/time-picker/time-picker-hooks.js +1 -1
  430. package/lib/esm/time-picker/time-picker-hooks.js.map +1 -1
  431. package/lib/esm/timezone-picker/TimeZonePicker.js +5 -5
  432. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  433. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
  434. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  435. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  436. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  437. package/lib/esm/toast/Toast.js +12 -12
  438. package/lib/esm/toast/Toast.js.map +1 -1
  439. package/lib/esm/toast/stories/toast-action-story.js +1 -1
  440. package/lib/esm/toast/stories/toast-action-story.js.map +1 -1
  441. package/lib/esm/toast/stories/toast-controlled-story.js +2 -2
  442. package/lib/esm/toast/stories/toast-controlled-story.js.map +1 -1
  443. package/lib/esm/toast/stories/toast-progress-bar.js +1 -1
  444. package/lib/esm/toast/stories/toast-progress-bar.js.map +1 -1
  445. package/lib/esm/toast/stories/toast.stories.js +18 -18
  446. package/lib/esm/toast/stories/toast.stories.js.map +1 -1
  447. package/lib/esm/tooltip/Tooltip.js +1 -1
  448. package/lib/esm/tooltip/Tooltip.js.map +1 -1
  449. package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js +1 -1
  450. package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
  451. package/lib/esm/tooltip/stories/tooltip-placements.story.js +8 -8
  452. package/lib/esm/tooltip/stories/tooltip-placements.story.js.map +1 -1
  453. package/lib/esm/tooltip/stories/tooltip.stories.js +29 -29
  454. package/lib/esm/tooltip/stories/tooltip.stories.js.map +1 -1
  455. package/lib/esm/tooltip/use-tooltip.js +10 -10
  456. package/lib/esm/tooltip/use-tooltip.js.map +1 -1
  457. package/lib/esm/tree-view/TreeItemWrapper.js +2 -2
  458. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  459. package/lib/esm/tree-view/TreeView.js +12 -12
  460. package/lib/esm/tree-view/TreeView.js.map +1 -1
  461. package/lib/esm/tree-view/TreeViewItem.js +1 -1
  462. package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
  463. package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
  464. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  465. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js +2 -2
  466. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  467. package/lib/esm/wizard/Wizard.js +3 -3
  468. package/lib/esm/wizard/Wizard.js.map +1 -1
  469. package/lib/esm/wizard/stories/wizard.stories.js +14 -14
  470. package/lib/esm/wizard/stories/wizard.stories.js.map +1 -1
  471. package/lib/types/accordion/stories/accordion.stories.d.ts +3 -3
  472. package/lib/types/ai/presence/Presence.d.ts.map +1 -1
  473. package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +1 -1
  474. package/lib/types/data-grid/Components.d.ts.map +1 -1
  475. package/lib/types/data-grid/stories/datagrid-single-selectable.story.d.ts.map +1 -1
  476. package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
  477. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  478. package/lib/types/icon-button-base/IconButtonBase.d.ts.map +1 -1
  479. package/lib/types/icons/generated/custom/DatabaseCross.d.ts.map +1 -1
  480. package/lib/types/icons/generated/custom/DatabasePlus.d.ts.map +1 -1
  481. package/lib/types/icons/generated/custom/GlobePin.d.ts.map +1 -1
  482. package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts +29 -0
  483. package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts.map +1 -0
  484. package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts +29 -0
  485. package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts.map +1 -0
  486. package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts +29 -0
  487. package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts.map +1 -0
  488. package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts +29 -0
  489. package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts.map +1 -0
  490. package/lib/types/icons/generated/custom/index.d.ts +4 -0
  491. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  492. package/lib/types/icons/wrapIcon.d.ts.map +1 -1
  493. package/lib/types/logo/stories/logo.stories.d.ts +3 -3
  494. package/lib/types/menu/stories/menu-custom-items.story.d.ts.map +1 -1
  495. package/lib/types/menu/stories/menu-default.story.d.ts.map +1 -1
  496. package/lib/types/menu/stories/menu-in-dialog.story.d.ts.map +1 -1
  497. package/lib/types/menu/stories/menu-in-popover.story.d.ts.map +1 -1
  498. package/lib/types/menu/stories/menu-nested.story.d.ts.map +1 -1
  499. package/lib/types/menu/stories/menu-placements.story.d.ts.map +1 -1
  500. package/lib/types/menu/stories/menu-with-category.story.d.ts.map +1 -1
  501. package/lib/types/menu/stories/menu-with-disabled-item.story.d.ts.map +1 -1
  502. package/lib/types/menu/stories/menu-with-divider.story.d.ts.map +1 -1
  503. package/lib/types/menu/stories/menu-with-icon.story.d.ts.map +1 -1
  504. package/lib/types/menu/stories/menu-with-keyboard-shortcuts.story.d.ts.map +1 -1
  505. package/lib/types/select/Select.d.ts.map +1 -1
  506. package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
  507. package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
  508. package/lib/types/skeleton/stories/skeleton.stories.d.ts +3 -3
  509. package/lib/types/slider/Slider.d.ts.map +1 -1
  510. package/lib/types/tabs/Tabs.d.ts.map +1 -1
  511. package/lib/types/tabs/stories/tabs-overflow.story.d.ts.map +1 -1
  512. package/lib/types/time-picker/time-picker-hooks.d.ts +1 -1
  513. package/lib/types/time-picker/time-picker-hooks.d.ts.map +1 -1
  514. package/lib/types/toast/stories/toast.stories.d.ts +2 -2
  515. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"menu-nested.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-nested.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,YAE/B,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAI,EACxD,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,UAAU,SAAG,EACrC,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,WAAW,EAAC,iBAAiB,GAAG,EACvD,KAAC,IAAI,IACH,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,sBAAsB,EAClC,IAAI,EAAE,KAAC,uBAAuB,KAAG,YAEjC,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,OAAO,GAAG,EAC3B,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YACjB,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,IACf,GACR,EACP,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,OAAO,GAAG,IAChB,GACR,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YACjB,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,WAAW,GAAG,IACpB,GACR,IACI,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { Square2StackIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={() => setIsOpen(false)}\n >\n <Menu.Items>\n <Menu.Item title=\"Undo\" onClick={() => alert('Undo')} />\n <Menu.Item title=\"Redo\" isDisabled />\n <Menu.Item title=\"Cut\" description=\"Copy and remove\" />\n <Menu\n title=\"Copy as\"\n description=\"Copying as something\"\n icon={<Square2StackIconOutline />}\n >\n <Menu.Items>\n <Menu.Item title=\"Text\" />\n <Menu.Item title=\"Video\" />\n <Menu title=\"Image\">\n <Menu.Items>\n <Menu.Item title=\".png\" />\n <Menu.Item title=\".jpg\" />\n <Menu.Item title=\".svg\" />\n <Menu.Item title=\".gif\" />\n </Menu.Items>\n </Menu>\n <Menu.Item title=\"Audio\" />\n </Menu.Items>\n </Menu>\n <Menu title=\"Share\">\n <Menu.Items>\n <Menu.Item title=\"Mail\" />\n <Menu.Item title=\"Instagram\" />\n </Menu.Items>\n </Menu>\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-nested.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-nested.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;A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,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,IACf,GACR,EACP,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,OAAO,GAAG,IAChB,GACR,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YACjB,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,MAAM,GAAG,EAC1B,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,WAAW,GAAG,IACpB,GACR,IACI,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { Square2StackIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item title=\"Undo\" onClick={() => alert('Undo')} />\n <Menu.Item title=\"Redo\" isDisabled />\n <Menu.Item title=\"Cut\" description=\"Copy and remove\" />\n <Menu\n title=\"Copy as\"\n description=\"Copying as something\"\n icon={<Square2StackIconOutline />}\n >\n <Menu.Items>\n <Menu.Item title=\"Text\" />\n <Menu.Item title=\"Video\" />\n <Menu title=\"Image\">\n <Menu.Items>\n <Menu.Item title=\".png\" />\n <Menu.Item title=\".jpg\" />\n <Menu.Item title=\".svg\" />\n <Menu.Item title=\".gif\" />\n </Menu.Items>\n </Menu>\n <Menu.Item title=\"Audio\" />\n </Menu.Items>\n </Menu>\n <Menu title=\"Share\">\n <Menu.Items>\n <Menu.Item title=\"Mail\" />\n <Menu.Item title=\"Instagram\" />\n </Menu.Items>\n </Menu>\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -25,7 +25,9 @@ import { useRef, useState } from 'react';
25
25
  const Component = () => {
26
26
  const anchorEl = useRef(null);
27
27
  const [isOpen, setIsOpen] = useState(false);
28
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, placement: "middle-end-middle-start", onClose: () => setIsOpen(false), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Action 1", onClick: () => {
28
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, placement: "middle-end-middle-start", onClose: (_event, _data) => {
29
+ setIsOpen(false);
30
+ }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Action 1", onClick: () => {
29
31
  alert('Action1');
30
32
  setIsOpen(false);
31
33
  } }), _jsx(Menu.Item, { title: "Action 2", onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"menu-placements.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-placements.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,YAE/B,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,EAAE,EAAC,UAAU,EACb,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,kCAAkC,GAC9C,IACS,GACR,EAEP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n placement=\"middle-end-middle-start\"\n onClose={() => setIsOpen(false)}\n >\n <Menu.Items>\n <Menu.Item\n title=\"Action 1\"\n onClick={() => {\n alert('Action1');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 2\"\n onClick={() => {\n alert('Action2');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => {\n alert('Action3');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => {\n alert('Action4');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n id=\"action_5\"\n title=\"Action 5\"\n description=\"Action 5 does not close the menu\"\n />\n </Menu.Items>\n </Menu>\n\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-placements.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-placements.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,SAAS,CAAC,CAAC;gCACjB,SAAS,CAAC,KAAK,CAAC,CAAC;4BACnB,CAAC,GACD,EACF,KAAC,IAAI,CAAC,IAAI,IACR,EAAE,EAAC,UAAU,EACb,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,kCAAkC,GAC9C,IACS,GACR,EAEP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n placement=\"middle-end-middle-start\"\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item\n title=\"Action 1\"\n onClick={() => {\n alert('Action1');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 2\"\n onClick={() => {\n alert('Action2');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => {\n alert('Action3');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => {\n alert('Action4');\n setIsOpen(false);\n }}\n />\n <Menu.Item\n id=\"action_5\"\n title=\"Action 5\"\n description=\"Action 5 does not close the menu\"\n />\n </Menu.Items>\n </Menu>\n\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -25,8 +25,7 @@ import { useRef, useState } from 'react';
25
25
  const Component = () => {
26
26
  const anchorEl = useRef(null);
27
27
  const [isOpen, setIsOpen] = useState(false);
28
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (event, data) => {
29
- console.info('onClose callback', event, data);
28
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (_event, _data) => {
30
29
  setIsOpen(false);
31
30
  }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.CategoryItem, { children: "Category 1" }), _jsx(Menu.Item, { title: "Action 1", onClick: () => alert('Action1') }), _jsx(Menu.Item, { title: "Action 2", onClick: () => alert('Action2') }), _jsx(Menu.Divider, {}), _jsx(Menu.Item, { title: "Action 3", description: "Action 3 is disabled", isDisabled: true, onClick: () => alert('Action3') }), _jsx(Menu.Item, { title: "Action 4", description: "Action 4 is awesome", onClick: () => alert('Action4') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
32
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"menu-with-category.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-category.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;oBACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC9C,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,YAAY,6BAA+B,EACjD,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,EAC/D,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,EAC/D,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(event, data) => {\n console.info('onClose callback', event, data);\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.CategoryItem>Category 1</Menu.CategoryItem>\n <Menu.Item title=\"Action 1\" onClick={() => alert('Action1')} />\n <Menu.Item title=\"Action 2\" onClick={() => alert('Action2')} />\n <Menu.Divider />\n <Menu.Item\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => alert('Action3')}\n />\n <Menu.Item\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-with-category.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-category.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,YAAY,6BAA+B,EACjD,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,EAC/D,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,EAC/D,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,EACF,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.CategoryItem>Category 1</Menu.CategoryItem>\n <Menu.Item title=\"Action 1\" onClick={() => alert('Action1')} />\n <Menu.Item title=\"Action 2\" onClick={() => alert('Action2')} />\n <Menu.Divider />\n <Menu.Item\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => alert('Action3')}\n />\n <Menu.Item\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -25,8 +25,7 @@ import { useRef, useState } from 'react';
25
25
  const Component = () => {
26
26
  const anchorEl = useRef(null);
27
27
  const [isOpen, setIsOpen] = useState(false);
28
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (event, data) => {
29
- console.info('onClose callback', event, data);
28
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (_event, _data) => {
30
29
  setIsOpen(false);
31
30
  }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Action 1", description: "Action 1 is disabled", isDisabled: true }), _jsx(Menu.Item, { title: "Action 2", onClick: () => alert('Action2') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
32
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"menu-with-disabled-item.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-disabled-item.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;oBACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC9C,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,GAChB,EACF,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,IACpD,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(event, data) => {\n console.info('onClose callback', event, data);\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item\n title=\"Action 1\"\n description=\"Action 1 is disabled\"\n isDisabled={true}\n />\n <Menu.Item title=\"Action 2\" onClick={() => alert('Action2')} />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-with-disabled-item.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-disabled-item.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,sBAAsB,EAClC,UAAU,EAAE,IAAI,GAChB,EACF,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAI,IACpD,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item\n title=\"Action 1\"\n description=\"Action 1 is disabled\"\n isDisabled={true}\n />\n <Menu.Item title=\"Action 2\" onClick={() => alert('Action2')} />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -25,8 +25,7 @@ import { useRef, useState } from 'react';
25
25
  const Component = () => {
26
26
  const anchorEl = useRef(null);
27
27
  const [isOpen, setIsOpen] = useState(false);
28
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (event, data) => {
29
- console.info('onClose callback', event, data);
28
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (_event, _data) => {
30
29
  setIsOpen(false);
31
30
  }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Action 1" }), _jsx(Menu.Divider, {}), _jsx(Menu.Item, { title: "Action 2" }), _jsx(Menu.Divider, {}), _jsx(Menu.Item, { title: "Action 3" }), _jsx(Menu.Divider, {}), _jsx(Menu.Item, { title: "Action 4" })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
32
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"menu-with-divider.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-divider.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;oBACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC9C,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,IACnB,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(event, data) => {\n console.info('onClose callback', event, data);\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item title=\"Action 1\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 2\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 3\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 4\" />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-with-divider.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-divider.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,EAC9B,KAAC,IAAI,CAAC,OAAO,KAAG,EAChB,KAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,UAAU,GAAG,IACnB,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item title=\"Action 1\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 2\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 3\" />\n <Menu.Divider />\n <Menu.Item title=\"Action 4\" />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -26,7 +26,9 @@ import { useRef, useState } from 'react';
26
26
  const Component = () => {
27
27
  const anchorEl = useRef(null);
28
28
  const [isOpen, setIsOpen] = useState(false);
29
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: () => setIsOpen(false), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 1", onClick: () => alert('Action1') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 2", onClick: () => alert('Action2') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 3", description: "Action 3 is disabled", isDisabled: true, onClick: () => alert('Action3') }), _jsx(Menu, { title: "Action 3.1", description: "Action with sub menu", icon: _jsx(PlusIconOutline, {}), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Text" }), _jsx(Menu.Item, { title: "Video" }), _jsx(Menu, { title: "Image", icon: _jsx(PhotoIconOutline, {}), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: ".png" }), _jsx(Menu.Item, { title: ".jpg" })] }) }), _jsx(Menu.Item, { title: "Audio" })] }) }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 4", description: "Action 4 is awesome", onClick: () => alert('Action4') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
29
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (_event, _data) => {
30
+ setIsOpen(false);
31
+ }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 1", onClick: () => alert('Action1') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 2", onClick: () => alert('Action2') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 3", description: "Action 3 is disabled", isDisabled: true, onClick: () => alert('Action3') }), _jsx(Menu, { title: "Action 3.1", description: "Action with sub menu", icon: _jsx(PlusIconOutline, {}), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: "Text" }), _jsx(Menu.Item, { title: "Video" }), _jsx(Menu, { title: "Image", icon: _jsx(PhotoIconOutline, {}), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { title: ".png" }), _jsx(Menu.Item, { title: ".jpg" })] }) }), _jsx(Menu.Item, { title: "Audio" })] }) }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 4", description: "Action 4 is awesome", onClick: () => alert('Action4') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
30
32
  };
31
33
  export default Component;
32
34
  //# sourceMappingURL=menu-with-icon.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-with-icon.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8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,GACR,EACP,KAAC,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,eAAe,KAAG,EAClC,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { PhotoIconOutline, PlusIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={() => setIsOpen(false)}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 1\"\n onClick={() => alert('Action1')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 2\"\n onClick={() => alert('Action2')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => alert('Action3')}\n />\n <Menu\n title=\"Action 3.1\"\n description=\"Action with sub menu\"\n icon={<PlusIconOutline />}\n >\n <Menu.Items>\n <Menu.Item title=\"Text\" />\n <Menu.Item title=\"Video\" />\n <Menu title=\"Image\" icon={<PhotoIconOutline />}>\n <Menu.Items>\n <Menu.Item title=\".png\" />\n <Menu.Item title=\".jpg\" />\n </Menu.Items>\n </Menu>\n <Menu.Item title=\"Audio\" />\n </Menu.Items>\n </Menu>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-with-icon.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAA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,WAAW,EAAC,qBAAqB,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Menu } from '@neo4j-ndl/react';\nimport { PhotoIconOutline, PlusIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 1\"\n onClick={() => alert('Action1')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 2\"\n onClick={() => alert('Action2')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 3\"\n description=\"Action 3 is disabled\"\n isDisabled={true}\n onClick={() => alert('Action3')}\n />\n <Menu\n title=\"Action 3.1\"\n description=\"Action with sub menu\"\n icon={<PlusIconOutline />}\n >\n <Menu.Items>\n <Menu.Item title=\"Text\" />\n <Menu.Item title=\"Video\" />\n <Menu title=\"Image\" icon={<PhotoIconOutline />}>\n <Menu.Items>\n <Menu.Item title=\".png\" />\n <Menu.Item title=\".jpg\" />\n </Menu.Items>\n </Menu>\n <Menu.Item title=\"Audio\" />\n </Menu.Items>\n </Menu>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 4\"\n description=\"Action 4 is awesome\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -26,7 +26,9 @@ import { useRef, useState } from 'react';
26
26
  const Component = () => {
27
27
  const anchorEl = useRef(null);
28
28
  const [isOpen, setIsOpen] = useState(false);
29
- return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: () => setIsOpen(false), children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 1", onClick: () => alert('Action1') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), trailingContent: _jsx(Kbd, { keys: ['A', ['B']] }), title: "Action 2", description: "Action 4 has a keyboard shortcut", onClick: () => alert('Action4') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
29
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { isOpen: isOpen, anchorRef: anchorEl, onClose: (_event, _data) => {
30
+ setIsOpen(false);
31
+ }, children: _jsxs(Menu.Items, { children: [_jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), title: "Action 1", onClick: () => alert('Action1') }), _jsx(Menu.Item, { leadingVisual: _jsx(PlusIconOutline, {}), trailingContent: _jsx(Kbd, { keys: ['A', ['B']] }), title: "Action 2", description: "Action 4 has a keyboard shortcut", onClick: () => alert('Action4') })] }) }), _jsx(FilledButton, { onClick: () => setIsOpen(true), ref: anchorEl, children: "Open Menu" })] }));
30
32
  };
31
33
  export default Component;
32
34
  //# sourceMappingURL=menu-with-keyboard-shortcuts.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-with-keyboard-shortcuts.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-keyboard-shortcuts.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,YAE/B,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,eAAe,KAAG,EAClC,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,EACF,KAAC,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,eAAe,KAAG,EAClC,eAAe,EAAE,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAI,EAC5C,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,kCAAkC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Kbd, Menu } from '@neo4j-ndl/react';\nimport { PlusIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={() => setIsOpen(false)}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 1\"\n onClick={() => alert('Action1')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n trailingContent={<Kbd keys={['A', ['B']]} />}\n title=\"Action 2\"\n description=\"Action 4 has a keyboard shortcut\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"menu-with-keyboard-shortcuts.story.js","sourceRoot":"","sources":["../../../../src/menu/stories/menu-with-keyboard-shortcuts.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,8BACE,KAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,YAED,MAAC,IAAI,CAAC,KAAK,eACT,KAAC,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,eAAe,KAAG,EAClC,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,EACF,KAAC,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,eAAe,KAAG,EAClC,eAAe,EAAE,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAI,EAC5C,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,kCAAkC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAC/B,IACS,GACR,EACP,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,0BAE5C,IACd,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, Kbd, Menu } from '@neo4j-ndl/react';\nimport { PlusIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const anchorEl = useRef<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <Menu\n isOpen={isOpen}\n anchorRef={anchorEl}\n onClose={(_event, _data) => {\n setIsOpen(false);\n }}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n title=\"Action 1\"\n onClick={() => alert('Action1')}\n />\n <Menu.Item\n leadingVisual={<PlusIconOutline />}\n trailingContent={<Kbd keys={['A', ['B']]} />}\n title=\"Action 2\"\n description=\"Action 4 has a keyboard shortcut\"\n onClick={() => alert('Action4')}\n />\n </Menu.Items>\n </Menu>\n <FilledButton onClick={() => setIsOpen(true)} ref={anchorEl}>\n Open Menu\n </FilledButton>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -39,18 +39,18 @@ import { useNeedleTheme } from '../theme/ThemeProvider';
39
39
  import { usePopover } from './use-popover';
40
40
  import { usePatchFloatingFocusGuards } from './usePatchFloatingFocusGuards';
41
41
  export const placementTranslation = {
42
+ 'bottom-end-bottom-start': 'right-end',
42
43
  'bottom-end-top-end': 'bottom-end',
43
- 'bottom-start-top-start': 'bottom-start',
44
44
  'bottom-middle-top-middle': 'bottom',
45
- 'top-end-bottom-end': 'top-end',
46
- 'top-start-bottom-start': 'top-start',
47
- 'top-middle-bottom-middle': 'top',
48
45
  'bottom-start-bottom-end': 'left-end',
49
- 'top-start-top-end': 'left-start',
46
+ 'bottom-start-top-start': 'bottom-start',
47
+ 'middle-end-middle-start': 'right',
50
48
  'middle-start-middle-end': 'left',
51
- 'bottom-end-bottom-start': 'right-end',
49
+ 'top-end-bottom-end': 'top-end',
52
50
  'top-end-top-start': 'right-start',
53
- 'middle-end-middle-start': 'right',
51
+ 'top-middle-bottom-middle': 'top',
52
+ 'top-start-bottom-start': 'top-start',
53
+ 'top-start-top-end': 'left-start',
54
54
  };
55
55
  const PopoverContext = React.createContext(null);
56
56
  export const usePopoverContext = () => {
@@ -66,19 +66,19 @@ const PopoverComponent = ({ children, anchorElement, placement, isOpen, offset,
66
66
  const hasAnchorPortal = isInsideDialog;
67
67
  const isPortaled = !isInsideDialog;
68
68
  const popover = usePopover({
69
- placement: placement ? placementTranslation[placement] : undefined,
70
- isOpen: isOpen,
71
- offsetOption: offset,
72
69
  anchorElement: anchorElement,
73
70
  anchorElementAsPortalAnchor: hasAnchorPortalProp !== null && hasAnchorPortalProp !== void 0 ? hasAnchorPortalProp : hasAnchorPortal,
74
71
  anchorPosition,
75
- onOpenChange: onOpenChange,
76
- shouldCaptureFocus: shouldCaptureFocus,
72
+ closeOnClickOutside,
77
73
  initialFocus,
74
+ isOpen: isOpen,
75
+ isPortaled: isPortaledProp !== null && isPortaledProp !== void 0 ? isPortaledProp : isPortaled,
76
+ offsetOption: offset,
77
+ onOpenChange: onOpenChange,
78
+ placement: placement ? placementTranslation[placement] : undefined,
78
79
  role,
79
- closeOnClickOutside,
80
+ shouldCaptureFocus: shouldCaptureFocus,
80
81
  strategy: strategyProp !== null && strategyProp !== void 0 ? strategyProp : strategy,
81
- isPortaled: isPortaledProp !== null && isPortaledProp !== void 0 ? isPortaledProp : isPortaled,
82
82
  });
83
83
  return (_jsx(PopoverContext.Provider, { value: popover, children: children }));
84
84
  };
@@ -86,7 +86,7 @@ const PopoverTrigger = (_a) => {
86
86
  var { children, hasButtonWrapper = false, ref } = _a, props = __rest(_a, ["children", "hasButtonWrapper", "ref"]);
87
87
  const context = usePopoverContext();
88
88
  // Example from floating UI
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
90
90
  const childrenProps = children.props;
91
91
  const mergedRefs = useMergeRefs([
92
92
  context.refs.setReference,
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,oBAAoB,EACpB,cAAc,EAGd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAgB5E,MAAM,CAAC,MAAM,oBAAoB,GAAwC;IACvE,oBAAoB,EAAE,YAAY;IAClC,wBAAwB,EAAE,cAAc;IACxC,0BAA0B,EAAE,QAAQ;IACpC,oBAAoB,EAAE,SAAS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OAA8B;oBACxD,CAAC,CAAC,SAAS,YAGd,YAAY,GACE,CAClB,CAAA;SAAA,YAED,KAAC,oBAAoB,IACnB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,OAAO,CAAC,kBAAkB,EACjC,YAAY,EAAE,OAAO,CAAC,YAAY,YAElC,KAAC,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;AAEH,OAAO,EAAE,OAAO,EAAE,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 {\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"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,oBAAoB,EACpB,cAAc,EAGd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAgB5E,MAAM,CAAC,MAAM,oBAAoB,GAAwC;IACvE,yBAAyB,EAAE,WAAW;IACtC,oBAAoB,EAAE,YAAY;IAClC,0BAA0B,EAAE,QAAQ;IACpC,yBAAyB,EAAE,UAAU;IACrC,wBAAwB,EAAE,cAAc;IACxC,yBAAyB,EAAE,OAAO;IAClC,yBAAyB,EAAE,MAAM;IACjC,oBAAoB,EAAE,SAAS;IAC/B,mBAAmB,EAAE,aAAa;IAClC,0BAA0B,EAAE,KAAK;IACjC,wBAAwB,EAAE,WAAW;IACrC,mBAAmB,EAAE,YAAY;CAClC,CAAC;AA4CF,MAAM,cAAc,GAA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O,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;AAEH,OAAO,EAAE,OAAO,EAAE,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 {\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-bottom-start': 'right-end',\n 'bottom-end-top-end': 'bottom-end',\n 'bottom-middle-top-middle': 'bottom',\n 'bottom-start-bottom-end': 'left-end',\n 'bottom-start-top-start': 'bottom-start',\n 'middle-end-middle-start': 'right',\n 'middle-start-middle-end': 'left',\n 'top-end-bottom-end': 'top-end',\n 'top-end-top-start': 'right-start',\n 'top-middle-bottom-middle': 'top',\n 'top-start-bottom-start': 'top-start',\n 'top-start-top-end': 'left-start',\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 anchorElement: anchorElement,\n anchorElementAsPortalAnchor: hasAnchorPortalProp ?? hasAnchorPortal,\n anchorPosition,\n closeOnClickOutside,\n initialFocus,\n isOpen: isOpen,\n isPortaled: isPortaledProp ?? isPortaled,\n offsetOption: offset,\n onOpenChange: onOpenChange,\n placement: placement ? placementTranslation[placement] : undefined,\n role,\n shouldCaptureFocus: shouldCaptureFocus,\n strategy: strategyProp ?? strategy,\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 // oxlint-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"]}
@@ -29,12 +29,9 @@ export function usePopover({ isInitialOpen = false, placement = 'bottom', isOpen
29
29
  const isOpen = controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : isOpenUncontrolled;
30
30
  const setIsOpen = setControlledOpen !== null && setControlledOpen !== void 0 ? setControlledOpen : setIsOpenUncontrolled;
31
31
  const data = useFloating({
32
- open: isOpen,
33
- onOpenChange: (open, event) => {
34
- setIsOpen(open);
35
- setControlledOpen === null || setControlledOpen === void 0 ? void 0 : setControlledOpen(open, event);
32
+ elements: {
33
+ reference: anchorElement,
36
34
  },
37
- placement: placement,
38
35
  middleware: [
39
36
  offset(offsetOption),
40
37
  flip({
@@ -44,11 +41,14 @@ export function usePopover({ isInitialOpen = false, placement = 'bottom', isOpen
44
41
  }),
45
42
  shift({ padding: 5 }),
46
43
  ],
47
- elements: {
48
- reference: anchorElement,
44
+ onOpenChange: (open, event) => {
45
+ setIsOpen(open);
46
+ setControlledOpen === null || setControlledOpen === void 0 ? void 0 : setControlledOpen(open, event);
49
47
  },
50
- whileElementsMounted: autoUpdate,
48
+ open: isOpen,
49
+ placement: placement,
51
50
  strategy,
51
+ whileElementsMounted: autoUpdate,
52
52
  });
53
53
  const context = data.context;
54
54
  const click = useClick(context, {
@@ -61,9 +61,9 @@ export function usePopover({ isInitialOpen = false, placement = 'bottom', isOpen
61
61
  role: roleProp,
62
62
  });
63
63
  const clientPoint = useClientPoint(context, {
64
+ enabled: anchorPosition !== undefined,
64
65
  x: anchorPosition === null || anchorPosition === void 0 ? void 0 : anchorPosition.x,
65
66
  y: anchorPosition === null || anchorPosition === void 0 ? void 0 : anchorPosition.y,
66
- enabled: anchorPosition !== undefined,
67
67
  });
68
68
  const interactions = useInteractions([click, dismiss, role, clientPoint]);
69
69
  const { styles: transitionStyles } = useTransitionStyles(context, {
@@ -1 +1 @@
1
- {"version":3,"file":"use-popover.js","sourceRoot":"","sources":["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AM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,mCAAI,CAAC;KAC7D,CAAC,CAAC;IAEH,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,6CACJ,MAAM;QACN,SAAS,IACN,YAAY,GACZ,IAAI,KACP,gBAAgB;QAChB,OAAO;QACP,aAAa;QACb,UAAU;QACV,gBAAgB;QAChB,2BAA2B;QAC3B,kBAAkB;QAClB,YAAY;QACZ,UAAU,IACV,EACF;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,IAAI;QACJ,gBAAgB;QAChB,OAAO;QACP,aAAa;QACb,2BAA2B;QAC3B,kBAAkB;QAClB,YAAY;QACZ,UAAU;KACX,CACF,CAAC;AACJ,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 {\n autoUpdate,\n flip,\n offset,\n type OffsetOptions,\n type Placement,\n shift,\n useClick,\n useClientPoint,\n useDismiss,\n useFloating,\n useInteractions,\n type UseInteractionsReturn,\n useRole,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport { useMemo, useState } from 'react';\n\nexport interface PopoverOptions {\n isInitialOpen?: boolean;\n placement?: Placement;\n isOpen?: boolean;\n onOpenChange?: (open: boolean, event?: Event) => void;\n offsetOption?: OffsetOptions;\n anchorElement?: Element | null;\n anchorPosition?: {\n x: number;\n y: number;\n };\n anchorElementAsPortalAnchor?: boolean;\n shouldCaptureFocus?: boolean;\n initialFocus?: number | React.RefObject<HTMLElement | null>;\n role?:\n | 'tooltip'\n | 'dialog'\n | 'alertdialog'\n | 'menu'\n | 'listbox'\n | 'grid'\n | 'tree';\n closeOnClickOutside?: boolean;\n strategy?: 'fixed' | 'absolute';\n isPortaled?: boolean;\n}\n\nexport interface UsePopoverReturn\n extends UseInteractionsReturn,\n ReturnType<typeof useFloating> {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n labelId: string | undefined;\n descriptionId: string | undefined;\n transitionStyles: React.CSSProperties;\n setLabelId: (labelId: string | undefined) => void;\n setDescriptionId: (descriptionId: string | undefined) => void;\n anchorElementAsPortalAnchor: boolean | undefined;\n shouldCaptureFocus: boolean | undefined;\n initialFocus: number | React.RefObject<HTMLElement | null> | undefined;\n isPortaled: boolean;\n}\n\nexport function usePopover({\n isInitialOpen = false,\n placement = 'bottom',\n isOpen: controlledOpen,\n onOpenChange: setControlledOpen,\n offsetOption = 10,\n anchorElement,\n anchorPosition,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n role: roleProp,\n closeOnClickOutside,\n strategy = 'absolute',\n isPortaled = true,\n}: PopoverOptions = {}): UsePopoverReturn {\n const [isOpenUncontrolled, setIsOpenUncontrolled] = useState(isInitialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n const isOpen = controlledOpen ?? isOpenUncontrolled;\n const setIsOpen = setControlledOpen ?? setIsOpenUncontrolled;\n const data = useFloating({\n open: isOpen,\n onOpenChange: (open, event) => {\n setIsOpen(open);\n setControlledOpen?.(open, event);\n },\n placement: placement,\n middleware: [\n offset(offsetOption),\n flip({\n crossAxis: placement.includes('-'),\n fallbackAxisSideDirection: 'end',\n padding: 5,\n }),\n shift({ padding: 5 }),\n ],\n elements: {\n reference: anchorElement,\n },\n whileElementsMounted: autoUpdate,\n strategy,\n });\n const context = data.context;\n\n const click = useClick(context, {\n enabled: controlledOpen === undefined,\n });\n\n const dismiss = useDismiss(context, {\n outsidePress: closeOnClickOutside,\n });\n const role = useRole(context, {\n role: roleProp,\n });\n\n const clientPoint = useClientPoint(context, {\n x: anchorPosition?.x,\n y: anchorPosition?.y,\n enabled: anchorPosition !== undefined,\n });\n\n const interactions = useInteractions([click, dismiss, role, clientPoint]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n return useMemo(\n () => ({\n isOpen,\n setIsOpen,\n ...interactions,\n ...data,\n transitionStyles,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n }),\n [\n isOpen,\n setIsOpen,\n interactions,\n data,\n transitionStyles,\n labelId,\n descriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n ],\n );\n}\n"]}
1
+ {"version":3,"file":"use-popover.js","sourceRoot":"","sources":["../../../src/popover/use-popover.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,MAAM,EAGN,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EAEf,OAAO,EACP,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA6C1C,MAAM,UAAU,UAAU,CAAC,EACzB,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,QAAQ,EACpB,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,iBAAiB,EAC/B,YAAY,GAAG,EAAE,EACjB,aAAa,EACb,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,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AM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE;QAClC,YAAY,EAAE,mBAAmB;KAClC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE;QAC5B,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE;QAC1C,OAAO,EAAE,cAAc,KAAK,SAAS;QACrC,CAAC,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,CAAC;QACpB,CAAC,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,CAAC;KACrB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1E,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,mBAAmB,CAAC,OAAO,EAAE;QAChE,QAAQ,EAAE,MAAA,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,mCAAI,CAAC;KAC7D,CAAC,CAAC;IAEH,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,6CACJ,MAAM;QACN,SAAS,IACN,YAAY,GACZ,IAAI,KACP,gBAAgB;QAChB,OAAO;QACP,aAAa;QACb,UAAU;QACV,gBAAgB;QAChB,2BAA2B;QAC3B,kBAAkB;QAClB,YAAY;QACZ,UAAU,IACV,EACF;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,IAAI;QACJ,gBAAgB;QAChB,OAAO;QACP,aAAa;QACb,2BAA2B;QAC3B,kBAAkB;QAClB,YAAY;QACZ,UAAU;KACX,CACF,CAAC;AACJ,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 {\n autoUpdate,\n flip,\n offset,\n type OffsetOptions,\n type Placement,\n shift,\n useClick,\n useClientPoint,\n useDismiss,\n useFloating,\n useInteractions,\n type UseInteractionsReturn,\n useRole,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport { useMemo, useState } from 'react';\n\nexport interface PopoverOptions {\n isInitialOpen?: boolean;\n placement?: Placement;\n isOpen?: boolean;\n onOpenChange?: (open: boolean, event?: Event) => void;\n offsetOption?: OffsetOptions;\n anchorElement?: Element | null;\n anchorPosition?: {\n x: number;\n y: number;\n };\n anchorElementAsPortalAnchor?: boolean;\n shouldCaptureFocus?: boolean;\n initialFocus?: number | React.RefObject<HTMLElement | null>;\n role?:\n | 'tooltip'\n | 'dialog'\n | 'alertdialog'\n | 'menu'\n | 'listbox'\n | 'grid'\n | 'tree';\n closeOnClickOutside?: boolean;\n strategy?: 'fixed' | 'absolute';\n isPortaled?: boolean;\n}\n\nexport interface UsePopoverReturn\n extends UseInteractionsReturn,\n ReturnType<typeof useFloating> {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n labelId: string | undefined;\n descriptionId: string | undefined;\n transitionStyles: React.CSSProperties;\n setLabelId: (labelId: string | undefined) => void;\n setDescriptionId: (descriptionId: string | undefined) => void;\n anchorElementAsPortalAnchor: boolean | undefined;\n shouldCaptureFocus: boolean | undefined;\n initialFocus: number | React.RefObject<HTMLElement | null> | undefined;\n isPortaled: boolean;\n}\n\nexport function usePopover({\n isInitialOpen = false,\n placement = 'bottom',\n isOpen: controlledOpen,\n onOpenChange: setControlledOpen,\n offsetOption = 10,\n anchorElement,\n anchorPosition,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n role: roleProp,\n closeOnClickOutside,\n strategy = 'absolute',\n isPortaled = true,\n}: PopoverOptions = {}): UsePopoverReturn {\n const [isOpenUncontrolled, setIsOpenUncontrolled] = useState(isInitialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n const isOpen = controlledOpen ?? isOpenUncontrolled;\n const setIsOpen = setControlledOpen ?? setIsOpenUncontrolled;\n const data = useFloating({\n elements: {\n reference: anchorElement,\n },\n middleware: [\n offset(offsetOption),\n flip({\n crossAxis: placement.includes('-'),\n fallbackAxisSideDirection: 'end',\n padding: 5,\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open, event) => {\n setIsOpen(open);\n setControlledOpen?.(open, event);\n },\n open: isOpen,\n placement: placement,\n strategy,\n whileElementsMounted: autoUpdate,\n });\n const context = data.context;\n\n const click = useClick(context, {\n enabled: controlledOpen === undefined,\n });\n\n const dismiss = useDismiss(context, {\n outsidePress: closeOnClickOutside,\n });\n const role = useRole(context, {\n role: roleProp,\n });\n\n const clientPoint = useClientPoint(context, {\n enabled: anchorPosition !== undefined,\n x: anchorPosition?.x,\n y: anchorPosition?.y,\n });\n\n const interactions = useInteractions([click, dismiss, role, clientPoint]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n return useMemo(\n () => ({\n isOpen,\n setIsOpen,\n ...interactions,\n ...data,\n transitionStyles,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n }),\n [\n isOpen,\n setIsOpen,\n interactions,\n data,\n transitionStyles,\n labelId,\n descriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n ],\n );\n}\n"]}
@@ -24,15 +24,15 @@ import { ProgressBar } from '../../index';
24
24
  import { ProgressBarDefault, ProgressBarDefaultSource, ProgressBarHeading, ProgressBarHeadingSource, ProgressBarSizes, ProgressBarSizesSource, } from '.';
25
25
  const componentMeta = {
26
26
  component: ProgressBar,
27
+ decorators: [
28
+ (Story) => (_jsx("div", { className: "n-max-w-96 n-mx-auto", children: _jsx(Story, {}) })),
29
+ ],
27
30
  id: 'components-progress-bar',
28
31
  parameters: {
29
32
  controls: { disable: true },
30
33
  },
31
34
  tags: ['docsPage'],
32
35
  title: 'Components/ProgressBar',
33
- decorators: [
34
- (Story) => (_jsx("div", { className: "n-max-w-96 n-mx-auto", children: _jsx(Story, {}) })),
35
- ],
36
36
  };
37
37
  export default componentMeta;
38
38
  export const Default = {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.stories.js","sourceRoot":"","sources":["../../../../src/progress-bar/stories/progress-bar.stories.tsx"],"names":[],"mappings":";AAuBA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,GAAG,CAAC;AAEX,MAAM,aAAa,GAA6B;IAC9C,SAAS,EAAE,WAAW;IACtB,EAAE,EAAE,yBAAyB;IAC7B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,KAAK,KAAG,GACL,CACP;KACF;CACF,CAAC;AAEF,eAAe,aAAa,CAAC;AAG7B,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAgB;CACzB,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { ProgressBar } from '../../index';\nimport {\n ProgressBarDefault,\n ProgressBarDefaultSource,\n ProgressBarHeading,\n ProgressBarHeadingSource,\n ProgressBarSizes,\n ProgressBarSizesSource,\n} from '.';\n\nconst componentMeta: Meta<typeof ProgressBar> = {\n component: ProgressBar,\n id: 'components-progress-bar',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/ProgressBar',\n decorators: [\n (Story) => (\n <div className=\"n-max-w-96 n-mx-auto\">\n <Story />\n </div>\n ),\n ],\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: ProgressBarDefaultSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarDefault,\n};\n\nexport const Heading: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ProgressBarHeadingSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarHeading,\n};\n\nexport const Sizes: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ProgressBarSizesSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarSizes,\n};\n"]}
1
+ {"version":3,"file":"progress-bar.stories.js","sourceRoot":"","sources":["../../../../src/progress-bar/stories/progress-bar.stories.tsx"],"names":[],"mappings":";AAuBA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,GAAG,CAAC;AAEX,MAAM,aAAa,GAA6B;IAC9C,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,KAAK,KAAG,GACL,CACP;KACF;IACD,EAAE,EAAE,yBAAyB;IAC7B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,wBAAwB;CAChC,CAAC;AAEF,eAAe,aAAa,CAAC;AAG7B,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAgB;CACzB,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { ProgressBar } from '../../index';\nimport {\n ProgressBarDefault,\n ProgressBarDefaultSource,\n ProgressBarHeading,\n ProgressBarHeadingSource,\n ProgressBarSizes,\n ProgressBarSizesSource,\n} from '.';\n\nconst componentMeta: Meta<typeof ProgressBar> = {\n component: ProgressBar,\n decorators: [\n (Story) => (\n <div className=\"n-max-w-96 n-mx-auto\">\n <Story />\n </div>\n ),\n ],\n id: 'components-progress-bar',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/ProgressBar',\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: ProgressBarDefaultSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarDefault,\n};\n\nexport const Heading: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ProgressBarHeadingSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarHeading,\n};\n\nexport const Sizes: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ProgressBarSizesSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ProgressBarSizes,\n};\n"]}
@@ -35,7 +35,7 @@ import React, { useContext } from 'react';
35
35
  import { Tooltip } from '../tooltip/Tooltip';
36
36
  // eslint-disable-next-line no-redeclare
37
37
  const SegmentedControlContext =
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
39
39
  React.createContext(null);
40
40
  const useSelectorContext = () => {
41
41
  const context = useContext(SegmentedControlContext);
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../../src/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAyB7C,wCAAwC;AACxC,MAAM,uBAAuB;AAC3B,8DAA8D;AAC9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ACX,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE;IAChE,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,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 classNames from 'classnames';\nimport React, { useContext } from 'react';\n\nimport {\n type PolymorphicCommonProps,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { Tooltip } from '../tooltip/Tooltip';\n\ntype SegmentedControlID = string | number;\n\ntype SegmentedControlProps<T extends SegmentedControlID> = {\n /** Additional class name */\n className?: string;\n /** Size of the segmented control */\n size?: 'small' | 'medium' | 'large';\n /** If segmented control items will include only icons (makes controls rectangular) */\n hasOnlyIcons?: boolean;\n /** The callback function triggered when the segmented control value changes */\n onChange: (e: T) => void | ((e: React.SetStateAction<T>) => void);\n /** The currently selected option */\n selected: T;\n /** The children component of the segmented control */\n children: React.ReactNode;\n /** Whether the segmented control has a box shadow applied */\n isFloating?: boolean;\n};\n\ntype SegmentedControlContext<T extends SegmentedControlID> = Required<\n Pick<SegmentedControlProps<T>, 'onChange' | 'selected' | 'hasOnlyIcons'>\n>;\n\n// eslint-disable-next-line no-redeclare\nconst SegmentedControlContext =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n React.createContext<SegmentedControlContext<any> | null>(null);\n\nconst useSelectorContext = () => {\n const context = useContext(SegmentedControlContext);\n\n if (context === null) {\n throw new Error('SegmentedControl used without context');\n }\n\n return context;\n};\n\nconst SegmentedControlComponent = <\n T extends SegmentedControlID,\n U extends React.ElementType = 'div',\n>({\n size = 'medium',\n hasOnlyIcons = false,\n children,\n selected,\n onChange,\n as,\n className,\n style,\n isFloating = false,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, SegmentedControlProps<T>>) => {\n const classes = classNames('ndl-segmented-control', className, {\n 'ndl-floating': isFloating,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const Component = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n role=\"group\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SegmentedControlContext.Provider\n value={{ hasOnlyIcons, onChange, selected }}\n >\n {children}\n </SegmentedControlContext.Provider>\n </Component>\n );\n};\n\nSegmentedControlComponent.displayName = 'SegmentedControl';\n\ntype SegmentedControlItemProps = {\n /** Additional class name */\n className?: string;\n /** The children component of the segmented control item */\n children?: React.ReactNode;\n /** The value of the segmented control item */\n value: string;\n /** The description of the segmented control item, will be displayed in the tooltip */\n description?: string;\n /** The tooltip props that will be applied if tooltip is set */\n tooltipProps?: TooltipObjectProps;\n /** Whether the segmented control item is disabled */\n isDisabled?: boolean;\n};\n\nconst SegmentedControlItem = <T extends React.ElementType = 'button'>({\n as,\n children,\n className,\n style,\n value,\n htmlAttributes,\n description,\n tooltipProps,\n isDisabled = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SegmentedControlItemProps>) => {\n const { onChange, selected, hasOnlyIcons } = useSelectorContext();\n\n const isSelected = value === selected;\n\n const baseClasses = classNames(className, {\n 'ndl-current': isSelected,\n 'ndl-segment-icon': hasOnlyIcons,\n 'ndl-segment-item': !hasOnlyIcons,\n });\n\n const Component: React.ElementType = as ?? 'button';\n\n return (\n <Tooltip\n isPortaled={false}\n isDisabled={Boolean(description) === false}\n {...tooltipProps?.root}\n type=\"simple\"\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <Component\n onClick={() => !isSelected && onChange(value)}\n className={baseClasses}\n style={style}\n ref={ref}\n aria-label={description}\n disabled={isDisabled}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n <Tooltip.Body>{description}</Tooltip.Body>\n </Tooltip.Content>\n </Tooltip>\n );\n};\n\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nconst SegmentedControl = Object.assign(SegmentedControlComponent, {\n Item: SegmentedControlItem,\n});\n\nexport { SegmentedControl };\n"]}
1
+ {"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../../src/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAyB7C,wCAAwC;AACxC,MAAM,uBAAuB;AAC3B,8DAA8D;AAC9D,KAAK,CAAC,aAAa,CAAsC,IAAI,CAAC,CAAC;AAEjE,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAEpD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAGhC,EAaoD,EAAE,EAAE;QAbxD,EACA,IAAI,GAAG,QAAQ,EACf,YAAY,GAAG,KAAK,EACpB,Q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kB,EAAE,YAAY;QAChC,kBAAkB,EAAE,CAAC,YAAY;KAClC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,QAAQ,CAAC;IAEpD,OAAO,CACL,MAAC,OAAO,kBACN,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,KAAK,IACtC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,IACtB,IAAI,EAAC,QAAQ,aAEb,KAAC,OAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,IAAE,gBAAgB,kBAC1D,KAAC,SAAS,kBACR,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,EAC7C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,gBACI,WAAW,EACvB,QAAQ,EAAE,UAAU,IAChB,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,IACI,EAClB,KAAC,OAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACxC,KAAC,OAAO,CAAC,IAAI,cAAE,WAAW,GAAgB,IAC1B,KACV,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE;IAChE,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,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 classNames from 'classnames';\nimport React, { useContext } from 'react';\n\nimport {\n type PolymorphicCommonProps,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { Tooltip } from '../tooltip/Tooltip';\n\ntype SegmentedControlID = string | number;\n\ntype SegmentedControlProps<T extends SegmentedControlID> = {\n /** Additional class name */\n className?: string;\n /** Size of the segmented control */\n size?: 'small' | 'medium' | 'large';\n /** If segmented control items will include only icons (makes controls rectangular) */\n hasOnlyIcons?: boolean;\n /** The callback function triggered when the segmented control value changes */\n onChange: (e: T) => void | ((e: React.SetStateAction<T>) => void);\n /** The currently selected option */\n selected: T;\n /** The children component of the segmented control */\n children: React.ReactNode;\n /** Whether the segmented control has a box shadow applied */\n isFloating?: boolean;\n};\n\ntype SegmentedControlContext<T extends SegmentedControlID> = Required<\n Pick<SegmentedControlProps<T>, 'onChange' | 'selected' | 'hasOnlyIcons'>\n>;\n\n// eslint-disable-next-line no-redeclare\nconst SegmentedControlContext =\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n React.createContext<SegmentedControlContext<any> | null>(null);\n\nconst useSelectorContext = () => {\n const context = useContext(SegmentedControlContext);\n\n if (context === null) {\n throw new Error('SegmentedControl used without context');\n }\n\n return context;\n};\n\nconst SegmentedControlComponent = <\n T extends SegmentedControlID,\n U extends React.ElementType = 'div',\n>({\n size = 'medium',\n hasOnlyIcons = false,\n children,\n selected,\n onChange,\n as,\n className,\n style,\n isFloating = false,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, SegmentedControlProps<T>>) => {\n const classes = classNames('ndl-segmented-control', className, {\n 'ndl-floating': isFloating,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const Component = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n role=\"group\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SegmentedControlContext.Provider\n value={{ hasOnlyIcons, onChange, selected }}\n >\n {children}\n </SegmentedControlContext.Provider>\n </Component>\n );\n};\n\nSegmentedControlComponent.displayName = 'SegmentedControl';\n\ntype SegmentedControlItemProps = {\n /** Additional class name */\n className?: string;\n /** The children component of the segmented control item */\n children?: React.ReactNode;\n /** The value of the segmented control item */\n value: string;\n /** The description of the segmented control item, will be displayed in the tooltip */\n description?: string;\n /** The tooltip props that will be applied if tooltip is set */\n tooltipProps?: TooltipObjectProps;\n /** Whether the segmented control item is disabled */\n isDisabled?: boolean;\n};\n\nconst SegmentedControlItem = <T extends React.ElementType = 'button'>({\n as,\n children,\n className,\n style,\n value,\n htmlAttributes,\n description,\n tooltipProps,\n isDisabled = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SegmentedControlItemProps>) => {\n const { onChange, selected, hasOnlyIcons } = useSelectorContext();\n\n const isSelected = value === selected;\n\n const baseClasses = classNames(className, {\n 'ndl-current': isSelected,\n 'ndl-segment-icon': hasOnlyIcons,\n 'ndl-segment-item': !hasOnlyIcons,\n });\n\n const Component: React.ElementType = as ?? 'button';\n\n return (\n <Tooltip\n isPortaled={false}\n isDisabled={Boolean(description) === false}\n {...tooltipProps?.root}\n type=\"simple\"\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <Component\n onClick={() => !isSelected && onChange(value)}\n className={baseClasses}\n style={style}\n ref={ref}\n aria-label={description}\n disabled={isDisabled}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n <Tooltip.Body>{description}</Tooltip.Body>\n </Tooltip.Content>\n </Tooltip>\n );\n};\n\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nconst SegmentedControl = Object.assign(SegmentedControlComponent, {\n Item: SegmentedControlItem,\n});\n\nexport { SegmentedControl };\n"]}