@neo4j-ndl/react 4.1.5 → 4.1.7

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 (525) hide show
  1. package/lib/cjs/_common/CodeBlockWrapper.js +5 -4
  2. package/lib/cjs/_common/CodeBlockWrapper.js.map +1 -1
  3. package/lib/cjs/_common/utils.js +4 -2
  4. package/lib/cjs/_common/utils.js.map +1 -1
  5. package/lib/cjs/accordion/Accordion.js +9 -6
  6. package/lib/cjs/accordion/Accordion.js.map +1 -1
  7. package/lib/cjs/accordion/accordion-types.js.map +1 -1
  8. package/lib/cjs/accordion/stories/accordion.stories.js +1 -1
  9. package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
  10. package/lib/cjs/avatar/Avatar.js +1 -1
  11. package/lib/cjs/avatar/Avatar.js.map +1 -1
  12. package/lib/cjs/banner/Banner.js +3 -2
  13. package/lib/cjs/banner/Banner.js.map +1 -1
  14. package/lib/cjs/banner/stories/banner.stories.js +1 -1
  15. package/lib/cjs/banner/stories/banner.stories.js.map +1 -1
  16. package/lib/cjs/box/Box.js +14 -2
  17. package/lib/cjs/box/Box.js.map +1 -1
  18. package/lib/cjs/box/stories/box.stories.js +2 -2
  19. package/lib/cjs/box/stories/box.stories.js.map +1 -1
  20. package/lib/cjs/breadcrumbs/Breadcrumbs.js +10 -7
  21. package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -1
  22. package/lib/cjs/button/stories/button.stories.js +2 -2
  23. package/lib/cjs/button/stories/button.stories.js.map +1 -1
  24. package/lib/cjs/checkbox/Checkbox.js +2 -1
  25. package/lib/cjs/checkbox/Checkbox.js.map +1 -1
  26. package/lib/cjs/checkbox/stories/checkbox.stories.js +1 -1
  27. package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
  28. package/lib/cjs/clipboard-button/ClipboardButton.js +6 -3
  29. package/lib/cjs/clipboard-button/ClipboardButton.js.map +1 -1
  30. package/lib/cjs/color-picker/ColorPicker.js +2 -1
  31. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  32. package/lib/cjs/data-grid/Components.js +9 -6
  33. package/lib/cjs/data-grid/Components.js.map +1 -1
  34. package/lib/cjs/data-grid/DataGrid.js +16 -4
  35. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  36. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js +28 -14
  37. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  38. package/lib/cjs/data-grid/data-grid-nav/helpers.js +2 -1
  39. package/lib/cjs/data-grid/data-grid-nav/helpers.js.map +1 -1
  40. package/lib/cjs/data-grid/stories/datagrid-component-overriding.story.js +1 -3
  41. package/lib/cjs/data-grid/stories/datagrid-component-overriding.story.js.map +1 -1
  42. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js +2 -1
  43. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  44. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js +2 -1
  45. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  46. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -2
  47. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  48. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +13 -10
  49. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  50. package/lib/cjs/date-picker/DatePicker.js +2 -1
  51. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  52. package/lib/cjs/date-picker/stories/date-picker-range.story.js +1 -1
  53. package/lib/cjs/date-picker/stories/date-picker-range.story.js.map +1 -1
  54. package/lib/cjs/date-picker/stories/date-picker.stories.js +1 -1
  55. package/lib/cjs/date-picker/stories/date-picker.stories.js.map +1 -1
  56. package/lib/cjs/dialog/Dialog.js +20 -13
  57. package/lib/cjs/dialog/Dialog.js.map +1 -1
  58. package/lib/cjs/dialog/dialog-context.js +35 -6
  59. package/lib/cjs/dialog/dialog-context.js.map +1 -1
  60. package/lib/cjs/dialog/stories/dialog.stories.js +1 -1
  61. package/lib/cjs/dialog/stories/dialog.stories.js.map +1 -1
  62. package/lib/cjs/divider/stories/divider.stories.js +1 -1
  63. package/lib/cjs/divider/stories/divider.stories.js.map +1 -1
  64. package/lib/cjs/drawer/Drawer.js +9 -8
  65. package/lib/cjs/drawer/Drawer.js.map +1 -1
  66. package/lib/cjs/dropdown-button/DropdownButton.js +14 -2
  67. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  68. package/lib/cjs/dropzone/Dropzone.js +3 -2
  69. package/lib/cjs/dropzone/Dropzone.js.map +1 -1
  70. package/lib/cjs/dropzone/stories/dropzone-csv-files.story.js +1 -3
  71. package/lib/cjs/dropzone/stories/dropzone-csv-files.story.js.map +1 -1
  72. package/lib/cjs/dropzone/stories/dropzone-custom-extensions.story.js +1 -3
  73. package/lib/cjs/dropzone/stories/dropzone-custom-extensions.story.js.map +1 -1
  74. package/lib/cjs/dropzone/stories/dropzone-default.story.js +1 -3
  75. package/lib/cjs/dropzone/stories/dropzone-default.story.js.map +1 -1
  76. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -3
  77. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  78. package/lib/cjs/flex/Flex.js +14 -2
  79. package/lib/cjs/flex/Flex.js.map +1 -1
  80. package/lib/cjs/graph-label/GraphLabel.js +18 -4
  81. package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
  82. package/lib/cjs/icon-button/stories/icon-button.stories.js +1 -1
  83. package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
  84. package/lib/cjs/icon-button-array/IconButtonArray.js +14 -2
  85. package/lib/cjs/icon-button-array/IconButtonArray.js.map +1 -1
  86. package/lib/cjs/icon-button-array/index.js +1 -1
  87. package/lib/cjs/icon-button-array/index.js.map +1 -1
  88. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +1 -1
  89. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  90. package/lib/cjs/icons/wrapIcon.js +1 -1
  91. package/lib/cjs/icons/wrapIcon.js.map +1 -1
  92. package/lib/cjs/inline-edit/InlineEdit.js +18 -6
  93. package/lib/cjs/inline-edit/InlineEdit.js.map +1 -1
  94. package/lib/cjs/kbd/Kbd.js +5 -3
  95. package/lib/cjs/kbd/Kbd.js.map +1 -1
  96. package/lib/cjs/kbd/stories/kbd.stories.js +1 -1
  97. package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
  98. package/lib/cjs/loading-bar/LoadingBar.js +14 -2
  99. package/lib/cjs/loading-bar/LoadingBar.js.map +1 -1
  100. package/lib/cjs/loading-spinner/LoadingSpinner.js +1 -1
  101. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
  102. package/lib/cjs/logo/stories/logo.stories.js +1 -1
  103. package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
  104. package/lib/cjs/menu/Menu.js +9 -6
  105. package/lib/cjs/menu/Menu.js.map +1 -1
  106. package/lib/cjs/popover/Popover.js +6 -4
  107. package/lib/cjs/popover/Popover.js.map +1 -1
  108. package/lib/cjs/popover/stories/popover-custom-offset.story.js +2 -1
  109. package/lib/cjs/popover/stories/popover-custom-offset.story.js.map +1 -1
  110. package/lib/cjs/popover/stories/popover-separate-anchor.story.js +1 -1
  111. package/lib/cjs/popover/stories/popover-separate-anchor.story.js.map +1 -1
  112. package/lib/cjs/progress-bar/ProgressBar.js +1 -1
  113. package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
  114. package/lib/cjs/radio/Radio.js +2 -1
  115. package/lib/cjs/radio/Radio.js.map +1 -1
  116. package/lib/cjs/radio/stories/radio.stories.js +1 -1
  117. package/lib/cjs/radio/stories/radio.stories.js.map +1 -1
  118. package/lib/cjs/select/Overrides.js +1 -1
  119. package/lib/cjs/select/Overrides.js.map +1 -1
  120. package/lib/cjs/select/Select.js +18 -6
  121. package/lib/cjs/select/Select.js.map +1 -1
  122. package/lib/cjs/side-navigation/SideNavigation.js +5 -4
  123. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  124. package/lib/cjs/skeleton/Skeleton.js +14 -2
  125. package/lib/cjs/skeleton/Skeleton.js.map +1 -1
  126. package/lib/cjs/skeleton/stories/skeleton.stories.js +1 -1
  127. package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
  128. package/lib/cjs/spotlight/Spotlight.js +33 -14
  129. package/lib/cjs/spotlight/Spotlight.js.map +1 -1
  130. package/lib/cjs/spotlight/SpotlightProvider.js +6 -3
  131. package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -1
  132. package/lib/cjs/spotlight/SpotlightTarget.js +14 -2
  133. package/lib/cjs/spotlight/SpotlightTarget.js.map +1 -1
  134. package/lib/cjs/spotlight/SpotlightTour.js +1 -1
  135. package/lib/cjs/spotlight/SpotlightTour.js.map +1 -1
  136. package/lib/cjs/spotlight/stories/spotlight.stories.js +1 -1
  137. package/lib/cjs/spotlight/stories/spotlight.stories.js.map +1 -1
  138. package/lib/cjs/spotlight/use-indicator.js +2 -1
  139. package/lib/cjs/spotlight/use-indicator.js.map +1 -1
  140. package/lib/cjs/status-label/StatusLabel.js +1 -1
  141. package/lib/cjs/status-label/StatusLabel.js.map +1 -1
  142. package/lib/cjs/switch/Switch.js +2 -1
  143. package/lib/cjs/switch/Switch.js.map +1 -1
  144. package/lib/cjs/switch/stories/switch.stories.js +1 -1
  145. package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
  146. package/lib/cjs/tabs/stories/tabs-disabled.story.js +1 -1
  147. package/lib/cjs/tabs/stories/tabs-disabled.story.js.map +1 -1
  148. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js +1 -1
  149. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  150. package/lib/cjs/tabs/stories/tabs-overflow.story.js +1 -1
  151. package/lib/cjs/tabs/stories/tabs-overflow.story.js.map +1 -1
  152. package/lib/cjs/tabs/stories/tabs-sizes.story.js +1 -1
  153. package/lib/cjs/tabs/stories/tabs-sizes.story.js.map +1 -1
  154. package/lib/cjs/tabs/use-tabs-scroll-overflow.js +8 -4
  155. package/lib/cjs/tabs/use-tabs-scroll-overflow.js.map +1 -1
  156. package/lib/cjs/tag/Tag.js +14 -2
  157. package/lib/cjs/tag/Tag.js.map +1 -1
  158. package/lib/cjs/text-area/TextArea.js +14 -2
  159. package/lib/cjs/text-area/TextArea.js.map +1 -1
  160. package/lib/cjs/text-area/stories/text-area.stories.js +1 -1
  161. package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
  162. package/lib/cjs/text-input/TextInput.js +14 -2
  163. package/lib/cjs/text-input/TextInput.js.map +1 -1
  164. package/lib/cjs/text-link/TextLink.js +14 -2
  165. package/lib/cjs/text-link/TextLink.js.map +1 -1
  166. package/lib/cjs/text-overflow/TextOverflow.js +2 -1
  167. package/lib/cjs/text-overflow/TextOverflow.js.map +1 -1
  168. package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
  169. package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
  170. package/lib/cjs/text-overflow/text-overflow-utils.js +12 -6
  171. package/lib/cjs/text-overflow/text-overflow-utils.js.map +1 -1
  172. package/lib/cjs/text-overflow/use-ellipsis-observer.js +2 -1
  173. package/lib/cjs/text-overflow/use-ellipsis-observer.js.map +1 -1
  174. package/lib/cjs/text-overflow/use-truncate-with-button.js +4 -2
  175. package/lib/cjs/text-overflow/use-truncate-with-button.js.map +1 -1
  176. package/lib/cjs/theme/ThemeProvider.js +2 -1
  177. package/lib/cjs/theme/ThemeProvider.js.map +1 -1
  178. package/lib/cjs/time-picker/TimePicker.js +22 -8
  179. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  180. package/lib/cjs/time-picker/stories/time-picker.stories.js +1 -1
  181. package/lib/cjs/time-picker/stories/time-picker.stories.js.map +1 -1
  182. package/lib/cjs/timezone-picker/TimeZonePicker.js +8 -4
  183. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  184. package/lib/cjs/timezone-picker/generate-timezone-options.js +15 -9
  185. package/lib/cjs/timezone-picker/generate-timezone-options.js.map +1 -1
  186. package/lib/cjs/timezone-picker/stories/timezone-picker.stories.js +1 -1
  187. package/lib/cjs/timezone-picker/stories/timezone-picker.stories.js.map +1 -1
  188. package/lib/cjs/toast/Toast.js +11 -6
  189. package/lib/cjs/toast/Toast.js.map +1 -1
  190. package/lib/cjs/tooltip/Tooltip.js +35 -15
  191. package/lib/cjs/tooltip/Tooltip.js.map +1 -1
  192. package/lib/cjs/tree-view/TreeItemWrapper.js +3 -1
  193. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  194. package/lib/cjs/tree-view/TreeView.js +2 -1
  195. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  196. package/lib/cjs/tree-view/TreeViewItem.js +3 -1
  197. package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
  198. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -2
  199. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  200. package/lib/cjs/tree-view/TreeViewTrail.js +14 -2
  201. package/lib/cjs/tree-view/TreeViewTrail.js.map +1 -1
  202. package/lib/cjs/wizard/Wizard.js +3 -2
  203. package/lib/cjs/wizard/Wizard.js.map +1 -1
  204. package/lib/esm/_common/CodeBlockWrapper.js +5 -4
  205. package/lib/esm/_common/CodeBlockWrapper.js.map +1 -1
  206. package/lib/esm/_common/utils.js +4 -2
  207. package/lib/esm/_common/utils.js.map +1 -1
  208. package/lib/esm/accordion/Accordion.js +9 -6
  209. package/lib/esm/accordion/Accordion.js.map +1 -1
  210. package/lib/esm/accordion/accordion-types.js.map +1 -1
  211. package/lib/esm/accordion/stories/accordion.stories.js +1 -1
  212. package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
  213. package/lib/esm/avatar/Avatar.js +1 -1
  214. package/lib/esm/avatar/Avatar.js.map +1 -1
  215. package/lib/esm/banner/Banner.js +3 -2
  216. package/lib/esm/banner/Banner.js.map +1 -1
  217. package/lib/esm/banner/stories/banner.stories.js +1 -1
  218. package/lib/esm/banner/stories/banner.stories.js.map +1 -1
  219. package/lib/esm/box/Box.js +14 -2
  220. package/lib/esm/box/Box.js.map +1 -1
  221. package/lib/esm/box/stories/box.stories.js +2 -2
  222. package/lib/esm/box/stories/box.stories.js.map +1 -1
  223. package/lib/esm/breadcrumbs/Breadcrumbs.js +10 -7
  224. package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -1
  225. package/lib/esm/button/stories/button.stories.js +1 -1
  226. package/lib/esm/button/stories/button.stories.js.map +1 -1
  227. package/lib/esm/checkbox/Checkbox.js +2 -1
  228. package/lib/esm/checkbox/Checkbox.js.map +1 -1
  229. package/lib/esm/checkbox/stories/checkbox.stories.js +1 -1
  230. package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
  231. package/lib/esm/clipboard-button/ClipboardButton.js +6 -3
  232. package/lib/esm/clipboard-button/ClipboardButton.js.map +1 -1
  233. package/lib/esm/color-picker/ColorPicker.js +2 -1
  234. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  235. package/lib/esm/data-grid/Components.js +9 -6
  236. package/lib/esm/data-grid/Components.js.map +1 -1
  237. package/lib/esm/data-grid/DataGrid.js +16 -4
  238. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  239. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js +28 -14
  240. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  241. package/lib/esm/data-grid/data-grid-nav/helpers.js +2 -1
  242. package/lib/esm/data-grid/data-grid-nav/helpers.js.map +1 -1
  243. package/lib/esm/data-grid/stories/datagrid-component-overriding.story.js +1 -3
  244. package/lib/esm/data-grid/stories/datagrid-component-overriding.story.js.map +1 -1
  245. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js +2 -1
  246. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  247. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js +2 -1
  248. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  249. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -2
  250. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  251. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +9 -6
  252. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  253. package/lib/esm/date-picker/DatePicker.js +2 -1
  254. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  255. package/lib/esm/date-picker/stories/date-picker-range.story.js +1 -1
  256. package/lib/esm/date-picker/stories/date-picker-range.story.js.map +1 -1
  257. package/lib/esm/date-picker/stories/date-picker.stories.js +1 -1
  258. package/lib/esm/date-picker/stories/date-picker.stories.js.map +1 -1
  259. package/lib/esm/dialog/Dialog.js +20 -13
  260. package/lib/esm/dialog/Dialog.js.map +1 -1
  261. package/lib/esm/dialog/dialog-context.js +1 -2
  262. package/lib/esm/dialog/dialog-context.js.map +1 -1
  263. package/lib/esm/dialog/stories/dialog.stories.js +1 -1
  264. package/lib/esm/dialog/stories/dialog.stories.js.map +1 -1
  265. package/lib/esm/divider/stories/divider.stories.js +1 -1
  266. package/lib/esm/divider/stories/divider.stories.js.map +1 -1
  267. package/lib/esm/drawer/Drawer.js +9 -8
  268. package/lib/esm/drawer/Drawer.js.map +1 -1
  269. package/lib/esm/dropdown-button/DropdownButton.js +14 -2
  270. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  271. package/lib/esm/dropzone/Dropzone.js +3 -2
  272. package/lib/esm/dropzone/Dropzone.js.map +1 -1
  273. package/lib/esm/dropzone/stories/dropzone-csv-files.story.js +1 -3
  274. package/lib/esm/dropzone/stories/dropzone-csv-files.story.js.map +1 -1
  275. package/lib/esm/dropzone/stories/dropzone-custom-extensions.story.js +1 -3
  276. package/lib/esm/dropzone/stories/dropzone-custom-extensions.story.js.map +1 -1
  277. package/lib/esm/dropzone/stories/dropzone-default.story.js +1 -3
  278. package/lib/esm/dropzone/stories/dropzone-default.story.js.map +1 -1
  279. package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -3
  280. package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  281. package/lib/esm/flex/Flex.js +14 -2
  282. package/lib/esm/flex/Flex.js.map +1 -1
  283. package/lib/esm/graph-label/GraphLabel.js +18 -4
  284. package/lib/esm/graph-label/GraphLabel.js.map +1 -1
  285. package/lib/esm/icon-button/stories/icon-button.stories.js +1 -1
  286. package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
  287. package/lib/esm/icon-button-array/IconButtonArray.js +14 -2
  288. package/lib/esm/icon-button-array/IconButtonArray.js.map +1 -1
  289. package/lib/esm/icon-button-array/index.js +1 -1
  290. package/lib/esm/icon-button-array/index.js.map +1 -1
  291. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +1 -1
  292. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  293. package/lib/esm/icons/wrapIcon.js +1 -1
  294. package/lib/esm/icons/wrapIcon.js.map +1 -1
  295. package/lib/esm/inline-edit/InlineEdit.js +18 -6
  296. package/lib/esm/inline-edit/InlineEdit.js.map +1 -1
  297. package/lib/esm/kbd/Kbd.js +5 -3
  298. package/lib/esm/kbd/Kbd.js.map +1 -1
  299. package/lib/esm/kbd/stories/kbd.stories.js +1 -1
  300. package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
  301. package/lib/esm/loading-bar/LoadingBar.js +14 -2
  302. package/lib/esm/loading-bar/LoadingBar.js.map +1 -1
  303. package/lib/esm/loading-spinner/LoadingSpinner.js +1 -1
  304. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
  305. package/lib/esm/logo/stories/logo.stories.js +1 -1
  306. package/lib/esm/logo/stories/logo.stories.js.map +1 -1
  307. package/lib/esm/menu/Menu.js +9 -6
  308. package/lib/esm/menu/Menu.js.map +1 -1
  309. package/lib/esm/popover/Popover.js +6 -4
  310. package/lib/esm/popover/Popover.js.map +1 -1
  311. package/lib/esm/popover/stories/popover-custom-offset.story.js +2 -1
  312. package/lib/esm/popover/stories/popover-custom-offset.story.js.map +1 -1
  313. package/lib/esm/popover/stories/popover-separate-anchor.story.js +1 -1
  314. package/lib/esm/popover/stories/popover-separate-anchor.story.js.map +1 -1
  315. package/lib/esm/progress-bar/ProgressBar.js +1 -1
  316. package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
  317. package/lib/esm/radio/Radio.js +2 -1
  318. package/lib/esm/radio/Radio.js.map +1 -1
  319. package/lib/esm/radio/stories/radio.stories.js +1 -1
  320. package/lib/esm/radio/stories/radio.stories.js.map +1 -1
  321. package/lib/esm/select/Overrides.js +1 -1
  322. package/lib/esm/select/Overrides.js.map +1 -1
  323. package/lib/esm/select/Select.js +18 -6
  324. package/lib/esm/select/Select.js.map +1 -1
  325. package/lib/esm/side-navigation/SideNavigation.js +5 -4
  326. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  327. package/lib/esm/skeleton/Skeleton.js +14 -2
  328. package/lib/esm/skeleton/Skeleton.js.map +1 -1
  329. package/lib/esm/skeleton/stories/skeleton.stories.js +1 -1
  330. package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
  331. package/lib/esm/spotlight/Spotlight.js +33 -14
  332. package/lib/esm/spotlight/Spotlight.js.map +1 -1
  333. package/lib/esm/spotlight/SpotlightProvider.js +6 -3
  334. package/lib/esm/spotlight/SpotlightProvider.js.map +1 -1
  335. package/lib/esm/spotlight/SpotlightTarget.js +14 -2
  336. package/lib/esm/spotlight/SpotlightTarget.js.map +1 -1
  337. package/lib/esm/spotlight/SpotlightTour.js +1 -1
  338. package/lib/esm/spotlight/SpotlightTour.js.map +1 -1
  339. package/lib/esm/spotlight/stories/spotlight.stories.js +1 -1
  340. package/lib/esm/spotlight/stories/spotlight.stories.js.map +1 -1
  341. package/lib/esm/spotlight/use-indicator.js +2 -1
  342. package/lib/esm/spotlight/use-indicator.js.map +1 -1
  343. package/lib/esm/status-label/StatusLabel.js +1 -1
  344. package/lib/esm/status-label/StatusLabel.js.map +1 -1
  345. package/lib/esm/switch/Switch.js +2 -1
  346. package/lib/esm/switch/Switch.js.map +1 -1
  347. package/lib/esm/switch/stories/switch.stories.js +1 -1
  348. package/lib/esm/switch/stories/switch.stories.js.map +1 -1
  349. package/lib/esm/tabs/stories/tabs-disabled.story.js +1 -1
  350. package/lib/esm/tabs/stories/tabs-disabled.story.js.map +1 -1
  351. package/lib/esm/tabs/stories/tabs-fill-variants.story.js +1 -1
  352. package/lib/esm/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  353. package/lib/esm/tabs/stories/tabs-overflow.story.js +1 -1
  354. package/lib/esm/tabs/stories/tabs-overflow.story.js.map +1 -1
  355. package/lib/esm/tabs/stories/tabs-sizes.story.js +1 -1
  356. package/lib/esm/tabs/stories/tabs-sizes.story.js.map +1 -1
  357. package/lib/esm/tabs/use-tabs-scroll-overflow.js +8 -4
  358. package/lib/esm/tabs/use-tabs-scroll-overflow.js.map +1 -1
  359. package/lib/esm/tag/Tag.js +14 -2
  360. package/lib/esm/tag/Tag.js.map +1 -1
  361. package/lib/esm/text-area/TextArea.js +14 -2
  362. package/lib/esm/text-area/TextArea.js.map +1 -1
  363. package/lib/esm/text-area/stories/text-area.stories.js +1 -1
  364. package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
  365. package/lib/esm/text-input/TextInput.js +14 -2
  366. package/lib/esm/text-input/TextInput.js.map +1 -1
  367. package/lib/esm/text-link/TextLink.js +14 -2
  368. package/lib/esm/text-link/TextLink.js.map +1 -1
  369. package/lib/esm/text-overflow/TextOverflow.js +2 -1
  370. package/lib/esm/text-overflow/TextOverflow.js.map +1 -1
  371. package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
  372. package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
  373. package/lib/esm/text-overflow/text-overflow-utils.js +12 -6
  374. package/lib/esm/text-overflow/text-overflow-utils.js.map +1 -1
  375. package/lib/esm/text-overflow/use-ellipsis-observer.js +2 -1
  376. package/lib/esm/text-overflow/use-ellipsis-observer.js.map +1 -1
  377. package/lib/esm/text-overflow/use-truncate-with-button.js +4 -2
  378. package/lib/esm/text-overflow/use-truncate-with-button.js.map +1 -1
  379. package/lib/esm/theme/ThemeProvider.js +2 -1
  380. package/lib/esm/theme/ThemeProvider.js.map +1 -1
  381. package/lib/esm/time-picker/TimePicker.js +22 -8
  382. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  383. package/lib/esm/time-picker/stories/time-picker.stories.js +1 -1
  384. package/lib/esm/time-picker/stories/time-picker.stories.js.map +1 -1
  385. package/lib/esm/timezone-picker/TimeZonePicker.js +8 -4
  386. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  387. package/lib/esm/timezone-picker/generate-timezone-options.js +15 -9
  388. package/lib/esm/timezone-picker/generate-timezone-options.js.map +1 -1
  389. package/lib/esm/timezone-picker/stories/timezone-picker.stories.js +1 -1
  390. package/lib/esm/timezone-picker/stories/timezone-picker.stories.js.map +1 -1
  391. package/lib/esm/toast/Toast.js +11 -6
  392. package/lib/esm/toast/Toast.js.map +1 -1
  393. package/lib/esm/tooltip/Tooltip.js +35 -15
  394. package/lib/esm/tooltip/Tooltip.js.map +1 -1
  395. package/lib/esm/tree-view/TreeItemWrapper.js +3 -1
  396. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  397. package/lib/esm/tree-view/TreeView.js +2 -1
  398. package/lib/esm/tree-view/TreeView.js.map +1 -1
  399. package/lib/esm/tree-view/TreeViewItem.js +3 -1
  400. package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
  401. package/lib/esm/tree-view/TreeViewTextItem.js +1 -2
  402. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  403. package/lib/esm/tree-view/TreeViewTrail.js +14 -2
  404. package/lib/esm/tree-view/TreeViewTrail.js.map +1 -1
  405. package/lib/esm/wizard/Wizard.js +3 -2
  406. package/lib/esm/wizard/Wizard.js.map +1 -1
  407. package/lib/types/_common/CodeBlockWrapper.d.ts +1 -1
  408. package/lib/types/_common/CodeBlockWrapper.d.ts.map +1 -1
  409. package/lib/types/_common/utils.d.ts.map +1 -1
  410. package/lib/types/accordion/Accordion.d.ts +4 -4
  411. package/lib/types/accordion/Accordion.d.ts.map +1 -1
  412. package/lib/types/accordion/accordion-types.d.ts +1 -1
  413. package/lib/types/accordion/accordion-types.d.ts.map +1 -1
  414. package/lib/types/accordion/stories/accordion.stories.d.ts +4 -4
  415. package/lib/types/avatar/Avatar.d.ts.map +1 -1
  416. package/lib/types/banner/Banner.d.ts +1 -1
  417. package/lib/types/banner/Banner.d.ts.map +1 -1
  418. package/lib/types/box/Box.d.ts +1 -1
  419. package/lib/types/box/Box.d.ts.map +1 -1
  420. package/lib/types/box/stories/box.stories.d.ts +1 -1
  421. package/lib/types/breadcrumbs/Breadcrumbs.d.ts +3 -3
  422. package/lib/types/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  423. package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +3 -3
  424. package/lib/types/button/stories/button.stories.d.ts +1 -1
  425. package/lib/types/button/stories/button.stories.d.ts.map +1 -1
  426. package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
  427. package/lib/types/clipboard-button/ClipboardButton.d.ts.map +1 -1
  428. package/lib/types/color-picker/ColorPicker.d.ts.map +1 -1
  429. package/lib/types/data-grid/Components.d.ts.map +1 -1
  430. package/lib/types/data-grid/DataGrid.d.ts +23 -23
  431. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  432. package/lib/types/data-grid/data-grid-nav/data-grid-nav.d.ts.map +1 -1
  433. package/lib/types/data-grid/data-grid-nav/helpers.d.ts.map +1 -1
  434. package/lib/types/data-grid/stories/datagrid-component-overriding.story.d.ts.map +1 -1
  435. package/lib/types/data-grid/stories/datagrid-in-dialog.story.d.ts.map +1 -1
  436. package/lib/types/data-grid/stories/datagrid-keyboard-navigation.story.d.ts.map +1 -1
  437. package/lib/types/data-grid/stories/datagrid-kitchen-sink.story.d.ts.map +1 -1
  438. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +1 -1
  439. package/lib/types/data-grid/stories/datagrid-placeholder-states.stories.d.ts +1 -1
  440. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +1 -1
  441. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
  442. package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
  443. package/lib/types/date-picker/stories/date-picker-range.story.d.ts.map +1 -1
  444. package/lib/types/dialog/Dialog.d.ts +6 -6
  445. package/lib/types/dialog/Dialog.d.ts.map +1 -1
  446. package/lib/types/dialog/dialog-context.d.ts.map +1 -1
  447. package/lib/types/drawer/Drawer.d.ts +3 -3
  448. package/lib/types/drawer/Drawer.d.ts.map +1 -1
  449. package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
  450. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  451. package/lib/types/dropzone/Dropzone.d.ts.map +1 -1
  452. package/lib/types/flex/Flex.d.ts +1 -1
  453. package/lib/types/flex/Flex.d.ts.map +1 -1
  454. package/lib/types/flex/stories/flex.stories.d.ts +1 -1
  455. package/lib/types/graph-label/GraphLabel.d.ts +1 -1
  456. package/lib/types/graph-label/GraphLabel.d.ts.map +1 -1
  457. package/lib/types/icon-button-array/IconButtonArray.d.ts +2 -2
  458. package/lib/types/icon-button-array/IconButtonArray.d.ts.map +1 -1
  459. package/lib/types/icon-button-array/index.d.ts +1 -1
  460. package/lib/types/icon-button-array/index.d.ts.map +1 -1
  461. package/lib/types/inline-edit/InlineEdit.d.ts +1 -1
  462. package/lib/types/inline-edit/InlineEdit.d.ts.map +1 -1
  463. package/lib/types/kbd/Kbd.d.ts.map +1 -1
  464. package/lib/types/loading-bar/LoadingBar.d.ts +1 -1
  465. package/lib/types/loading-bar/LoadingBar.d.ts.map +1 -1
  466. package/lib/types/menu/Menu.d.ts +2 -2
  467. package/lib/types/menu/Menu.d.ts.map +1 -1
  468. package/lib/types/popover/Popover.d.ts +1 -1
  469. package/lib/types/popover/Popover.d.ts.map +1 -1
  470. package/lib/types/popover/stories/popover-custom-offset.story.d.ts.map +1 -1
  471. package/lib/types/radio/Radio.d.ts.map +1 -1
  472. package/lib/types/select/Overrides.d.ts +1 -2
  473. package/lib/types/select/Overrides.d.ts.map +1 -1
  474. package/lib/types/select/Select.d.ts +1 -1
  475. package/lib/types/select/Select.d.ts.map +1 -1
  476. package/lib/types/side-navigation/SideNavigation.d.ts +1 -1
  477. package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
  478. package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
  479. package/lib/types/skeleton/Skeleton.d.ts +1 -1
  480. package/lib/types/skeleton/Skeleton.d.ts.map +1 -1
  481. package/lib/types/skeleton/stories/skeleton.stories.d.ts +1 -1
  482. package/lib/types/spotlight/Spotlight.d.ts +6 -6
  483. package/lib/types/spotlight/Spotlight.d.ts.map +1 -1
  484. package/lib/types/spotlight/SpotlightProvider.d.ts.map +1 -1
  485. package/lib/types/spotlight/SpotlightTarget.d.ts +1 -1
  486. package/lib/types/spotlight/SpotlightTarget.d.ts.map +1 -1
  487. package/lib/types/spotlight/use-indicator.d.ts.map +1 -1
  488. package/lib/types/switch/Switch.d.ts.map +1 -1
  489. package/lib/types/tabs/use-tabs-scroll-overflow.d.ts.map +1 -1
  490. package/lib/types/tag/Tag.d.ts +1 -1
  491. package/lib/types/tag/Tag.d.ts.map +1 -1
  492. package/lib/types/text-area/TextArea.d.ts +1 -1
  493. package/lib/types/text-area/TextArea.d.ts.map +1 -1
  494. package/lib/types/text-input/TextInput.d.ts +1 -1
  495. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  496. package/lib/types/text-link/TextLink.d.ts +1 -1
  497. package/lib/types/text-link/TextLink.d.ts.map +1 -1
  498. package/lib/types/text-overflow/TextOverflow.d.ts.map +1 -1
  499. package/lib/types/text-overflow/text-overflow-utils.d.ts.map +1 -1
  500. package/lib/types/text-overflow/use-ellipsis-observer.d.ts.map +1 -1
  501. package/lib/types/text-overflow/use-truncate-with-button.d.ts.map +1 -1
  502. package/lib/types/theme/ThemeProvider.d.ts.map +1 -1
  503. package/lib/types/time-picker/TimePicker.d.ts +1 -1
  504. package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
  505. package/lib/types/time-picker/stories/time-picker.stories.d.ts +1 -1
  506. package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
  507. package/lib/types/timezone-picker/generate-timezone-options.d.ts.map +1 -1
  508. package/lib/types/toast/Toast.d.ts +1 -1
  509. package/lib/types/toast/Toast.d.ts.map +1 -1
  510. package/lib/types/tooltip/Tooltip.d.ts +8 -7
  511. package/lib/types/tooltip/Tooltip.d.ts.map +1 -1
  512. package/lib/types/tree-view/TreeItemWrapper.d.ts.map +1 -1
  513. package/lib/types/tree-view/TreeView.d.ts.map +1 -1
  514. package/lib/types/tree-view/TreeViewItem.d.ts.map +1 -1
  515. package/lib/types/tree-view/TreeViewTrail.d.ts +2 -1
  516. package/lib/types/tree-view/TreeViewTrail.d.ts.map +1 -1
  517. package/lib/types/wizard/Wizard.d.ts +1 -1
  518. package/lib/types/wizard/Wizard.d.ts.map +1 -1
  519. package/package.json +2 -2
  520. package/lib/cjs/dropdown-button/avatar-test.stories.tsx.js +0 -31
  521. package/lib/cjs/dropdown-button/avatar-test.stories.tsx.js.map +0 -1
  522. package/lib/esm/dropdown-button/avatar-test.stories.tsx.js +0 -27
  523. package/lib/esm/dropdown-button/avatar-test.stories.tsx.js.map +0 -1
  524. package/lib/types/dropdown-button/avatar-test.stories.tsx.d.ts +0 -24
  525. package/lib/types/dropdown-button/avatar-test.stories.tsx.d.ts.map +0 -1
@@ -22,7 +22,7 @@
22
22
  "use strict";
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Tone = exports.Sizes = exports.Loading = exports.Floating = exports.Disabled = exports.Active = exports.Default = void 0;
25
- const __1 = require("../");
25
+ const __1 = require("..");
26
26
  const _1 = require(".");
27
27
  const componentMeta = {
28
28
  component: __1.IconButton,
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.stories.js","sourceRoot":"","sources":["../../../../src/icon-button/stories/icon-button.stories.tsx"],"names":[],"mappings":";;;AAsBA,2BAAiC;AACjC,wBAeW;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,cAAU;IACrB,EAAE,EAAE,wBAAwB;IAC5B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,uBAAuB;CACG,CAAC;AAEpC,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAoB;gBAC1B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,oBAAiB;CAC1B,CAAC;AAEW,QAAA,MAAM,GAAU;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,mBAAgB;IACxB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,sBAAmB;aAC1B;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,qBAAkB;IAC1B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,wBAAqB;aAC5B;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,qBAAkB;IAC1B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,wBAAqB;aAC5B;SACF;KACF;CACF,CAAC;AAEW,QAAA,OAAO,GAAU;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,oBAAiB;IACzB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,uBAAoB;aAC3B;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,kBAAe;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,qBAAkB;aACzB;SACF;KACF;CACF,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,iBAAc;IACtB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,oBAAiB;aACxB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { IconButton } from '../';\nimport {\n IconButtonActive,\n IconButtonActiveSrc,\n IconButtonDefault,\n IconButtonDefaultSrc,\n IconButtonDisabled,\n IconButtonDisabledSrc,\n IconButtonFloating,\n IconButtonFloatingSrc,\n IconButtonLoading,\n IconButtonLoadingSrc,\n IconButtonSizes,\n IconButtonSizesSrc,\n IconButtonTone,\n IconButtonToneSrc,\n} from '.';\n\nconst componentMeta = {\n component: IconButton,\n id: 'components-icon-button',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/IconButton',\n} satisfies Meta<typeof IconButton>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n parameters: {\n docs: {\n source: {\n code: IconButtonDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: IconButtonDefault,\n};\n\nexport const Active: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonActive,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonActiveSrc,\n },\n },\n },\n};\n\nexport const Disabled: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonDisabled,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonDisabledSrc,\n },\n },\n },\n};\n\nexport const Floating: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonFloating,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonFloatingSrc,\n },\n },\n },\n};\n\nexport const Loading: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonLoading,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonLoadingSrc,\n },\n },\n },\n};\n\nexport const Sizes: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonSizes,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonSizesSrc,\n },\n },\n },\n};\n\nexport const Tone: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonTone,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonToneSrc,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"icon-button.stories.js","sourceRoot":"","sources":["../../../../src/icon-button/stories/icon-button.stories.tsx"],"names":[],"mappings":";;;AAsBA,0BAAgC;AAChC,wBAeW;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,cAAU;IACrB,EAAE,EAAE,wBAAwB;IAC5B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,uBAAuB;CACG,CAAC;AAEpC,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAoB;gBAC1B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,oBAAiB;CAC1B,CAAC;AAEW,QAAA,MAAM,GAAU;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,mBAAgB;IACxB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE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,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,oBAAiB;aACxB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { IconButton } from '..';\nimport {\n IconButtonActive,\n IconButtonActiveSrc,\n IconButtonDefault,\n IconButtonDefaultSrc,\n IconButtonDisabled,\n IconButtonDisabledSrc,\n IconButtonFloating,\n IconButtonFloatingSrc,\n IconButtonLoading,\n IconButtonLoadingSrc,\n IconButtonSizes,\n IconButtonSizesSrc,\n IconButtonTone,\n IconButtonToneSrc,\n} from '.';\n\nconst componentMeta = {\n component: IconButton,\n id: 'components-icon-button',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/IconButton',\n} satisfies Meta<typeof IconButton>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n parameters: {\n docs: {\n source: {\n code: IconButtonDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: IconButtonDefault,\n};\n\nexport const Active: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonActive,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonActiveSrc,\n },\n },\n },\n};\n\nexport const Disabled: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonDisabled,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonDisabledSrc,\n },\n },\n },\n};\n\nexport const Floating: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonFloating,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonFloatingSrc,\n },\n },\n },\n};\n\nexport const Loading: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonLoading,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonLoadingSrc,\n },\n },\n },\n};\n\nexport const Sizes: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonSizes,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonSizesSrc,\n },\n },\n },\n};\n\nexport const Tone: Story = {\n // @ts-expect-error - args are not needed.\n args: {},\n render: IconButtonTone,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonToneSrc,\n },\n },\n },\n};\n"]}
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -33,7 +44,8 @@ const CollapsibleButtonWrapper = ({ children, }) => {
33
44
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
34
45
  };
35
46
  CollapsibleButtonWrapper.displayName = 'CollapsibleButtonWrapper';
36
- const IconButtonArrayComponent = ({ children, as, isFloating = false, orientation = 'horizontal', size = 'medium', className, style, htmlAttributes, ref, }) => {
47
+ const IconButtonArrayComponent = (_a) => {
48
+ var { children, as, isFloating = false, orientation = 'horizontal', size = 'medium', className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "as", "isFloating", "orientation", "size", "className", "style", "htmlAttributes", "ref"]);
37
49
  const [isCollapsed, setIsCollapsed] = react_1.default.useState(true);
38
50
  const classes = (0, classnames_1.default)('ndl-icon-btn-array', {
39
51
  'n-flex-row': orientation === 'horizontal',
@@ -70,7 +82,7 @@ const IconButtonArrayComponent = ({ children, as, isFloating = false, orientatio
70
82
  }
71
83
  return isCollapsed ? (0, jsx_runtime_1.jsx)(icons_1.ChevronDownIconOutline, {}) : (0, jsx_runtime_1.jsx)(icons_1.ChevronUpIconOutline, {});
72
84
  };
73
- return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ role: "group", className: classes, ref: ref, style: style }, htmlAttributes, { children: [fixedButtonsWithProps, collapsibleButtonsWithProps && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isCollapsed && collapsibleButtonsWithProps, (0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { className: "ndl-grouped", onClick: () => {
85
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ role: "group", className: classes, ref: ref, style: style }, restProps, htmlAttributes, { children: [fixedButtonsWithProps, collapsibleButtonsWithProps && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isCollapsed && collapsibleButtonsWithProps, (0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { className: "ndl-grouped", onClick: () => {
74
86
  setIsCollapsed((prev) => !prev);
75
87
  }, size: size, description: isCollapsed ? 'Show more' : 'Show less', tooltipProps: {
76
88
  root: {
@@ -1 +1 @@
1
- {"version":3,"file":"IconButtonArray.js","sourceRoot":"","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AClB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,IACR,cAAc,eAEjB,qBAAqB,EACrB,2BAA2B,IAAI,CAC9B,6DACG,CAAC,WAAW,IAAI,2BAA2B,EAC5C,uBAAC,mCAAe,IACd,SAAS,EAAC,aAAa,EACvB,OAAO,EAAE,GAAG,EAAE;4BACZ,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;wBAClC,CAAC,EACD,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EACpD,YAAY,EAAE;4BACZ,IAAI,EAAE;gCACJ,2BAA2B,EAAE,IAAI;6BAClC;yBACF,EACD,cAAc,EAAE;4BACd,eAAe,EAAE,CAAC,WAAW;yBAC9B,YAEA,iBAAiB,EAAE,GACJ,IACjB,CACJ,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AAhHW,QAAA,wBAAwB,4BAgHnC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gCAAwB,EAAE;IAC9D,wBAAwB,EAAE,wBAAwB;CACnD,CAAC,CAAC;AAEM,0CAAe","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 from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport {\n ChevronDownIconOutline,\n ChevronLeftIconOutline,\n ChevronRightIconOutline,\n ChevronUpIconOutline,\n} from '../icons';\n\n/**\n * Types\n */\ntype IconButtonArrayProps = {\n /** Content displayed in the icon button array */\n children: React.ReactNode;\n /** Orientation of the icon button array */\n orientation?: 'vertical' | 'horizontal';\n /** Whether the icon button array is floating */\n isFloating?: boolean;\n /** Size of the icon button array */\n size?: 'small' | 'medium' | 'large';\n /** Additional class name*/\n className?: string;\n};\n\ntype CollapsibleButtonWrapperProps = {\n /** Icon buttons to be displayed in the collapsible button wrapper */\n children:\n | React.ReactElement<React.ComponentProps<typeof CleanIconButton>>\n | React.ReactElement<React.ComponentProps<typeof CleanIconButton>>[];\n};\n\nconst CollapsibleButtonWrapper: React.FC<CollapsibleButtonWrapperProps> = ({\n children,\n}) => {\n return <>{children}</>;\n};\nCollapsibleButtonWrapper.displayName = 'CollapsibleButtonWrapper';\n\nexport const IconButtonArrayComponent = <T extends React.ElementType = 'div'>({\n children,\n as,\n isFloating = false,\n orientation = 'horizontal',\n size = 'medium',\n className,\n style,\n htmlAttributes,\n ref,\n}: PolymorphicCommonProps<T, IconButtonArrayProps>) => {\n const [isCollapsed, setIsCollapsed] = React.useState(true);\n\n const classes = classNames('ndl-icon-btn-array', {\n 'n-flex-row': orientation === 'horizontal',\n 'n-flex-col': orientation === 'vertical',\n 'ndl-array-floating': isFloating,\n [`ndl-${size}`]: size,\n [className!]: className,\n });\n\n const Component: React.ElementType = as || 'div';\n\n const applySizeProp = (child: React.ReactElement) => {\n if (\n React.isValidElement<React.ComponentProps<typeof CleanIconButton>>(\n child,\n ) &&\n child.type === CleanIconButton\n ) {\n return React.cloneElement(child, {\n className: classNames(child.props.className, 'ndl-grouped'),\n size: child.props.size || size,\n });\n }\n return child;\n };\n\n const childrenArray = React.Children.toArray(\n children,\n ) as React.ReactElement[];\n\n const fixedButtons = childrenArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.type as React.ComponentType).displayName !==\n 'CollapsibleButtonWrapper',\n );\n\n const fixedButtonsWithProps = React.Children.map(fixedButtons, applySizeProp);\n\n const collapsibleButtonWrapper = childrenArray.find(\n (child) =>\n React.isValidElement(child) &&\n (child.type as React.ComponentType).displayName ===\n 'CollapsibleButtonWrapper',\n );\n\n const collapsibleButtonsWithProps = collapsibleButtonWrapper\n ? React.Children.map(\n (\n collapsibleButtonWrapper as React.ReactElement<CollapsibleButtonWrapperProps>\n ).props.children,\n applySizeProp,\n )\n : null;\n\n const renderChevronIcon = () => {\n if (orientation === 'horizontal') {\n return isCollapsed ? (\n <ChevronRightIconOutline />\n ) : (\n <ChevronLeftIconOutline />\n );\n }\n return isCollapsed ? <ChevronDownIconOutline /> : <ChevronUpIconOutline />;\n };\n\n return (\n <Component\n role=\"group\"\n className={classes}\n ref={ref}\n style={style}\n {...htmlAttributes}\n >\n {fixedButtonsWithProps}\n {collapsibleButtonsWithProps && (\n <>\n {!isCollapsed && collapsibleButtonsWithProps}\n <CleanIconButton\n className=\"ndl-grouped\"\n onClick={() => {\n setIsCollapsed((prev) => !prev);\n }}\n size={size}\n description={isCollapsed ? 'Show more' : 'Show less'}\n tooltipProps={{\n root: {\n shouldCloseOnReferenceClick: true,\n },\n }}\n htmlAttributes={{\n 'aria-expanded': !isCollapsed,\n }}\n >\n {renderChevronIcon()}\n </CleanIconButton>\n </>\n )}\n </Component>\n );\n};\n\nconst IconButtonArray = Object.assign(IconButtonArrayComponent, {\n CollapsibleButtonWrapper: CollapsibleButtonWrapper,\n});\n\nexport { IconButtonArray };\n"]}
1
+ {"version":3,"file":"IconButtonArray.js","sourceRoot":"","sources":["../../../src/icon-button-array/IconButtonArray.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,kDAA0B;AAG1B,4DAAuD;AACvD,oCAKkB;AAyBlB,MAAM,wBAAwB,GAA4C,CAAC,EACzE,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,2DAA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,aAAa,EACvB,OAAO,EAAE,GAAG,EAAE;4BACZ,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;wBAClC,CAAC,EACD,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EACpD,YAAY,EAAE;4BACZ,IAAI,EAAE;gCACJ,2BAA2B,EAAE,IAAI;6BAClC;yBACF,EACD,cAAc,EAAE;4BACd,eAAe,EAAE,CAAC,WAAW;yBAC9B,YAEA,iBAAiB,EAAE,GACJ,IACjB,CACJ,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AAlHW,QAAA,wBAAwB,4BAkHnC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gCAAwB,EAAE;IAC9D,wBAAwB,EAAE,wBAAwB;CACnD,CAAC,CAAC;AAEM,0CAAe","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 from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport {\n ChevronDownIconOutline,\n ChevronLeftIconOutline,\n ChevronRightIconOutline,\n ChevronUpIconOutline,\n} from '../icons';\n\n/**\n * Types\n */\ntype IconButtonArrayProps = {\n /** Content displayed in the icon button array */\n children: React.ReactNode;\n /** Orientation of the icon button array */\n orientation?: 'vertical' | 'horizontal';\n /** Whether the icon button array is floating */\n isFloating?: boolean;\n /** Size of the icon button array */\n size?: 'small' | 'medium' | 'large';\n /** Additional class name*/\n className?: string;\n};\n\ntype CollapsibleButtonWrapperProps = {\n /** Icon buttons to be displayed in the collapsible button wrapper */\n children:\n | React.ReactElement<React.ComponentProps<typeof CleanIconButton>>\n | React.ReactElement<React.ComponentProps<typeof CleanIconButton>>[];\n};\n\nconst CollapsibleButtonWrapper: React.FC<CollapsibleButtonWrapperProps> = ({\n children,\n}) => {\n return <>{children}</>;\n};\nCollapsibleButtonWrapper.displayName = 'CollapsibleButtonWrapper';\n\nexport const IconButtonArrayComponent = <T extends React.ElementType = 'div'>({\n children,\n as,\n isFloating = false,\n orientation = 'horizontal',\n size = 'medium',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, IconButtonArrayProps>) => {\n const [isCollapsed, setIsCollapsed] = React.useState(true);\n\n const classes = classNames('ndl-icon-btn-array', {\n 'n-flex-row': orientation === 'horizontal',\n 'n-flex-col': orientation === 'vertical',\n 'ndl-array-floating': isFloating,\n [`ndl-${size}`]: size,\n [className!]: className,\n });\n\n const Component: React.ElementType = as || 'div';\n\n const applySizeProp = (child: React.ReactElement) => {\n if (\n React.isValidElement<React.ComponentProps<typeof CleanIconButton>>(\n child,\n ) &&\n child.type === CleanIconButton\n ) {\n return React.cloneElement(child, {\n className: classNames(child.props.className, 'ndl-grouped'),\n size: child.props.size || size,\n });\n }\n return child;\n };\n\n const childrenArray = React.Children.toArray(\n children,\n ) as React.ReactElement[];\n\n const fixedButtons = childrenArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.type as React.ComponentType).displayName !==\n 'CollapsibleButtonWrapper',\n );\n\n const fixedButtonsWithProps = React.Children.map(fixedButtons, applySizeProp);\n\n const collapsibleButtonWrapper = childrenArray.find(\n (child) =>\n React.isValidElement(child) &&\n (child.type as React.ComponentType).displayName ===\n 'CollapsibleButtonWrapper',\n );\n\n const collapsibleButtonsWithProps = collapsibleButtonWrapper\n ? React.Children.map(\n (\n collapsibleButtonWrapper as React.ReactElement<CollapsibleButtonWrapperProps>\n ).props.children,\n applySizeProp,\n )\n : null;\n\n const renderChevronIcon = () => {\n if (orientation === 'horizontal') {\n return isCollapsed ? (\n <ChevronRightIconOutline />\n ) : (\n <ChevronLeftIconOutline />\n );\n }\n return isCollapsed ? <ChevronDownIconOutline /> : <ChevronUpIconOutline />;\n };\n\n return (\n <Component\n role=\"group\"\n className={classes}\n ref={ref}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {fixedButtonsWithProps}\n {collapsibleButtonsWithProps && (\n <>\n {!isCollapsed && collapsibleButtonsWithProps}\n <CleanIconButton\n className=\"ndl-grouped\"\n onClick={() => {\n setIsCollapsed((prev) => !prev);\n }}\n size={size}\n description={isCollapsed ? 'Show more' : 'Show less'}\n tooltipProps={{\n root: {\n shouldCloseOnReferenceClick: true,\n },\n }}\n htmlAttributes={{\n 'aria-expanded': !isCollapsed,\n }}\n >\n {renderChevronIcon()}\n </CleanIconButton>\n </>\n )}\n </Component>\n );\n};\n\nconst IconButtonArray = Object.assign(IconButtonArrayComponent, {\n CollapsibleButtonWrapper: CollapsibleButtonWrapper,\n});\n\nexport { IconButtonArray };\n"]}
@@ -34,5 +34,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
34
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- __exportStar(require("../icon-button-array/IconButtonArray"), exports);
37
+ __exportStar(require("./IconButtonArray"), exports);
38
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/icon-button-array/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,uEAAqD","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\nexport * from '../icon-button-array/IconButtonArray';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/icon-button-array/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,oDAAkC","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\nexport * from './IconButtonArray';\n"]}
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Sizes = exports.Collapsiable = exports.Floating = exports.Vertical = exports.Horizontal = void 0;
25
25
  const jsx_runtime_1 = require("react/jsx-runtime");
26
26
  const index_1 = require("../../index");
27
- const _1 = require("./");
27
+ const _1 = require(".");
28
28
  const componentMeta = {
29
29
  title: 'Components/IconButtonArray',
30
30
  id: 'components-buttons-icon-array',
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-array.stories.js","sourceRoot":"","sources":["../../../../src/icon-button-array/stories/icon-button-array.stories.tsx"],"names":[],"mappings":";;;;AAsBA,uCAA8C;AAC9C,yBAWY;AAEZ,MAAM,aAAa,GAAiC;IAClD,KAAK,EAAE,4BAA4B;IACnC,EAAE,EAAE,+BAA+B;IACnC,SAAS,EAAE,uBAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,gCAAK,SAAS,EAAC,yBAAyB,YACtC,uBAAC,KAAK,KAAG,GACL,CACP;KACF;CACF,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,4BAAyB;IACjC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,+BAA4B;aACnC;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,0BAAuB;IAC/B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,6BAA0B;aACjC;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,0BAAuB;IAC/B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,6BAA0B;aACjC;SACF;KACF;CACF,CAAC;AAEW,QAAA,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,6BAA0B;IAClC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gCAA6B;aACpC;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,uBAAoB;IAC5B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,0BAAuB;aAC9B;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { IconButtonArray } from '../../index';\nimport {\n IconButtonArrayCollapsible,\n IconButtonArrayCollapsibleSrc,\n IconButtonArrayFloating,\n IconButtonArrayFloatingSrc,\n IconButtonArrayHorizontal,\n IconButtonArrayHorizontalSrc,\n IconButtonArraySizes,\n IconButtonArraySizesSrc,\n IconButtonArrayVertical,\n IconButtonArrayVerticalSrc,\n} from './';\n\nconst componentMeta: Meta<typeof IconButtonArray> = {\n title: 'Components/IconButtonArray',\n id: 'components-buttons-icon-array',\n component: IconButtonArray,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Horizontal: Story = {\n args: {},\n render: IconButtonArrayHorizontal,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayHorizontalSrc,\n },\n },\n },\n};\n\nexport const Vertical: Story = {\n args: {},\n render: IconButtonArrayVertical,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayVerticalSrc,\n },\n },\n },\n};\n\nexport const Floating: Story = {\n args: {},\n render: IconButtonArrayFloating,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayFloatingSrc,\n },\n },\n },\n};\n\nexport const Collapsiable: Story = {\n args: {},\n render: IconButtonArrayCollapsible,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayCollapsibleSrc,\n },\n },\n },\n};\n\nexport const Sizes: Story = {\n args: {},\n render: IconButtonArraySizes,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArraySizesSrc,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"icon-button-array.stories.js","sourceRoot":"","sources":["../../../../src/icon-button-array/stories/icon-button-array.stories.tsx"],"names":[],"mappings":";;;;AAsBA,uCAA8C;AAC9C,wBAWW;AAEX,MAAM,aAAa,GAAiC;IAClD,KAAK,EAAE,4BAA4B;IACnC,EAAE,EAAE,+BAA+B;IACnC,SAAS,EAAE,uBAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,gCAAK,SAAS,EAAC,yBAAyB,YACtC,uBAAC,KAAK,KAAG,GACL,CACP;KACF;CACF,CAAC;AAEF,kBAA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[http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { IconButtonArray } from '../../index';\nimport {\n IconButtonArrayCollapsible,\n IconButtonArrayCollapsibleSrc,\n IconButtonArrayFloating,\n IconButtonArrayFloatingSrc,\n IconButtonArrayHorizontal,\n IconButtonArrayHorizontalSrc,\n IconButtonArraySizes,\n IconButtonArraySizesSrc,\n IconButtonArrayVertical,\n IconButtonArrayVerticalSrc,\n} from '.';\n\nconst componentMeta: Meta<typeof IconButtonArray> = {\n title: 'Components/IconButtonArray',\n id: 'components-buttons-icon-array',\n component: IconButtonArray,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Horizontal: Story = {\n args: {},\n render: IconButtonArrayHorizontal,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayHorizontalSrc,\n },\n },\n },\n};\n\nexport const Vertical: Story = {\n args: {},\n render: IconButtonArrayVertical,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayVerticalSrc,\n },\n },\n },\n};\n\nexport const Floating: Story = {\n args: {},\n render: IconButtonArrayFloating,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayFloatingSrc,\n },\n },\n },\n};\n\nexport const Collapsiable: Story = {\n args: {},\n render: IconButtonArrayCollapsible,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArrayCollapsibleSrc,\n },\n },\n },\n};\n\nexport const Sizes: Story = {\n args: {},\n render: IconButtonArraySizes,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: IconButtonArraySizesSrc,\n },\n },\n },\n};\n"]}
@@ -51,7 +51,7 @@ function wrapIcon(Original) {
51
51
  ;
52
52
  return (
53
53
  // @ts-expect-error – Original is of any type and we don't know what props it accepts
54
- (0, jsx_runtime_1.jsx)(Original, Object.assign({ strokeWidth: 1.5, style: style, className: `${ICON_CLASSNAME} ${className}`.trim() }, htmlAttributes, restProps, { ref: ref })));
54
+ (0, jsx_runtime_1.jsx)(Original, Object.assign({ strokeWidth: 1.5, style: style, className: `${ICON_CLASSNAME} ${className}`.trim() }, restProps, htmlAttributes, { ref: ref })));
55
55
  };
56
56
  return react_1.default.memo(Wrapped);
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wrapIcon.js","sourceRoot":"","sources":["../../../src/icons/wrapIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiCA,4BAqBC;;AAtDD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,kDAA0B;AAI1B,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC,SAAgB,QAAQ,CAA8B,QAAW;IAC/D,MAAM,OAAO,GAAG,CAAC,EAOI,EAAE,EAAE;YAPR,EACf,SAAS,GAAG,EAAE,EACd,KAAK,EACL,GAAG,EACH,cAAc,OAGK,EAFhB,SAAS,cALG,+CAOhB,CAFa;QACZ,mEAAmE;;QAC3C,OAAA;QACxB,qFAAqF;QACrF,uBAAC,QAAQ,kBACP,WAAW,EAAE,GAAG,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,GAAG,cAAc,IAAI,SAAS,EAAE,CAAC,IAAI,EAAE,IAC9C,cAAc,EACd,SAAS,IACb,GAAG,EAAE,GAAG,IACR,CACH,CAAA;KAAA,CAAC;IAEF,OAAO,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,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\n/**\n * Utility to add common Neo4j-Design styles / behaviour to any HeroIcon.\n *\n * This wrapper is kept in a single place so that the generated icon files\n * can stay **tiny** and tree-shakeable.\n */\nimport React from 'react';\n\nimport type { CommonProps } from '../_common/types';\n\nconst ICON_CLASSNAME = 'ndl-icon-svg';\n\nexport function wrapIcon<T extends React.ElementType>(Original: T) {\n const Wrapped = ({\n className = '',\n style,\n ref,\n htmlAttributes,\n ...restProps\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n }: CommonProps<T, {}>) => (\n // @ts-expect-error – Original is of any type and we don't know what props it accepts\n <Original\n strokeWidth={1.5}\n style={style}\n className={`${ICON_CLASSNAME} ${className}`.trim()}\n {...htmlAttributes}\n {...restProps}\n ref={ref}\n />\n );\n\n return React.memo(Wrapped);\n}\n"]}
1
+ {"version":3,"file":"wrapIcon.js","sourceRoot":"","sources":["../../../src/icons/wrapIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiCA,4BAqBC;;AAtDD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,kDAA0B;AAI1B,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC,SAAgB,QAAQ,CAA8B,QAAW;IAC/D,MAAM,OAAO,GAAG,CAAC,EAOI,EAAE,EAAE;YAPR,EACf,SAAS,GAAG,EAAE,EACd,KAAK,EACL,GAAG,EACH,cAAc,OAGK,EAFhB,SAAS,cALG,+CAOhB,CAFa;QACZ,mEAAmE;;QAC3C,OAAA;QACxB,qFAAqF;QACrF,uBAAC,QAAQ,kBACP,WAAW,EAAE,GAAG,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,GAAG,cAAc,IAAI,SAAS,EAAE,CAAC,IAAI,EAAE,IAC9C,SAAS,EACT,cAAc,IAClB,GAAG,EAAE,GAAG,IACR,CACH,CAAA;KAAA,CAAC;IAEF,OAAO,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,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\n/**\n * Utility to add common Neo4j-Design styles / behaviour to any HeroIcon.\n *\n * This wrapper is kept in a single place so that the generated icon files\n * can stay **tiny** and tree-shakeable.\n */\nimport React from 'react';\n\nimport type { CommonProps } from '../_common/types';\n\nconst ICON_CLASSNAME = 'ndl-icon-svg';\n\nexport function wrapIcon<T extends React.ElementType>(Original: T) {\n const Wrapped = ({\n className = '',\n style,\n ref,\n htmlAttributes,\n ...restProps\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n }: CommonProps<T, {}>) => (\n // @ts-expect-error – Original is of any type and we don't know what props it accepts\n <Original\n strokeWidth={1.5}\n style={style}\n className={`${ICON_CLASSNAME} ${className}`.trim()}\n {...restProps}\n {...htmlAttributes}\n ref={ref}\n />\n );\n\n return React.memo(Wrapped);\n}\n"]}
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
11
22
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
24
  };
@@ -45,13 +56,14 @@ const typography_1 = require("../typography");
45
56
  const utils_2 = require("./utils");
46
57
  // The input should not be less than this (it does shrink if container is smaller though).
47
58
  const MINIMUM_WIDTH = 320;
48
- const InlineEdit = ({ as, className, defaultValue, htmlAttributes, label, onChange, onCancel, onConfirm, ref, style, value, hasEditIcon = false, inputProps, isDisabled = false, isEditing, blurBehavior = 'confirm', isFluid = false, typographyVariant = 'subheading-medium', placeholder, }) => {
49
- var _a;
59
+ const InlineEdit = (_a) => {
60
+ var _b;
61
+ var { as, className, defaultValue, htmlAttributes, label, onChange, onCancel, onConfirm, ref, style, value, hasEditIcon = false, inputProps, isDisabled = false, isEditing, blurBehavior = 'confirm', isFluid = false, typographyVariant = 'subheading-medium', placeholder } = _a, restProps = __rest(_a, ["as", "className", "defaultValue", "htmlAttributes", "label", "onChange", "onCancel", "onConfirm", "ref", "style", "value", "hasEditIcon", "inputProps", "isDisabled", "isEditing", "blurBehavior", "isFluid", "typographyVariant", "placeholder"]);
50
62
  const [hasEditMode, setEditMode] = (0, react_1.useState)(false);
51
63
  const [currentValue, setCurrentValue] = (0, use_semi_controlled_state_1.useSemicontrolledState)({
52
64
  isControlled: value !== undefined,
53
65
  onChange,
54
- state: (_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '',
66
+ state: (_b = value !== null && value !== void 0 ? value : defaultValue) !== null && _b !== void 0 ? _b : '',
55
67
  });
56
68
  const [previousConfirmedValue, setPreviousConfirmedValue] = (0, react_1.useState)(currentValue);
57
69
  const mirrorRef = (0, react_1.useRef)(null);
@@ -153,10 +165,10 @@ const InlineEdit = ({ as, className, defaultValue, htmlAttributes, label, onChan
153
165
  updateInputWidth();
154
166
  }, [updateInputWidth, isInEditMode, currentValue]);
155
167
  const displayText = currentValue || placeholder;
156
- return ((0, jsx_runtime_1.jsxs)(typography_1.Typography, { as: as !== null && as !== void 0 ? as : 'div', variant: typographyVariant, className: (0, classnames_1.default)('ndl-inline-edit', className, {
168
+ return ((0, jsx_runtime_1.jsxs)(typography_1.Typography, Object.assign({ as: as !== null && as !== void 0 ? as : 'div', variant: typographyVariant, className: (0, classnames_1.default)('ndl-inline-edit', className, {
157
169
  'ndl-disabled': isDisabled,
158
170
  'ndl-fluid': isFluid,
159
- }), style: style, ref: ref, htmlAttributes: htmlAttributes, children: [Boolean(label) && (0, jsx_runtime_1.jsx)("label", { htmlFor: inputID, children: label }), isInEditMode === true ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-inline-edit-container", ref: containerRef }, focusWithinProps, { children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": true, className: "ndl-inline-edit-mirror", ref: mirrorRef, children: displayText }), (0, jsx_runtime_1.jsx)("input", Object.assign({}, inputProps, {
171
+ }), style: style, ref: ref, htmlAttributes: htmlAttributes }, restProps, { children: [Boolean(label) && (0, jsx_runtime_1.jsx)("label", { htmlFor: inputID, children: label }), isInEditMode === true ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-inline-edit-container", ref: containerRef }, focusWithinProps, { children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": true, className: "ndl-inline-edit-mirror", ref: mirrorRef, children: displayText }), (0, jsx_runtime_1.jsx)("input", Object.assign({}, inputProps, {
160
172
  // eslint-disable-next-line jsx-a11y/no-autofocus
161
173
  autoFocus: true, "aria-label": typeof label === 'string' ? label : 'Inline edit input', className: (0, classnames_1.default)('ndl-inline-edit-input', inputProps === null || inputProps === void 0 ? void 0 : inputProps.className), id: inputID, value: currentValue, onChange: handleInputChange, onKeyDown: handleKeyDown, placeholder: placeholder })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-inline-edit-buttons", children: [(0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { description: "Accept", tooltipProps: {
162
174
  root: { placement: 'bottom' },
@@ -176,7 +188,7 @@ const InlineEdit = ({ as, className, defaultValue, htmlAttributes, label, onChan
176
188
  'ndl-has-edit-icon': hasEditIcon,
177
189
  }), "aria-disabled": isDisabled, disabled: isDisabled, onClick: handleEditClick, style: {
178
190
  minHeight: (0, utils_2.getMinHeight)(typographyVariant),
179
- }, children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-inline-edit-text", children: displayText }), hasEditIcon && ((0, jsx_runtime_1.jsx)(icons_1.PencilIconOutline, { className: "ndl-inline-edit-pencil-icon", style: (0, utils_2.getIconStyle)(typographyVariant) }))] }))] }));
191
+ }, children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-inline-edit-text", children: displayText }), hasEditIcon && ((0, jsx_runtime_1.jsx)(icons_1.PencilIconOutline, { className: "ndl-inline-edit-pencil-icon", style: (0, utils_2.getIconStyle)(typographyVariant) }))] }))] })));
180
192
  };
181
193
  exports.InlineEdit = InlineEdit;
182
194
  //# sourceMappingURL=InlineEdit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineEdit.js","sourceRoot":"","sources":["../../../src/inline-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EAAE;wCAChB,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;oCAC/B,CAAC;iCACF,YAED,uBAAC,wBAAgB,KAAG,GACT,EACb,uBAAC,wBAAU,IACT,WAAW,EAAC,QAAQ,EACpB,YAAY,EAAE;oCACZ,IAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;iCAC9B,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAC1C,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,IAAI,EAChB,cAAc,EAAE;oCACd,WAAW,EAAE,GAAG,EAAE;wCAChB,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;oCAC/B,CAAC;iCACF,YAED,uBAAC,wBAAgB,KAAG,GACT,IACT,KACF,CACP,CAAC,CAAC,CAAC,CACF,oCACE,SAAS,EAAE,IAAA,oBAAU,EAAC,2BAA2B,EAAE;oBACjD,4BAA4B,EAAE,WAAW,KAAK,WAAW;oBACzD,cAAc,EAAE,UAAU;oBAC1B,mBAAmB,EAAE,WAAW;iBACjC,CAAC,mBACa,UAAU,EACzB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE;oBACL,SAAS,EAAE,IAAA,oBAAY,EAAC,iBAAiB,CAAC;iBAC3C,aAED,iCAAM,SAAS,EAAC,sBAAsB,YAAE,WAAW,GAAQ,EAC1D,WAAW,IAAI,CACd,uBAAC,yBAAiB,IAChB,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,IAAA,oBAAY,EAAC,iBAAiB,CAAC,GACtC,CACH,IACM,CACV,IACU,CACd,CAAC;AACJ,CAAC,CAAC;AAzQW,QAAA,UAAU,cAyQrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n type ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin } from 'react-aria';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { useSemicontrolledState } from '../_common/use-semi-controlled-state';\nimport { needleWarningMessage, randomId } from '../_common/utils';\nimport { IconButton } from '../icon-button';\nimport {\n CheckIconOutline,\n PencilIconOutline,\n XMarkIconOutline,\n} from '../icons';\nimport { Typography } from '../typography';\nimport { type TypographyVariants } from '../typography';\nimport { getIconStyle, getMinHeight } from './utils';\n\ntype InlineEditProps = {\n /** Label text */\n label?: ReactNode;\n\n /**\n * The typographyVariant of the component applied to Typography as its variant.\n * @default subheading-medium\n */\n typographyVariant?: TypographyVariants;\n\n /**\n * The default input value. Use for an uncontrolled component.\n */\n defaultValue?: string;\n\n /**\n * The input value. Makes the component controlled.\n */\n value?: string;\n\n /**\n * Callback when the input value changes. Must be used when the component is controlled.\n */\n onChange?: (value: string) => void;\n\n /**\n * Placeholder text displayed when the input is empty.\n */\n placeholder: string;\n\n /**\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * If edit pencil icon should be visible on hover\n * @default false\n */\n hasEditIcon?: boolean;\n\n /**\n * If the input is in editing mode\n * Used in a stateless inline edit\n * @default undefined\n */\n isEditing?: boolean;\n\n /** Callback when confirm icon button is pressed */\n onConfirm?: (\n value: string,\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n\n /** Callback when cancel icon button is pressed */\n onCancel?: (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n\n /**\n * What the input should do on blur\n * - \"confirm\" will confirm the value\n * - \"cancel\" will cancel the value\n * - \"none\" will do nothing\n * @default \"confirm\"\n */\n blurBehavior?: 'confirm' | 'cancel' | 'none';\n\n /** props applied to the internal input element */\n inputProps?: HtmlAttributes<'input'>;\n\n /**\n * If the input is fluid\n * @default false\n */\n isFluid?: boolean;\n};\n\n// The input should not be less than this (it does shrink if container is smaller though).\nconst MINIMUM_WIDTH = 320;\n\nexport const InlineEdit = <T extends React.ElementType = 'div'>({\n as,\n className,\n defaultValue,\n htmlAttributes,\n label,\n onChange,\n onCancel,\n onConfirm,\n ref,\n style,\n value,\n hasEditIcon = false,\n inputProps,\n isDisabled = false,\n isEditing,\n blurBehavior = 'confirm',\n isFluid = false,\n typographyVariant = 'subheading-medium',\n placeholder,\n}: PolymorphicCommonProps<T, InlineEditProps>) => {\n const [hasEditMode, setEditMode] = useState(false);\n\n const [currentValue, setCurrentValue] = useSemicontrolledState({\n isControlled: value !== undefined,\n onChange,\n state: value ?? defaultValue ?? '',\n });\n const [previousConfirmedValue, setPreviousConfirmedValue] =\n useState(currentValue);\n\n const mirrorRef = useRef<HTMLSpanElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n /**\n * This ref is used to prevent the blur behavior from being triggered on mouse down events\n * on the confirm and cancel buttons. So when true, the blur behavior is not triggered.\n * This is needed due to Webkit browsers (like Safari) triggering blur on mouse down events.\n *\n * It is also used to prevent the blur behavior from being triggered after the component exits edit mode without blur.\n * This bug caused the handler to be called when something was focused after confirming.\n */\n const blurWithinRef = useRef(false);\n\n // Validate controlled mode requirements\n useEffect(() => {\n if (value !== undefined && onChange === undefined) {\n needleWarningMessage(\n 'onChange prop should be supplied when using controlled mode (value prop is provided).',\n );\n }\n }, [value, onChange]);\n\n const { focusWithinProps } = useFocusWithin({\n onBlurWithin: () => {\n if (blurWithinRef.current) {\n return;\n }\n\n if (blurBehavior === 'confirm') {\n onConfirmHandler();\n return;\n }\n if (blurBehavior === 'cancel') {\n onCancelHandler();\n return;\n }\n },\n });\n\n const resetToDefaults = useCallback(() => {\n // In controlled mode, don't reset the value - let the parent manage it\n // In uncontrolled mode, reset to default value\n if (value === undefined) {\n setCurrentValue(previousConfirmedValue ?? '');\n }\n // Only reset edit mode if isEditing is not controlled (undefined)\n if (isEditing === undefined) {\n blurWithinRef.current = true;\n setEditMode(false);\n }\n }, [previousConfirmedValue, isEditing, setCurrentValue, value]);\n\n const resetEditState = useCallback(() => {\n // Only reset edit mode if isEditing is not controlled (undefined)\n if (isEditing === undefined) {\n blurWithinRef.current = true;\n setEditMode(false);\n }\n }, [isEditing]);\n\n const onConfirmHandler = useCallback(\n async (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n setPreviousConfirmedValue(currentValue);\n onConfirm?.(currentValue, event);\n resetEditState();\n },\n [onConfirm, currentValue, resetEditState],\n );\n\n const onCancelHandler = useCallback(\n (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n onCancel?.(event);\n resetToDefaults();\n },\n [onCancel, resetToDefaults],\n );\n\n const inputID = useMemo(() => {\n return inputProps?.id ?? randomId(12);\n }, [inputProps?.id]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Escape'].includes(e.key)) {\n if (e.key === 'Enter') {\n onConfirmHandler();\n }\n if (e.key === 'Escape') {\n onCancelHandler();\n }\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [onConfirmHandler, onCancelHandler],\n );\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n },\n [setCurrentValue],\n );\n\n const isInEditMode = isEditing ?? hasEditMode;\n\n const handleEditClick = useCallback(() => {\n if (isDisabled === false) {\n setEditMode(true);\n blurWithinRef.current = false;\n }\n }, [isDisabled]);\n\n const updateInputWidth = useCallback(() => {\n if (mirrorRef.current && containerRef.current && !isFluid) {\n const mirrorWidth = mirrorRef.current.offsetWidth;\n const newWidth = Math.max(mirrorWidth, MINIMUM_WIDTH);\n containerRef.current.style.width = `${newWidth}px`;\n }\n }, [mirrorRef, containerRef, isFluid]);\n\n // Width calculation effect\n useLayoutEffect(() => {\n updateInputWidth();\n }, [updateInputWidth, isInEditMode, currentValue]);\n\n const displayText = currentValue || placeholder;\n\n return (\n <Typography\n as={as ?? 'div'}\n variant={typographyVariant}\n className={classNames('ndl-inline-edit', className, {\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n })}\n style={style}\n ref={ref}\n htmlAttributes={htmlAttributes}\n >\n {Boolean(label) && <label htmlFor={inputID}>{label}</label>}\n {isInEditMode === true ? (\n <div\n className=\"ndl-inline-edit-container\"\n ref={containerRef}\n {...focusWithinProps}\n >\n {/* Mirror span for measuring width */}\n <span\n aria-hidden={true}\n className=\"ndl-inline-edit-mirror\"\n ref={mirrorRef}\n >\n {displayText}\n </span>\n <input\n {...inputProps}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n aria-label={typeof label === 'string' ? label : 'Inline edit input'}\n className={classNames(\n 'ndl-inline-edit-input',\n inputProps?.className,\n )}\n id={inputID}\n value={currentValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n />\n <div className=\"ndl-inline-edit-buttons\">\n <IconButton\n description=\"Accept\"\n tooltipProps={{\n root: { placement: 'bottom' },\n }}\n onClick={onConfirmHandler}\n size=\"small\"\n isFloating={true}\n htmlAttributes={{\n onMouseDown: () => {\n blurWithinRef.current = true;\n },\n }}\n >\n <CheckIconOutline />\n </IconButton>\n <IconButton\n description=\"Cancel\"\n tooltipProps={{\n root: { placement: 'bottom' },\n }}\n onClick={(event) => onCancelHandler(event)}\n size=\"small\"\n isFloating={true}\n htmlAttributes={{\n onMouseDown: () => {\n blurWithinRef.current = true;\n },\n }}\n >\n <XMarkIconOutline />\n </IconButton>\n </div>\n </div>\n ) : (\n <button\n className={classNames('ndl-inline-idle-container', {\n 'n-text-neutral-text-weaker': displayText === placeholder,\n 'ndl-disabled': isDisabled,\n 'ndl-has-edit-icon': hasEditIcon,\n })}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n onClick={handleEditClick}\n style={{\n minHeight: getMinHeight(typographyVariant),\n }}\n >\n <span className=\"ndl-inline-edit-text\">{displayText}</span>\n {hasEditIcon && (\n <PencilIconOutline\n className=\"ndl-inline-edit-pencil-icon\"\n style={getIconStyle(typographyVariant)}\n />\n )}\n </button>\n )}\n </Typography>\n );\n};\n"]}
1
+ {"version":3,"file":"InlineEdit.js","sourceRoot":"","sources":["../../../src/inline-edit/InlineEdit.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,iCAQe;AACf,2CAA4C;AAM5C,oFAA8E;AAC9E,4CAAkE;AAClE,gDAA4C;AAC5C,oCAIkB;AAClB,8CAA2C;AAE3C,mCAAqD;AAgFrD,0FAA0F;AAC1F,MAAM,aAAa,GAAG,GAAG,CAAC;AAEnB,MAAM,UAAU,GAAG,CAAsC,EAqBnB,EAAE,EAAE;;QArBe,EAC9D,EAAE,EACF,SAAS,EACT,YAAY,EACZ,cAAc,EACd,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,GAAG,EACH,KAAK,EACL,KAAK,EACL,WAAW,GAAG,KAAK,EACnB,UAAU,EACV,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,YAAY,GAAG,SAAS,EACxB,OAAO,GAAG,KAAK,EACf,iBAAiB,GAAG,mBAAmB,EACvC,WAAW,OAEgC,EADxC,SAAS,cApBkD,mPAqB/D,CADa;IAEZ,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEnD,MAAM,CAAC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zB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE;oBACL,SAAS,EAAE,IAAA,oBAAY,EAAC,iBAAiB,CAAC;iBAC3C,aAED,iCAAM,SAAS,EAAC,sBAAsB,YAAE,WAAW,GAAQ,EAC1D,WAAW,IAAI,CACd,uBAAC,yBAAiB,IAChB,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,IAAA,oBAAY,EAAC,iBAAiB,CAAC,GACtC,CACH,IACM,CACV,KACU,CACd,CAAC;AACJ,CAAC,CAAC;AA3QW,QAAA,UAAU,cA2QrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n type ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin } from 'react-aria';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { useSemicontrolledState } from '../_common/use-semi-controlled-state';\nimport { needleWarningMessage, randomId } from '../_common/utils';\nimport { IconButton } from '../icon-button';\nimport {\n CheckIconOutline,\n PencilIconOutline,\n XMarkIconOutline,\n} from '../icons';\nimport { Typography } from '../typography';\nimport { type TypographyVariants } from '../typography';\nimport { getIconStyle, getMinHeight } from './utils';\n\ntype InlineEditProps = {\n /** Label text */\n label?: ReactNode;\n\n /**\n * The typographyVariant of the component applied to Typography as its variant.\n * @default subheading-medium\n */\n typographyVariant?: TypographyVariants;\n\n /**\n * The default input value. Use for an uncontrolled component.\n */\n defaultValue?: string;\n\n /**\n * The input value. Makes the component controlled.\n */\n value?: string;\n\n /**\n * Callback when the input value changes. Must be used when the component is controlled.\n */\n onChange?: (value: string) => void;\n\n /**\n * Placeholder text displayed when the input is empty.\n */\n placeholder: string;\n\n /**\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * If edit pencil icon should be visible on hover\n * @default false\n */\n hasEditIcon?: boolean;\n\n /**\n * If the input is in editing mode\n * Used in a stateless inline edit\n * @default undefined\n */\n isEditing?: boolean;\n\n /** Callback when confirm icon button is pressed */\n onConfirm?: (\n value: string,\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n\n /** Callback when cancel icon button is pressed */\n onCancel?: (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n\n /**\n * What the input should do on blur\n * - \"confirm\" will confirm the value\n * - \"cancel\" will cancel the value\n * - \"none\" will do nothing\n * @default \"confirm\"\n */\n blurBehavior?: 'confirm' | 'cancel' | 'none';\n\n /** props applied to the internal input element */\n inputProps?: HtmlAttributes<'input'>;\n\n /**\n * If the input is fluid\n * @default false\n */\n isFluid?: boolean;\n};\n\n// The input should not be less than this (it does shrink if container is smaller though).\nconst MINIMUM_WIDTH = 320;\n\nexport const InlineEdit = <T extends React.ElementType = 'div'>({\n as,\n className,\n defaultValue,\n htmlAttributes,\n label,\n onChange,\n onCancel,\n onConfirm,\n ref,\n style,\n value,\n hasEditIcon = false,\n inputProps,\n isDisabled = false,\n isEditing,\n blurBehavior = 'confirm',\n isFluid = false,\n typographyVariant = 'subheading-medium',\n placeholder,\n ...restProps\n}: PolymorphicCommonProps<T, InlineEditProps>) => {\n const [hasEditMode, setEditMode] = useState(false);\n\n const [currentValue, setCurrentValue] = useSemicontrolledState({\n isControlled: value !== undefined,\n onChange,\n state: value ?? defaultValue ?? '',\n });\n const [previousConfirmedValue, setPreviousConfirmedValue] =\n useState(currentValue);\n\n const mirrorRef = useRef<HTMLSpanElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n /**\n * This ref is used to prevent the blur behavior from being triggered on mouse down events\n * on the confirm and cancel buttons. So when true, the blur behavior is not triggered.\n * This is needed due to Webkit browsers (like Safari) triggering blur on mouse down events.\n *\n * It is also used to prevent the blur behavior from being triggered after the component exits edit mode without blur.\n * This bug caused the handler to be called when something was focused after confirming.\n */\n const blurWithinRef = useRef(false);\n\n // Validate controlled mode requirements\n useEffect(() => {\n if (value !== undefined && onChange === undefined) {\n needleWarningMessage(\n 'onChange prop should be supplied when using controlled mode (value prop is provided).',\n );\n }\n }, [value, onChange]);\n\n const { focusWithinProps } = useFocusWithin({\n onBlurWithin: () => {\n if (blurWithinRef.current) {\n return;\n }\n\n if (blurBehavior === 'confirm') {\n onConfirmHandler();\n return;\n }\n if (blurBehavior === 'cancel') {\n onCancelHandler();\n return;\n }\n },\n });\n\n const resetToDefaults = useCallback(() => {\n // In controlled mode, don't reset the value - let the parent manage it\n // In uncontrolled mode, reset to default value\n if (value === undefined) {\n setCurrentValue(previousConfirmedValue ?? '');\n }\n // Only reset edit mode if isEditing is not controlled (undefined)\n if (isEditing === undefined) {\n blurWithinRef.current = true;\n setEditMode(false);\n }\n }, [previousConfirmedValue, isEditing, setCurrentValue, value]);\n\n const resetEditState = useCallback(() => {\n // Only reset edit mode if isEditing is not controlled (undefined)\n if (isEditing === undefined) {\n blurWithinRef.current = true;\n setEditMode(false);\n }\n }, [isEditing]);\n\n const onConfirmHandler = useCallback(\n async (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n setPreviousConfirmedValue(currentValue);\n onConfirm?.(currentValue, event);\n resetEditState();\n },\n [onConfirm, currentValue, resetEditState],\n );\n\n const onCancelHandler = useCallback(\n (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n onCancel?.(event);\n resetToDefaults();\n },\n [onCancel, resetToDefaults],\n );\n\n const inputID = useMemo(() => {\n return inputProps?.id ?? randomId(12);\n }, [inputProps?.id]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Escape'].includes(e.key)) {\n if (e.key === 'Enter') {\n onConfirmHandler();\n }\n if (e.key === 'Escape') {\n onCancelHandler();\n }\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [onConfirmHandler, onCancelHandler],\n );\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n },\n [setCurrentValue],\n );\n\n const isInEditMode = isEditing ?? hasEditMode;\n\n const handleEditClick = useCallback(() => {\n if (isDisabled === false) {\n setEditMode(true);\n blurWithinRef.current = false;\n }\n }, [isDisabled]);\n\n const updateInputWidth = useCallback(() => {\n if (mirrorRef.current && containerRef.current && !isFluid) {\n const mirrorWidth = mirrorRef.current.offsetWidth;\n const newWidth = Math.max(mirrorWidth, MINIMUM_WIDTH);\n containerRef.current.style.width = `${newWidth}px`;\n }\n }, [mirrorRef, containerRef, isFluid]);\n\n // Width calculation effect\n useLayoutEffect(() => {\n updateInputWidth();\n }, [updateInputWidth, isInEditMode, currentValue]);\n\n const displayText = currentValue || placeholder;\n\n return (\n <Typography\n as={as ?? 'div'}\n variant={typographyVariant}\n className={classNames('ndl-inline-edit', className, {\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n })}\n style={style}\n ref={ref}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n {Boolean(label) && <label htmlFor={inputID}>{label}</label>}\n {isInEditMode === true ? (\n <div\n className=\"ndl-inline-edit-container\"\n ref={containerRef}\n {...focusWithinProps}\n >\n {/* Mirror span for measuring width */}\n <span\n aria-hidden={true}\n className=\"ndl-inline-edit-mirror\"\n ref={mirrorRef}\n >\n {displayText}\n </span>\n <input\n {...inputProps}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n aria-label={typeof label === 'string' ? label : 'Inline edit input'}\n className={classNames(\n 'ndl-inline-edit-input',\n inputProps?.className,\n )}\n id={inputID}\n value={currentValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n />\n <div className=\"ndl-inline-edit-buttons\">\n <IconButton\n description=\"Accept\"\n tooltipProps={{\n root: { placement: 'bottom' },\n }}\n onClick={onConfirmHandler}\n size=\"small\"\n isFloating={true}\n htmlAttributes={{\n onMouseDown: () => {\n blurWithinRef.current = true;\n },\n }}\n >\n <CheckIconOutline />\n </IconButton>\n <IconButton\n description=\"Cancel\"\n tooltipProps={{\n root: { placement: 'bottom' },\n }}\n onClick={(event) => onCancelHandler(event)}\n size=\"small\"\n isFloating={true}\n htmlAttributes={{\n onMouseDown: () => {\n blurWithinRef.current = true;\n },\n }}\n >\n <XMarkIconOutline />\n </IconButton>\n </div>\n </div>\n ) : (\n <button\n className={classNames('ndl-inline-idle-container', {\n 'n-text-neutral-text-weaker': displayText === placeholder,\n 'ndl-disabled': isDisabled,\n 'ndl-has-edit-icon': hasEditIcon,\n })}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n onClick={handleEditClick}\n style={{\n minHeight: getMinHeight(typographyVariant),\n }}\n >\n <span className=\"ndl-inline-edit-text\">{displayText}</span>\n {hasEditIcon && (\n <PencilIconOutline\n className=\"ndl-inline-edit-pencil-icon\"\n style={getIconStyle(typographyVariant)}\n />\n )}\n </button>\n )}\n </Typography>\n );\n};\n"]}
@@ -43,15 +43,17 @@ const Kbd = (_a) => {
43
43
  var { modifierKeys, keys, os, as, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["modifierKeys", "keys", "os", "as", "className", "style", "htmlAttributes", "ref"]);
44
44
  const Component = as !== null && as !== void 0 ? as : 'span';
45
45
  const modifierKeysContent = (0, react_1.useMemo)(() => {
46
- if (modifierKeys === undefined)
46
+ if (modifierKeys === undefined) {
47
47
  return null;
48
+ }
48
49
  const keyMap = (0, kbd_utils_1.getKbdKeysMap)(os);
49
50
  const labelMap = (0, kbd_utils_1.getKbdKeysLabelMap)(os);
50
51
  return modifierKeys === null || modifierKeys === void 0 ? void 0 : modifierKeys.map((key) => ((0, jsx_runtime_1.jsx)("abbr", { className: "ndl-kbd-key", title: labelMap[key], children: keyMap[key] }, key)));
51
52
  }, [modifierKeys, os]);
52
53
  const keysContent = (0, react_1.useMemo)(() => {
53
- if (keys === undefined)
54
+ if (keys === undefined) {
54
55
  return null;
56
+ }
55
57
  return keys === null || keys === void 0 ? void 0 : keys.map((key, index) => {
56
58
  if (index === 0) {
57
59
  return ((0, jsx_runtime_1.jsx)("span", { className: "ndl-kbd-key", children: key }, key === null || key === void 0 ? void 0 : key.toString()));
@@ -60,7 +62,7 @@ const Kbd = (_a) => {
60
62
  });
61
63
  }, [keys]);
62
64
  const classes = (0, classnames_1.default)('ndl-kbd', className);
63
- return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, restProps, { children: [modifierKeysContent, keysContent] })));
65
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: [modifierKeysContent, keysContent] })));
64
66
  };
65
67
  exports.Kbd = Kbd;
66
68
  //# sourceMappingURL=Kbd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Kbd.js","sourceRoot":"","sources":["../../../src/kbd/Kbd.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,iCAAgC;AAGhC,2CAKqB;AAiBd,MAAM,GAAG,GAAG,CAAuC,EAUpB,EAAE,EAAE;QAVgB,EACxD,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,EAAE,EACF,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEiC,EADjC,SAAS,cAT4C,mFAUzD,CADa;IAEZ,MA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AC,CAAC,CAAC;IAEX,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjD,OAAO,CACL,wBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,cAAc,EACd,SAAS,eAEZ,mBAAmB,EACnB,WAAW,KACF,CACb,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,GAAG,OA6Dd","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 { useMemo } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport {\n getKbdKeysLabelMap,\n getKbdKeysMap,\n type KbdKey,\n type OperatingSystem,\n} from './kbd-utils';\n\ntype KbdProps = {\n /**\n * The modifier keys to display in the keyboard shortcut.\n */\n modifierKeys?: KbdKey[];\n /**\n * The main keys to display in the keyboard shortcut.\n */\n keys?: React.ReactNode[];\n /**\n * Override the operating system detection for key symbols\n */\n os?: OperatingSystem;\n};\n\nexport const Kbd = <T extends React.ElementType = 'span'>({\n modifierKeys,\n keys,\n os,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, KbdProps>) => {\n const Component: React.ElementType = as ?? 'span';\n\n const modifierKeysContent = useMemo(() => {\n if (modifierKeys === undefined) return null;\n\n const keyMap = getKbdKeysMap(os);\n const labelMap = getKbdKeysLabelMap(os);\n\n return modifierKeys?.map((key) => (\n <abbr className=\"ndl-kbd-key\" key={key} title={labelMap[key]}>\n {keyMap[key]}\n </abbr>\n ));\n }, [modifierKeys, os]);\n\n const keysContent = useMemo(() => {\n if (keys === undefined) return null;\n\n return keys?.map((key, index) => {\n if (index === 0) {\n return (\n <span className=\"ndl-kbd-key\" key={key?.toString()}>\n {key}\n </span>\n );\n }\n return (\n <>\n <span className=\"ndl-kbd-then\">Then</span>\n <span className=\"ndl-kbd-key\" key={key?.toString()}>\n {key}\n </span>\n </>\n );\n });\n }, [keys]);\n\n const classes = classNames('ndl-kbd', className);\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...htmlAttributes}\n {...restProps}\n >\n {modifierKeysContent}\n {keysContent}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Kbd.js","sourceRoot":"","sources":["../../../src/kbd/Kbd.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,iCAAgC;AAGhC,2CAKqB;AAiBd,MAAM,GAAG,GAAG,CAAuC,EAUpB,EAAE,EAAE;QAVgB,EACxD,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,EAAE,EACF,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEiC,EADjC,SAAS,cAT4C,mFAUzD,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,MAAM,CAAC;IAElD,MAAM,mBAAmB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACvC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,yBAAa,EAAC,EAAE,CAAC,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAA,8BAAkB,EAAC,EAAE,CAAC,CAAC;QAExC,OAAO,YAAY,aAAZ,YAA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["/**\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 { useMemo } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport {\n getKbdKeysLabelMap,\n getKbdKeysMap,\n type KbdKey,\n type OperatingSystem,\n} from './kbd-utils';\n\ntype KbdProps = {\n /**\n * The modifier keys to display in the keyboard shortcut.\n */\n modifierKeys?: KbdKey[];\n /**\n * The main keys to display in the keyboard shortcut.\n */\n keys?: React.ReactNode[];\n /**\n * Override the operating system detection for key symbols\n */\n os?: OperatingSystem;\n};\n\nexport const Kbd = <T extends React.ElementType = 'span'>({\n modifierKeys,\n keys,\n os,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, KbdProps>) => {\n const Component: React.ElementType = as ?? 'span';\n\n const modifierKeysContent = useMemo(() => {\n if (modifierKeys === undefined) {\n return null;\n }\n\n const keyMap = getKbdKeysMap(os);\n const labelMap = getKbdKeysLabelMap(os);\n\n return modifierKeys?.map((key) => (\n <abbr className=\"ndl-kbd-key\" key={key} title={labelMap[key]}>\n {keyMap[key]}\n </abbr>\n ));\n }, [modifierKeys, os]);\n\n const keysContent = useMemo(() => {\n if (keys === undefined) {\n return null;\n }\n\n return keys?.map((key, index) => {\n if (index === 0) {\n return (\n <span className=\"ndl-kbd-key\" key={key?.toString()}>\n {key}\n </span>\n );\n }\n return (\n <>\n <span className=\"ndl-kbd-then\">Then</span>\n <span className=\"ndl-kbd-key\" key={key?.toString()}>\n {key}\n </span>\n </>\n );\n });\n }, [keys]);\n\n const classes = classNames('ndl-kbd', className);\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {modifierKeysContent}\n {keysContent}\n </Component>\n );\n};\n"]}
@@ -23,7 +23,7 @@
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Sequence = exports.Default = void 0;
25
25
  const index_1 = require("../../index");
26
- const _1 = require("./");
26
+ const _1 = require(".");
27
27
  const componentMeta = {
28
28
  title: 'Components/Kbd',
29
29
  id: 'components-kbd',
@@ -1 +1 @@
1
- {"version":3,"file":"kbd.stories.js","sourceRoot":"","sources":["../../../../src/kbd/stories/kbd.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAkC;AAClC,yBAA4E;AAE5E,MAAM,aAAa,GAAqB;IACtC,KAAK,EAAE,gBAAgB;IACvB,EAAE,EAAE,gBAAgB;IACpB,SAAS,EAAE,WAAG;IACd,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,aAAU;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAa;aACpB;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Kbd } from '../../index';\nimport { KbdDefault, KbdDefaultSrc, KbdSequence, KbdSequenceSrc } from './';\n\nconst componentMeta: Meta<typeof Kbd> = {\n title: 'Components/Kbd',\n id: 'components-kbd',\n component: Kbd,\n tags: ['docsPage'],\n parameters: {\n controls: {},\n },\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n render: KbdDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: KbdDefaultSrc,\n },\n },\n },\n};\n\nexport const Sequence: Story = {\n args: {},\n render: KbdSequence,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: KbdSequenceSrc,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"kbd.stories.js","sourceRoot":"","sources":["../../../../src/kbd/stories/kbd.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAkC;AAClC,wBAA2E;AAE3E,MAAM,aAAa,GAAqB;IACtC,KAAK,EAAE,gBAAgB;IACvB,EAAE,EAAE,gBAAgB;IACpB,SAAS,EAAE,WAAG;IACd,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,aAAU;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAa;aACpB;SACF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Kbd } from '../../index';\nimport { KbdDefault, KbdDefaultSrc, KbdSequence, KbdSequenceSrc } from '.';\n\nconst componentMeta: Meta<typeof Kbd> = {\n title: 'Components/Kbd',\n id: 'components-kbd',\n component: Kbd,\n tags: ['docsPage'],\n parameters: {\n controls: {},\n },\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n render: KbdDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: KbdDefaultSrc,\n },\n },\n },\n};\n\nexport const Sequence: Story = {\n args: {},\n render: KbdSequence,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: KbdSequenceSrc,\n },\n },\n },\n};\n"]}
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -26,12 +37,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
26
37
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
38
  */
28
39
  const classnames_1 = __importDefault(require("classnames"));
29
- const LoadingBar = ({ as, hasRail = false, className, htmlAttributes, style, ref, }) => {
40
+ const LoadingBar = (_a) => {
41
+ var { as, hasRail = false, className, htmlAttributes, style, ref } = _a, restProps = __rest(_a, ["as", "hasRail", "className", "htmlAttributes", "style", "ref"]);
30
42
  const Component = as !== null && as !== void 0 ? as : 'div';
31
43
  const classes = (0, classnames_1.default)('ndl-loading-bar', className, {
32
44
  'ndl-loading-bar-rail': hasRail,
33
45
  });
34
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, role: "status", style: style }, htmlAttributes)));
46
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, role: "status", style: style }, restProps, htmlAttributes)));
35
47
  };
36
48
  exports.LoadingBar = LoadingBar;
37
49
  //# sourceMappingURL=LoadingBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../src/loading-bar/LoadingBar.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAS7B,MAAM,UAAU,GAAG,CAAsC,EAC9D,EAAE,EACF,OAAO,GAAG,KAAK,EACf,SAAS,EACT,cAAc,EACd,KAAK,EACL,GAAG,GACwC,EAAE,EAAE;IAC/C,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,sBAAsB,EAAE,OAAO;KAChC,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,IACR,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,UAAU,cAsBrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\ntype LoadingBarProps = {\n hasRail?: boolean;\n};\n\nexport const LoadingBar = <T extends React.ElementType = 'div'>({\n as,\n hasRail = false,\n className,\n htmlAttributes,\n style,\n ref,\n}: PolymorphicCommonProps<T, LoadingBarProps>) => {\n const Component: React.ElementType = as ?? 'div';\n const classes = classNames('ndl-loading-bar', className, {\n 'ndl-loading-bar-rail': hasRail,\n });\n\n return (\n <Component\n className={classes}\n ref={ref}\n role=\"status\"\n style={style}\n {...htmlAttributes}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../src/loading-bar/LoadingBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAS7B,MAAM,UAAU,GAAG,CAAsC,EAQnB,EAAE,EAAE;QARe,EAC9D,EAAE,EACF,OAAO,GAAG,KAAK,EACf,SAAS,EACT,cAAc,EACd,KAAK,EACL,GAAG,OAEwC,EADxC,SAAS,cAPkD,gEAQ/D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,sBAAsB,EAAE,OAAO;KAChC,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,UAAU,cAwBrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\ntype LoadingBarProps = {\n hasRail?: boolean;\n};\n\nexport const LoadingBar = <T extends React.ElementType = 'div'>({\n as,\n hasRail = false,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, LoadingBarProps>) => {\n const Component: React.ElementType = as ?? 'div';\n const classes = classNames('ndl-loading-bar', className, {\n 'ndl-loading-bar-rail': hasRail,\n });\n\n return (\n <Component\n className={classes}\n ref={ref}\n role=\"status\"\n style={style}\n {...restProps}\n {...htmlAttributes}\n />\n );\n};\n"]}
@@ -52,7 +52,7 @@ const LoadingSpinner = (_a) => {
52
52
  'ndl-medium': size === 'medium',
53
53
  'ndl-large': size === 'large',
54
54
  });
55
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, role: "status", "aria-label": "Loading content", "aria-live": "polite", ref: ref }, htmlAttributes, restProps, { children: (0, jsx_runtime_1.jsx)("div", { className: "ndl-spin" }) })));
55
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, role: "status", "aria-label": "Loading content", "aria-live": "polite", ref: ref }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsx)("div", { className: "ndl-spin" }) })));
56
56
  };
57
57
  exports.LoadingSpinner = LoadingSpinner;
58
58
  //# sourceMappingURL=LoadingSpinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/loading-spinner/LoadingSpinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAiBpC;;;;;;GAMG;AAEI,MAAM,cAAc,GAAG,CAAsC,EAOnB,EAAE,EAAE;QAPe,EAClE,EAAE,EACF,IAAI,GAAG,OAAO,EACd,SAAS,EACT,cAAc,EACd,GAAG,OAE4C,EAD5C,SAAS,cANsD,oDAOnE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,IAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,kBAAkB,EAAE,SAAS,EAAE;QACxD,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,eAClB,QAAQ,EAClB,GAAG,EAAE,GAAG,IACJ,cAAc,EACd,SAAS,cAEb,gCAAK,SAAS,EAAC,UAAU,GAAG,IAClB,CACb,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype LoadingSpinnerProps = {\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n *\n *\n * LoadingSpinner Component\n *\n *\n */\n\nexport const LoadingSpinner = <T extends React.ElementType = 'div'>({\n as,\n size = 'small',\n className,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, LoadingSpinnerProps>) => {\n const Component: React.ElementType = as || 'div';\n const classes = classNames('ndl-spin-wrapper', className, {\n 'ndl-small': size === 'small',\n 'ndl-medium': size === 'medium',\n 'ndl-large': size === 'large',\n });\n\n return (\n <Component\n className={classes}\n role=\"status\"\n aria-label=\"Loading content\"\n aria-live=\"polite\"\n ref={ref}\n {...htmlAttributes}\n {...restProps}\n >\n <div className=\"ndl-spin\" />\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/loading-spinner/LoadingSpinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAiBpC;;;;;;GAMG;AAEI,MAAM,cAAc,GAAG,CAAsC,EAOnB,EAAE,EAAE;QAPe,EAClE,EAAE,EACF,IAAI,GAAG,OAAO,EACd,SAAS,EACT,cAAc,EACd,GAAG,OAE4C,EAD5C,SAAS,cANsD,oDAOnE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,IAAI,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,kBAAkB,EAAE,SAAS,EAAE;QACxD,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,eAClB,QAAQ,EAClB,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAElB,gCAAK,SAAS,EAAC,UAAU,GAAG,IAClB,CACb,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype LoadingSpinnerProps = {\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n *\n *\n * LoadingSpinner Component\n *\n *\n */\n\nexport const LoadingSpinner = <T extends React.ElementType = 'div'>({\n as,\n size = 'small',\n className,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, LoadingSpinnerProps>) => {\n const Component: React.ElementType = as || 'div';\n const classes = classNames('ndl-spin-wrapper', className, {\n 'ndl-small': size === 'small',\n 'ndl-medium': size === 'medium',\n 'ndl-large': size === 'large',\n });\n\n return (\n <Component\n className={classes}\n role=\"status\"\n aria-label=\"Loading content\"\n aria-live=\"polite\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-spin\" />\n </Component>\n );\n};\n"]}
@@ -23,7 +23,7 @@
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.Icon = exports.Black = exports.Default = void 0;
25
25
  const index_1 = require("../../index");
26
- const _1 = require("./");
26
+ const _1 = require(".");
27
27
  const componentMeta = {
28
28
  title: 'Components/Logo',
29
29
  id: 'components-logo',
@@ -1 +1 @@
1
- {"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../../src/logo/stories/logo.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAmC;AACnC,yBAOY;AAEZ,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,iBAAiB;IACxB,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,YAAI;IACf,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;CAC0B,CAAC;AAE9B,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,YAAS;IACjB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAY;aACnB;SACF;KACF;CACF,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,WAAQ;IAChB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,cAAW;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Logo } from '../../index';\nimport {\n LogoBlack,\n LogoBlackSrc,\n LogoDefault,\n LogoDefaultSrc,\n LogoIcon,\n LogoIconSrc,\n} from './';\n\nconst componentMeta = {\n title: 'Components/Logo',\n id: 'components-logo',\n component: Logo,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n} satisfies Meta<typeof Logo>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoDefaultSrc,\n },\n },\n },\n};\n\nexport const Black: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoBlack,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoBlackSrc,\n },\n },\n },\n};\n\nexport const Icon: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoIcon,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoIconSrc,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../../src/logo/stories/logo.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAmC;AACnC,wBAOW;AAEX,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,iBAAiB;IACxB,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,YAAI;IACf,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;CAC0B,CAAC;AAE9B,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,cAAW;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAc;aACrB;SACF;KACF;CACF,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,YAAS;IACjB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAY;aACnB;SACF;KACF;CACF,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE,WAAQ;IAChB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,cAAW;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Logo } from '../../index';\nimport {\n LogoBlack,\n LogoBlackSrc,\n LogoDefault,\n LogoDefaultSrc,\n LogoIcon,\n LogoIconSrc,\n} from '.';\n\nconst componentMeta = {\n title: 'Components/Logo',\n id: 'components-logo',\n component: Logo,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n} satisfies Meta<typeof Logo>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoDefault,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoDefaultSrc,\n },\n },\n },\n};\n\nexport const Black: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoBlack,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoBlackSrc,\n },\n },\n },\n};\n\nexport const Icon: Story = {\n args: {\n className: undefined,\n color: undefined,\n type: undefined,\n },\n render: LogoIcon,\n parameters: {\n docs: {\n source: {\n language: 'tsx',\n type: 'code',\n code: LogoIconSrc,\n },\n },\n },\n};\n"]}
@@ -149,8 +149,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
149
149
  // This effect closes all menus when an item gets clicked anywhere
150
150
  // in the tree.
151
151
  (0, react_2.useEffect)(() => {
152
- if (!tree)
152
+ if (!tree) {
153
153
  return;
154
+ }
154
155
  function handleTreeClick(data) {
155
156
  if (controlledOpen === undefined) {
156
157
  setIsOpen(false);
@@ -204,7 +205,7 @@ const MenuItemComponent = (_a) => {
204
205
  'ndl-disabled': isDisabled,
205
206
  });
206
207
  const Component = as !== null && as !== void 0 ? as : 'button';
207
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, type: "button", role: "menuitem", disabled: isDisabled, style: style }, htmlAttributes, restProps, { children: (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-inner", children: [Boolean(leadingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-leading-content", children: leadingContent })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-title-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-title", children: title }), Boolean(description) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-description", children: description }))] }), Boolean(trailingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-trailing-content", children: trailingContent }))] }) })));
208
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, ref: ref, type: "button", role: "menuitem", disabled: isDisabled, style: style }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-inner", children: [Boolean(leadingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-leading-content", children: leadingContent })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-menu-item-title-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-title", children: title }), Boolean(description) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-description", children: description }))] }), Boolean(trailingContent) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-menu-item-trailing-content", children: trailingContent }))] }) })));
208
209
  };
209
210
  const MenuItem = ({ title, className, style, leadingVisual, trailingContent, description, isDisabled, as, onClick, onFocus, htmlAttributes, id, ref, }) => {
210
211
  const menu = (0, react_2.useContext)(MenuContext);
@@ -245,15 +246,17 @@ const NestedMenuItem = ({ title, isDisabled, description, leadingVisual, as, onF
245
246
  },
246
247
  })), { id: id }) }));
247
248
  };
248
- const CategoryItem = ({ children, className, style, as, htmlAttributes, ref, }) => {
249
+ const CategoryItem = (_a) => {
250
+ var { children, className, style, as, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "as", "htmlAttributes", "ref"]);
249
251
  const classes = (0, classnames_1.default)('ndl-menu-category-item', className);
250
252
  const Component = as !== null && as !== void 0 ? as : 'div';
251
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, { children: children })));
253
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: children })));
252
254
  };
253
- const MenuItems = ({ as, children, className, htmlAttributes, style, ref, }) => {
255
+ const MenuItems = (_a) => {
256
+ var { as, children, className, htmlAttributes, style, ref } = _a, restProps = __rest(_a, ["as", "children", "className", "htmlAttributes", "style", "ref"]);
254
257
  const classes = (0, classnames_1.default)('ndl-menu-items', className);
255
258
  const Component = as !== null && as !== void 0 ? as : 'div';
256
- return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, htmlAttributes, { children: children })));
259
+ return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: children })));
257
260
  };
258
261
  const Menu = Object.assign(MenuWrapper, {
259
262
  CategoryItem: CategoryItem,