@neo4j-ndl/react 4.3.6 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/lib/cjs/_common/types.js.map +1 -1
  2. package/lib/cjs/_common/utils.js +4 -4
  3. package/lib/cjs/_common/utils.js.map +1 -1
  4. package/lib/cjs/accordion/Accordion.js +5 -5
  5. package/lib/cjs/accordion/Accordion.js.map +1 -1
  6. package/lib/cjs/accordion/accordion-context.js +1 -1
  7. package/lib/cjs/accordion/accordion-context.js.map +1 -1
  8. package/lib/cjs/accordion/stories/accordion.stories.js +20 -20
  9. package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
  10. package/lib/cjs/ai/presence/Presence.js +1 -0
  11. package/lib/cjs/ai/presence/Presence.js.map +1 -1
  12. package/lib/cjs/avatar/stories/avatar.stories.js +18 -18
  13. package/lib/cjs/avatar/stories/avatar.stories.js.map +1 -1
  14. package/lib/cjs/banner/Banner.js +1 -1
  15. package/lib/cjs/banner/Banner.js.map +1 -1
  16. package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
  17. package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
  18. package/lib/cjs/checkbox/stories/checkbox-full.story.js +2 -2
  19. package/lib/cjs/checkbox/stories/checkbox-full.story.js.map +1 -1
  20. package/lib/cjs/checkbox/stories/checkbox.stories.js +19 -19
  21. package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
  22. package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
  23. package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
  24. package/lib/cjs/code-block/stories/code-disabled.story.js +2 -2
  25. package/lib/cjs/code-block/stories/code-disabled.story.js.map +1 -1
  26. package/lib/cjs/code-block/stories/code-full.story.js +2 -2
  27. package/lib/cjs/code-block/stories/code-full.story.js.map +1 -1
  28. package/lib/cjs/code-block/stories/code-with-actions.story.js +2 -2
  29. package/lib/cjs/code-block/stories/code-with-actions.story.js.map +1 -1
  30. package/lib/cjs/code-block/themes/ndl-code-dark.js +64 -64
  31. package/lib/cjs/code-block/themes/ndl-code-dark.js.map +1 -1
  32. package/lib/cjs/code-block/themes/ndl-code-light.js +64 -64
  33. package/lib/cjs/code-block/themes/ndl-code-light.js.map +1 -1
  34. package/lib/cjs/color-picker/ColorPicker.js +1 -1
  35. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  36. package/lib/cjs/color-picker/stories/color-picker.stories.js +4 -4
  37. package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -1
  38. package/lib/cjs/data-grid/Components.js +14 -12
  39. package/lib/cjs/data-grid/Components.js.map +1 -1
  40. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  41. package/lib/cjs/data-grid/data-grid-context.js +1 -1
  42. package/lib/cjs/data-grid/data-grid-context.js.map +1 -1
  43. package/lib/cjs/data-grid/data-grid-nav/index.js +1 -1
  44. package/lib/cjs/data-grid/data-grid-nav/index.js.map +1 -1
  45. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
  46. package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  47. package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js +0 -24
  48. package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
  49. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  50. package/lib/cjs/date-picker/stories/date-picker-full.story.js +9 -9
  51. package/lib/cjs/date-picker/stories/date-picker-full.story.js.map +1 -1
  52. package/lib/cjs/divider/stories/divider-horizontal.story.js +1 -1
  53. package/lib/cjs/divider/stories/divider-horizontal.story.js.map +1 -1
  54. package/lib/cjs/divider/stories/divider-vertical.story.js +1 -1
  55. package/lib/cjs/divider/stories/divider-vertical.story.js.map +1 -1
  56. package/lib/cjs/drawer/stories/drawer.stories.js +19 -19
  57. package/lib/cjs/drawer/stories/drawer.stories.js.map +1 -1
  58. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  59. package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js +18 -18
  60. package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
  61. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -1
  62. package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  63. package/lib/cjs/dropzone/stories/dropzone-full.story.js +11 -11
  64. package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
  65. package/lib/cjs/dropzone/stories/dropzone.stories.js +10 -10
  66. package/lib/cjs/dropzone/stories/dropzone.stories.js.map +1 -1
  67. package/lib/cjs/flex/Flex.js +4 -4
  68. package/lib/cjs/flex/Flex.js.map +1 -1
  69. package/lib/cjs/graph-label/stories/graph-label.stories.js +20 -20
  70. package/lib/cjs/graph-label/stories/graph-label.stories.js.map +1 -1
  71. package/lib/cjs/hooks/index.js +3 -3
  72. package/lib/cjs/hooks/index.js.map +1 -1
  73. package/lib/cjs/icon-button/stories/icon-button.stories.js +12 -12
  74. package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
  75. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +16 -16
  76. package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  77. package/lib/cjs/icon-button-base/IconButtonBase.js +5 -3
  78. package/lib/cjs/icon-button-base/IconButtonBase.js.map +1 -1
  79. package/lib/cjs/icons/generated/custom/DatabaseCross.js +1 -1
  80. package/lib/cjs/icons/generated/custom/DatabaseCross.js.map +1 -1
  81. package/lib/cjs/icons/generated/custom/DatabasePlus.js +1 -1
  82. package/lib/cjs/icons/generated/custom/DatabasePlus.js.map +1 -1
  83. package/lib/cjs/icons/generated/custom/GlobePin.js +1 -1
  84. package/lib/cjs/icons/generated/custom/GlobePin.js.map +1 -1
  85. package/lib/cjs/icons/generated/custom/PanelBottom.js +1 -1
  86. package/lib/cjs/icons/generated/custom/PanelBottom.js.map +1 -1
  87. package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js +30 -0
  88. package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
  89. package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js +30 -0
  90. package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
  91. package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js +30 -0
  92. package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
  93. package/lib/cjs/icons/generated/custom/PanelRightExpanded.js +30 -0
  94. package/lib/cjs/icons/generated/custom/PanelRightExpanded.js.map +1 -0
  95. package/lib/cjs/icons/generated/custom/ThreePanel.js +1 -1
  96. package/lib/cjs/icons/generated/custom/ThreePanel.js.map +1 -1
  97. package/lib/cjs/icons/generated/custom/index.js +9 -1
  98. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  99. package/lib/cjs/icons/wrapIcon.js +2 -2
  100. package/lib/cjs/icons/wrapIcon.js.map +1 -1
  101. package/lib/cjs/kbd/stories/kbd.stories.js +7 -7
  102. package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
  103. package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
  104. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
  105. package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js +10 -10
  106. package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
  107. package/lib/cjs/logo/Logo.js +6 -6
  108. package/lib/cjs/logo/Logo.js.map +1 -1
  109. package/lib/cjs/logo/stories/logo.stories.js +9 -9
  110. package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
  111. package/lib/cjs/menu/Menu.js +3 -3
  112. package/lib/cjs/menu/Menu.js.map +1 -1
  113. package/lib/cjs/menu/stories/menu-custom-items.story.js +3 -1
  114. package/lib/cjs/menu/stories/menu-custom-items.story.js.map +1 -1
  115. package/lib/cjs/menu/stories/menu-default.story.js +3 -1
  116. package/lib/cjs/menu/stories/menu-default.story.js.map +1 -1
  117. package/lib/cjs/menu/stories/menu-in-dialog.story.js +5 -1
  118. package/lib/cjs/menu/stories/menu-in-dialog.story.js.map +1 -1
  119. package/lib/cjs/menu/stories/menu-in-popover.story.js +3 -1
  120. package/lib/cjs/menu/stories/menu-in-popover.story.js.map +1 -1
  121. package/lib/cjs/menu/stories/menu-nested.story.js +3 -1
  122. package/lib/cjs/menu/stories/menu-nested.story.js.map +1 -1
  123. package/lib/cjs/menu/stories/menu-placements.story.js +3 -1
  124. package/lib/cjs/menu/stories/menu-placements.story.js.map +1 -1
  125. package/lib/cjs/menu/stories/menu-with-category.story.js +1 -2
  126. package/lib/cjs/menu/stories/menu-with-category.story.js.map +1 -1
  127. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js +1 -2
  128. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  129. package/lib/cjs/menu/stories/menu-with-divider.story.js +1 -2
  130. package/lib/cjs/menu/stories/menu-with-divider.story.js.map +1 -1
  131. package/lib/cjs/menu/stories/menu-with-icon.story.js +3 -1
  132. package/lib/cjs/menu/stories/menu-with-icon.story.js.map +1 -1
  133. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
  134. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  135. package/lib/cjs/popover/Popover.js +15 -15
  136. package/lib/cjs/popover/Popover.js.map +1 -1
  137. package/lib/cjs/popover/use-popover.js +9 -9
  138. package/lib/cjs/popover/use-popover.js.map +1 -1
  139. package/lib/cjs/progress-bar/stories/progress-bar.stories.js +3 -3
  140. package/lib/cjs/progress-bar/stories/progress-bar.stories.js.map +1 -1
  141. package/lib/cjs/segmented-control/SegmentedControl.js +1 -1
  142. package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
  143. package/lib/cjs/select/Overrides.js +41 -41
  144. package/lib/cjs/select/Overrides.js.map +1 -1
  145. package/lib/cjs/select/Select.js +25 -3
  146. package/lib/cjs/select/Select.js.map +1 -1
  147. package/lib/cjs/select/stories/select-async.story.js +4 -4
  148. package/lib/cjs/select/stories/select-async.story.js.map +1 -1
  149. package/lib/cjs/select/stories/select-controlled.story.js +4 -4
  150. package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
  151. package/lib/cjs/select/stories/select-creatable.story.js +1 -1
  152. package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
  153. package/lib/cjs/select/stories/select-custom-label.story.js +1 -1
  154. package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
  155. package/lib/cjs/select/stories/select-disabled.story.js +1 -1
  156. package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
  157. package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -1
  158. package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
  159. package/lib/cjs/side-navigation/SideNavigation.js +1 -1
  160. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  161. package/lib/cjs/side-navigation/stories/side-nav.stories.js +1 -1
  162. package/lib/cjs/side-navigation/stories/side-nav.stories.js.map +1 -1
  163. package/lib/cjs/skeleton/stories/skeleton.stories.js +28 -28
  164. package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
  165. package/lib/cjs/slider/Slider.js +2 -1
  166. package/lib/cjs/slider/Slider.js.map +1 -1
  167. package/lib/cjs/status-indicator/stories/status-indicator.stories.js +2 -2
  168. package/lib/cjs/status-indicator/stories/status-indicator.stories.js.map +1 -1
  169. package/lib/cjs/switch/stories/switch.stories.js +7 -7
  170. package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
  171. package/lib/cjs/tabs/Tabs.js +2 -2
  172. package/lib/cjs/tabs/Tabs.js.map +1 -1
  173. package/lib/cjs/tabs/stories/tabs-overflow.story.js +1 -1
  174. package/lib/cjs/tabs/stories/tabs-overflow.story.js.map +1 -1
  175. package/lib/cjs/tag/Tag.js +2 -2
  176. package/lib/cjs/tag/Tag.js.map +1 -1
  177. package/lib/cjs/tag/stories/tag.stories.js +10 -10
  178. package/lib/cjs/tag/stories/tag.stories.js.map +1 -1
  179. package/lib/cjs/text-area/TextArea.js +5 -5
  180. package/lib/cjs/text-area/TextArea.js.map +1 -1
  181. package/lib/cjs/text-area/stories/text-area.stories.js +25 -25
  182. package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
  183. package/lib/cjs/text-input/stories/text-input-number.story.js +2 -2
  184. package/lib/cjs/text-input/stories/text-input-number.story.js.map +1 -1
  185. package/lib/cjs/text-link/stories/text-link.stories.js +11 -11
  186. package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
  187. package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
  188. package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
  189. package/lib/cjs/theme/ThemeProvider.js.map +1 -1
  190. package/lib/cjs/theme/agnostic.js +1 -1
  191. package/lib/cjs/theme/agnostic.js.map +1 -1
  192. package/lib/cjs/time-picker/TimePicker.js +4 -4
  193. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  194. package/lib/cjs/time-picker/time-picker-hooks.js +1 -1
  195. package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -1
  196. package/lib/cjs/timezone-picker/TimeZonePicker.js +5 -5
  197. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  198. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
  199. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  200. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  201. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  202. package/lib/cjs/toast/Toast.js +12 -12
  203. package/lib/cjs/toast/Toast.js.map +1 -1
  204. package/lib/cjs/toast/stories/toast-action-story.js +1 -1
  205. package/lib/cjs/toast/stories/toast-action-story.js.map +1 -1
  206. package/lib/cjs/toast/stories/toast-controlled-story.js +2 -2
  207. package/lib/cjs/toast/stories/toast-controlled-story.js.map +1 -1
  208. package/lib/cjs/toast/stories/toast-progress-bar.js +1 -1
  209. package/lib/cjs/toast/stories/toast-progress-bar.js.map +1 -1
  210. package/lib/cjs/toast/stories/toast.stories.js +18 -18
  211. package/lib/cjs/toast/stories/toast.stories.js.map +1 -1
  212. package/lib/cjs/tooltip/Tooltip.js +1 -1
  213. package/lib/cjs/tooltip/Tooltip.js.map +1 -1
  214. package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js +1 -1
  215. package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
  216. package/lib/cjs/tooltip/stories/tooltip-placements.story.js +8 -8
  217. package/lib/cjs/tooltip/stories/tooltip-placements.story.js.map +1 -1
  218. package/lib/cjs/tooltip/stories/tooltip.stories.js +29 -29
  219. package/lib/cjs/tooltip/stories/tooltip.stories.js.map +1 -1
  220. package/lib/cjs/tooltip/use-tooltip.js +10 -10
  221. package/lib/cjs/tooltip/use-tooltip.js.map +1 -1
  222. package/lib/cjs/tree-view/TreeItemWrapper.js +2 -2
  223. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  224. package/lib/cjs/tree-view/TreeView.js +12 -12
  225. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  226. package/lib/cjs/tree-view/TreeViewItem.js +1 -1
  227. package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
  228. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
  229. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  230. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js +2 -2
  231. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  232. package/lib/cjs/wizard/Wizard.js +3 -3
  233. package/lib/cjs/wizard/Wizard.js.map +1 -1
  234. package/lib/cjs/wizard/stories/wizard.stories.js +14 -14
  235. package/lib/cjs/wizard/stories/wizard.stories.js.map +1 -1
  236. package/lib/esm/_common/types.js.map +1 -1
  237. package/lib/esm/_common/utils.js +4 -4
  238. package/lib/esm/_common/utils.js.map +1 -1
  239. package/lib/esm/accordion/Accordion.js +5 -5
  240. package/lib/esm/accordion/Accordion.js.map +1 -1
  241. package/lib/esm/accordion/accordion-context.js +1 -1
  242. package/lib/esm/accordion/accordion-context.js.map +1 -1
  243. package/lib/esm/accordion/stories/accordion.stories.js +20 -20
  244. package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
  245. package/lib/esm/ai/presence/Presence.js +1 -0
  246. package/lib/esm/ai/presence/Presence.js.map +1 -1
  247. package/lib/esm/avatar/stories/avatar.stories.js +18 -18
  248. package/lib/esm/avatar/stories/avatar.stories.js.map +1 -1
  249. package/lib/esm/banner/Banner.js +1 -1
  250. package/lib/esm/banner/Banner.js.map +1 -1
  251. package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
  252. package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
  253. package/lib/esm/checkbox/stories/checkbox-full.story.js +2 -2
  254. package/lib/esm/checkbox/stories/checkbox-full.story.js.map +1 -1
  255. package/lib/esm/checkbox/stories/checkbox.stories.js +19 -19
  256. package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
  257. package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
  258. package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
  259. package/lib/esm/code-block/stories/code-disabled.story.js +2 -2
  260. package/lib/esm/code-block/stories/code-disabled.story.js.map +1 -1
  261. package/lib/esm/code-block/stories/code-full.story.js +2 -2
  262. package/lib/esm/code-block/stories/code-full.story.js.map +1 -1
  263. package/lib/esm/code-block/stories/code-with-actions.story.js +2 -2
  264. package/lib/esm/code-block/stories/code-with-actions.story.js.map +1 -1
  265. package/lib/esm/code-block/themes/ndl-code-dark.js +64 -64
  266. package/lib/esm/code-block/themes/ndl-code-dark.js.map +1 -1
  267. package/lib/esm/code-block/themes/ndl-code-light.js +64 -64
  268. package/lib/esm/code-block/themes/ndl-code-light.js.map +1 -1
  269. package/lib/esm/color-picker/ColorPicker.js +1 -1
  270. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  271. package/lib/esm/color-picker/stories/color-picker.stories.js +4 -4
  272. package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -1
  273. package/lib/esm/data-grid/Components.js +14 -12
  274. package/lib/esm/data-grid/Components.js.map +1 -1
  275. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  276. package/lib/esm/data-grid/data-grid-context.js +1 -1
  277. package/lib/esm/data-grid/data-grid-context.js.map +1 -1
  278. package/lib/esm/data-grid/data-grid-nav/index.js +1 -1
  279. package/lib/esm/data-grid/data-grid-nav/index.js.map +1 -1
  280. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
  281. package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
  282. package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js +0 -24
  283. package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
  284. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  285. package/lib/esm/date-picker/stories/date-picker-full.story.js +9 -9
  286. package/lib/esm/date-picker/stories/date-picker-full.story.js.map +1 -1
  287. package/lib/esm/divider/stories/divider-horizontal.story.js +1 -1
  288. package/lib/esm/divider/stories/divider-horizontal.story.js.map +1 -1
  289. package/lib/esm/divider/stories/divider-vertical.story.js +1 -1
  290. package/lib/esm/divider/stories/divider-vertical.story.js.map +1 -1
  291. package/lib/esm/drawer/stories/drawer.stories.js +19 -19
  292. package/lib/esm/drawer/stories/drawer.stories.js.map +1 -1
  293. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  294. package/lib/esm/dropdown-button/stories/dropdown-button.stories.js +18 -18
  295. package/lib/esm/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
  296. package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -1
  297. package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
  298. package/lib/esm/dropzone/stories/dropzone-full.story.js +11 -11
  299. package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
  300. package/lib/esm/dropzone/stories/dropzone.stories.js +10 -10
  301. package/lib/esm/dropzone/stories/dropzone.stories.js.map +1 -1
  302. package/lib/esm/flex/Flex.js +4 -4
  303. package/lib/esm/flex/Flex.js.map +1 -1
  304. package/lib/esm/graph-label/stories/graph-label.stories.js +20 -20
  305. package/lib/esm/graph-label/stories/graph-label.stories.js.map +1 -1
  306. package/lib/esm/hooks/index.js +3 -3
  307. package/lib/esm/hooks/index.js.map +1 -1
  308. package/lib/esm/icon-button/stories/icon-button.stories.js +12 -12
  309. package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
  310. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +16 -16
  311. package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
  312. package/lib/esm/icon-button-base/IconButtonBase.js +5 -3
  313. package/lib/esm/icon-button-base/IconButtonBase.js.map +1 -1
  314. package/lib/esm/icons/generated/custom/DatabaseCross.js +2 -2
  315. package/lib/esm/icons/generated/custom/DatabaseCross.js.map +1 -1
  316. package/lib/esm/icons/generated/custom/DatabasePlus.js +1 -1
  317. package/lib/esm/icons/generated/custom/DatabasePlus.js.map +1 -1
  318. package/lib/esm/icons/generated/custom/GlobePin.js +1 -1
  319. package/lib/esm/icons/generated/custom/GlobePin.js.map +1 -1
  320. package/lib/esm/icons/generated/custom/PanelBottom.js +1 -1
  321. package/lib/esm/icons/generated/custom/PanelBottom.js.map +1 -1
  322. package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js +28 -0
  323. package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
  324. package/lib/esm/icons/generated/custom/PanelLeftExpanded.js +28 -0
  325. package/lib/esm/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
  326. package/lib/esm/icons/generated/custom/PanelRightCollapsed.js +28 -0
  327. package/lib/esm/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
  328. package/lib/esm/icons/generated/custom/PanelRightExpanded.js +28 -0
  329. package/lib/esm/icons/generated/custom/PanelRightExpanded.js.map +1 -0
  330. package/lib/esm/icons/generated/custom/ThreePanel.js +1 -1
  331. package/lib/esm/icons/generated/custom/ThreePanel.js.map +1 -1
  332. package/lib/esm/icons/generated/custom/index.js +4 -0
  333. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  334. package/lib/esm/icons/wrapIcon.js +2 -2
  335. package/lib/esm/icons/wrapIcon.js.map +1 -1
  336. package/lib/esm/kbd/stories/kbd.stories.js +7 -7
  337. package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
  338. package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
  339. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
  340. package/lib/esm/loading-spinner/stories/loading-spinner.stories.js +10 -10
  341. package/lib/esm/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
  342. package/lib/esm/logo/Logo.js +6 -6
  343. package/lib/esm/logo/Logo.js.map +1 -1
  344. package/lib/esm/logo/stories/logo.stories.js +9 -9
  345. package/lib/esm/logo/stories/logo.stories.js.map +1 -1
  346. package/lib/esm/menu/Menu.js +3 -3
  347. package/lib/esm/menu/Menu.js.map +1 -1
  348. package/lib/esm/menu/stories/menu-custom-items.story.js +3 -1
  349. package/lib/esm/menu/stories/menu-custom-items.story.js.map +1 -1
  350. package/lib/esm/menu/stories/menu-default.story.js +3 -1
  351. package/lib/esm/menu/stories/menu-default.story.js.map +1 -1
  352. package/lib/esm/menu/stories/menu-in-dialog.story.js +5 -1
  353. package/lib/esm/menu/stories/menu-in-dialog.story.js.map +1 -1
  354. package/lib/esm/menu/stories/menu-in-popover.story.js +3 -1
  355. package/lib/esm/menu/stories/menu-in-popover.story.js.map +1 -1
  356. package/lib/esm/menu/stories/menu-nested.story.js +3 -1
  357. package/lib/esm/menu/stories/menu-nested.story.js.map +1 -1
  358. package/lib/esm/menu/stories/menu-placements.story.js +3 -1
  359. package/lib/esm/menu/stories/menu-placements.story.js.map +1 -1
  360. package/lib/esm/menu/stories/menu-with-category.story.js +1 -2
  361. package/lib/esm/menu/stories/menu-with-category.story.js.map +1 -1
  362. package/lib/esm/menu/stories/menu-with-disabled-item.story.js +1 -2
  363. package/lib/esm/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  364. package/lib/esm/menu/stories/menu-with-divider.story.js +1 -2
  365. package/lib/esm/menu/stories/menu-with-divider.story.js.map +1 -1
  366. package/lib/esm/menu/stories/menu-with-icon.story.js +3 -1
  367. package/lib/esm/menu/stories/menu-with-icon.story.js.map +1 -1
  368. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
  369. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  370. package/lib/esm/popover/Popover.js +15 -15
  371. package/lib/esm/popover/Popover.js.map +1 -1
  372. package/lib/esm/popover/use-popover.js +9 -9
  373. package/lib/esm/popover/use-popover.js.map +1 -1
  374. package/lib/esm/progress-bar/stories/progress-bar.stories.js +3 -3
  375. package/lib/esm/progress-bar/stories/progress-bar.stories.js.map +1 -1
  376. package/lib/esm/segmented-control/SegmentedControl.js +1 -1
  377. package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
  378. package/lib/esm/select/Overrides.js +41 -41
  379. package/lib/esm/select/Overrides.js.map +1 -1
  380. package/lib/esm/select/Select.js +26 -4
  381. package/lib/esm/select/Select.js.map +1 -1
  382. package/lib/esm/select/stories/select-async.story.js +4 -4
  383. package/lib/esm/select/stories/select-async.story.js.map +1 -1
  384. package/lib/esm/select/stories/select-controlled.story.js +4 -4
  385. package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
  386. package/lib/esm/select/stories/select-creatable.story.js +1 -1
  387. package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
  388. package/lib/esm/select/stories/select-custom-label.story.js +1 -1
  389. package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
  390. package/lib/esm/select/stories/select-disabled.story.js +1 -1
  391. package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
  392. package/lib/esm/select/stories/select-inside-dialog.story.js +1 -1
  393. package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
  394. package/lib/esm/side-navigation/SideNavigation.js +1 -1
  395. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  396. package/lib/esm/side-navigation/stories/side-nav.stories.js +1 -1
  397. package/lib/esm/side-navigation/stories/side-nav.stories.js.map +1 -1
  398. package/lib/esm/skeleton/stories/skeleton.stories.js +28 -28
  399. package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
  400. package/lib/esm/slider/Slider.js +2 -1
  401. package/lib/esm/slider/Slider.js.map +1 -1
  402. package/lib/esm/status-indicator/stories/status-indicator.stories.js +2 -2
  403. package/lib/esm/status-indicator/stories/status-indicator.stories.js.map +1 -1
  404. package/lib/esm/switch/stories/switch.stories.js +7 -7
  405. package/lib/esm/switch/stories/switch.stories.js.map +1 -1
  406. package/lib/esm/tabs/Tabs.js +2 -2
  407. package/lib/esm/tabs/Tabs.js.map +1 -1
  408. package/lib/esm/tabs/stories/tabs-overflow.story.js +1 -1
  409. package/lib/esm/tabs/stories/tabs-overflow.story.js.map +1 -1
  410. package/lib/esm/tag/Tag.js +2 -2
  411. package/lib/esm/tag/Tag.js.map +1 -1
  412. package/lib/esm/tag/stories/tag.stories.js +10 -10
  413. package/lib/esm/tag/stories/tag.stories.js.map +1 -1
  414. package/lib/esm/text-area/TextArea.js +5 -5
  415. package/lib/esm/text-area/TextArea.js.map +1 -1
  416. package/lib/esm/text-area/stories/text-area.stories.js +25 -25
  417. package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
  418. package/lib/esm/text-input/stories/text-input-number.story.js +2 -2
  419. package/lib/esm/text-input/stories/text-input-number.story.js.map +1 -1
  420. package/lib/esm/text-link/stories/text-link.stories.js +11 -11
  421. package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
  422. package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
  423. package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
  424. package/lib/esm/theme/ThemeProvider.js.map +1 -1
  425. package/lib/esm/theme/agnostic.js +1 -1
  426. package/lib/esm/theme/agnostic.js.map +1 -1
  427. package/lib/esm/time-picker/TimePicker.js +4 -4
  428. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  429. package/lib/esm/time-picker/time-picker-hooks.js +1 -1
  430. package/lib/esm/time-picker/time-picker-hooks.js.map +1 -1
  431. package/lib/esm/timezone-picker/TimeZonePicker.js +5 -5
  432. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  433. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
  434. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  435. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  436. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  437. package/lib/esm/toast/Toast.js +12 -12
  438. package/lib/esm/toast/Toast.js.map +1 -1
  439. package/lib/esm/toast/stories/toast-action-story.js +1 -1
  440. package/lib/esm/toast/stories/toast-action-story.js.map +1 -1
  441. package/lib/esm/toast/stories/toast-controlled-story.js +2 -2
  442. package/lib/esm/toast/stories/toast-controlled-story.js.map +1 -1
  443. package/lib/esm/toast/stories/toast-progress-bar.js +1 -1
  444. package/lib/esm/toast/stories/toast-progress-bar.js.map +1 -1
  445. package/lib/esm/toast/stories/toast.stories.js +18 -18
  446. package/lib/esm/toast/stories/toast.stories.js.map +1 -1
  447. package/lib/esm/tooltip/Tooltip.js +1 -1
  448. package/lib/esm/tooltip/Tooltip.js.map +1 -1
  449. package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js +1 -1
  450. package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
  451. package/lib/esm/tooltip/stories/tooltip-placements.story.js +8 -8
  452. package/lib/esm/tooltip/stories/tooltip-placements.story.js.map +1 -1
  453. package/lib/esm/tooltip/stories/tooltip.stories.js +29 -29
  454. package/lib/esm/tooltip/stories/tooltip.stories.js.map +1 -1
  455. package/lib/esm/tooltip/use-tooltip.js +10 -10
  456. package/lib/esm/tooltip/use-tooltip.js.map +1 -1
  457. package/lib/esm/tree-view/TreeItemWrapper.js +2 -2
  458. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  459. package/lib/esm/tree-view/TreeView.js +12 -12
  460. package/lib/esm/tree-view/TreeView.js.map +1 -1
  461. package/lib/esm/tree-view/TreeViewItem.js +1 -1
  462. package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
  463. package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
  464. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  465. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js +2 -2
  466. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  467. package/lib/esm/wizard/Wizard.js +3 -3
  468. package/lib/esm/wizard/Wizard.js.map +1 -1
  469. package/lib/esm/wizard/stories/wizard.stories.js +14 -14
  470. package/lib/esm/wizard/stories/wizard.stories.js.map +1 -1
  471. package/lib/types/accordion/stories/accordion.stories.d.ts +3 -3
  472. package/lib/types/ai/presence/Presence.d.ts.map +1 -1
  473. package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +1 -1
  474. package/lib/types/data-grid/Components.d.ts.map +1 -1
  475. package/lib/types/data-grid/stories/datagrid-single-selectable.story.d.ts.map +1 -1
  476. package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
  477. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  478. package/lib/types/icon-button-base/IconButtonBase.d.ts.map +1 -1
  479. package/lib/types/icons/generated/custom/DatabaseCross.d.ts.map +1 -1
  480. package/lib/types/icons/generated/custom/DatabasePlus.d.ts.map +1 -1
  481. package/lib/types/icons/generated/custom/GlobePin.d.ts.map +1 -1
  482. package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts +29 -0
  483. package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts.map +1 -0
  484. package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts +29 -0
  485. package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts.map +1 -0
  486. package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts +29 -0
  487. package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts.map +1 -0
  488. package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts +29 -0
  489. package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts.map +1 -0
  490. package/lib/types/icons/generated/custom/index.d.ts +4 -0
  491. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  492. package/lib/types/icons/wrapIcon.d.ts.map +1 -1
  493. package/lib/types/logo/stories/logo.stories.d.ts +3 -3
  494. package/lib/types/menu/stories/menu-custom-items.story.d.ts.map +1 -1
  495. package/lib/types/menu/stories/menu-default.story.d.ts.map +1 -1
  496. package/lib/types/menu/stories/menu-in-dialog.story.d.ts.map +1 -1
  497. package/lib/types/menu/stories/menu-in-popover.story.d.ts.map +1 -1
  498. package/lib/types/menu/stories/menu-nested.story.d.ts.map +1 -1
  499. package/lib/types/menu/stories/menu-placements.story.d.ts.map +1 -1
  500. package/lib/types/menu/stories/menu-with-category.story.d.ts.map +1 -1
  501. package/lib/types/menu/stories/menu-with-disabled-item.story.d.ts.map +1 -1
  502. package/lib/types/menu/stories/menu-with-divider.story.d.ts.map +1 -1
  503. package/lib/types/menu/stories/menu-with-icon.story.d.ts.map +1 -1
  504. package/lib/types/menu/stories/menu-with-keyboard-shortcuts.story.d.ts.map +1 -1
  505. package/lib/types/select/Select.d.ts.map +1 -1
  506. package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
  507. package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
  508. package/lib/types/skeleton/stories/skeleton.stories.d.ts +3 -3
  509. package/lib/types/slider/Slider.d.ts.map +1 -1
  510. package/lib/types/tabs/Tabs.d.ts.map +1 -1
  511. package/lib/types/tabs/stories/tabs-overflow.story.d.ts.map +1 -1
  512. package/lib/types/time-picker/time-picker-hooks.d.ts +1 -1
  513. package/lib/types/time-picker/time-picker-hooks.d.ts.map +1 -1
  514. package/lib/types/toast/stories/toast.stories.d.ts +2 -2
  515. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../src/wizard/Wizard.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,+CAAyC;AAGzC,8CAA2C;AA+CpC,MAAM,MAAM,GAAG,CAAsC,EAC1D,EAAE,EACF,SAAS,EACT,KAAK,EACL,IAAI,GAAG,OAAO,EACd,KAAK,EACL,eAAe,EACf,WAAW,EACX,cAAc,EACd,SAAS,GAAG,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EACzD,GAAG,GACoC,EAAE,EAAE;IAC3C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,eAAe,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YAC9D,OAAO,CAAC,IAAI,CACV,uFAAuF,eAAe,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACrJ,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,CACL,uBAAC,mBAAW,IACV,EAAE,EAAE,EAAE,EACN,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,E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AAI,MAAM,KAAK,QAAQ;QACxE,4BAA4B,EAAE,MAAM,KAAK,YAAY;QACrD,yBAAyB,EAAE,MAAM,KAAK,OAAO;KAC9C,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,IAAA,oBAAU,EAAC,mBAAmB,EAAE;QACzD,CAAC,oBAAoB,SAAS,EAAE,CAAC,EAAE,SAAS;KAC7C,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,SAAS,EAAE,kBAAkB,YAChC,4CACG,MAAM,KAAK,QAAQ,IAAI,CACtB,wCACE,mCACE,SAAS,EAAC,4BAA4B,EACtC,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,EAAE,EAC9C,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,GACN,GACA,CACL,EAED,mCAAQ,SAAS,EAAE,kBAAkB,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EAChE,iCACE,CAAC,EAAC,KAAK,EACP,CAAC,EAAC,KAAK,EACP,QAAQ,EAAE,EAAE,EACZ,SAAS,EAAC,wBAAwB,EAClC,UAAU,EAAC,QAAQ,EACnB,gBAAgB,EAAC,QAAQ,EACzB,EAAE,EAAC,OAAO,YAET,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAC7B,IACH,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport React, { useEffect } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { Typography } from '../typography';\n\ninterface Step {\n /** Content displayed as the step label */\n content: React.ReactNode;\n /** Explicit status for the step. When set to `error`, the step is rendered in an error state */\n status?: 'default' | 'error';\n}\n\ninterface BaseWizardProps {\n /** Layout orientation of the wizard */\n orientation?: 'horizontal' | 'vertical';\n /** Visual size of the wizard */\n size?: 'small' | 'large';\n /** Additional style */\n style?: React.CSSProperties;\n /** Additional class name */\n className?: string;\n /** Zero-based index of the active step */\n activeStepIndex: number;\n /** Steps to display in the wizard */\n steps: Step[];\n}\n\ntype HorizontalWizardProps = BaseWizardProps & {\n orientation: 'horizontal';\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: 'middle';\n};\n\ntype VerticalWizardProps = BaseWizardProps & {\n orientation: 'vertical';\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: 'top' | 'middle';\n};\n\ntype NonOrientationWizardProps = BaseWizardProps & {\n orientation: undefined;\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: never;\n};\n\ntype WizardProps =\n | HorizontalWizardProps\n | VerticalWizardProps\n | NonOrientationWizardProps;\n\nexport const Wizard = <T extends React.ElementType = 'div'>({\n as,\n className,\n style,\n size = 'large',\n steps,\n activeStepIndex,\n orientation,\n htmlAttributes,\n alignment = orientation === 'vertical' ? 'top' : 'middle',\n ref,\n}: PolymorphicCommonProps<T, WizardProps>) => {\n useEffect(() => {\n if (activeStepIndex > steps.length - 1 || activeStepIndex < 0) {\n console.warn(\n `[🪡 Needle]: The activeStepIndex in Wizard is out of bounds. The activeStepIndex is ${activeStepIndex} and the number of steps is ${steps.length}.`,\n );\n }\n }, [activeStepIndex, steps.length]);\n\n switch (size) {\n case 'small':\n return (\n <WizardSmall\n as={as}\n orientation={orientation}\n style={style}\n className={className}\n steps={steps}\n activeStepIndex={activeStepIndex}\n ref={ref}\n htmlAttributes={htmlAttributes}\n alignment={alignment}\n />\n );\n case 'large':\n return (\n <WizardLarge\n as={as}\n orientation={orientation}\n style={style}\n className={className}\n steps={steps}\n activeStepIndex={activeStepIndex}\n ref={ref}\n htmlAttributes={htmlAttributes}\n alignment={alignment}\n />\n );\n }\n};\n\nconst getStatus = (activeStepIndex: number, stepIndex: number) =>\n stepIndex === activeStepIndex\n ? 'active'\n : activeStepIndex < stepIndex\n ? 'incomplete'\n : 'complete';\n\nconst WizardLarge = <T extends React.ElementType = 'div'>({\n orientation = 'horizontal',\n activeStepIndex,\n steps,\n as,\n style,\n className,\n htmlAttributes,\n alignment,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, Omit<WizardProps, 'size'>>) => {\n const Component: React.ElementType = as || 'div';\n\n const wizardClasses = classNames(\n 'ndl-wizard',\n 'ndl-wizard-large',\n {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n [`ndl-wizard-align-${alignment}`]: alignment,\n },\n className,\n );\n\n const componentStyle = {\n gridTemplateColumns:\n orientation === 'horizontal'\n ? `repeat(${steps.length}, 1fr)`\n : `32px 1fr`,\n\n gridTemplateRows:\n orientation === 'vertical' && `repeat(${steps.length}, 1fr)`,\n };\n\n const stepClasses = (index: number, step: Step) => {\n const status = getStatus(activeStepIndex, index);\n\n return classNames('ndl-wizard-step', {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-wizard-step-line-right': index < steps.length - 1,\n 'ndl-wizard-step-line-left': index > 0,\n 'ndl-wizard-step-complete': status === 'complete',\n 'ndl-wizard-step-active': status === 'active',\n 'ndl-wizard-step-error': step.status === 'error',\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n };\n\n return (\n <Component\n className={wizardClasses}\n style={{ ...style, ...componentStyle }}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {/* iterate over the steps to render the text content (the first row of the component)*/}\n {steps.map((step, index) => {\n if (typeof step.content === 'string') {\n const wizardStepClasses = classNames('ndl-wizard-step-text', {\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-horizontal': orientation === 'horizontal',\n [`ndl-wizard-align-${alignment}`]: alignment,\n 'ndl-wizard-step-incomplete':\n getStatus(activeStepIndex, index) === 'incomplete',\n });\n\n return (\n <div key={index} className={wizardStepClasses}>\n <Typography variant=\"body-large\">{step.content}</Typography>\n </div>\n );\n } else {\n return <React.Fragment key={index}>{step.content}</React.Fragment>;\n }\n })}\n {/* iterate over the steps to render the circles (iterates again to render the second row of the component) */}\n {steps.map((step, index) => {\n return (\n <div\n className={stepClasses(index, step)}\n key={index}\n style={{\n gridRow: orientation === 'vertical' ? index + 1 : '',\n }}\n >\n <Circle\n status={\n step.status === 'error'\n ? 'error'\n : getStatus(activeStepIndex, index)\n }\n number={index + 1}\n text={step.content}\n alignment={alignment}\n />\n </div>\n );\n })}\n </Component>\n );\n};\n\nexport const WizardSmall = <T extends React.ElementType = 'div'>({\n orientation = 'horizontal',\n activeStepIndex,\n steps,\n as,\n className,\n htmlAttributes,\n style,\n alignment = 'middle',\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, Omit<WizardProps, 'size'>>) => {\n const Component = as ?? 'div';\n\n const wizardClasses = classNames(\n 'ndl-wizard',\n 'ndl-wizard-small',\n {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n [`ndl-wizard-align-${alignment}`]: alignment,\n },\n className,\n );\n\n const stepClasses = (index: number) =>\n classNames('ndl-wizard-step', {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-wizard-step-active': getStatus(activeStepIndex, index) === 'active',\n 'ndl-wizard-step-complete':\n getStatus(activeStepIndex, index) === 'complete',\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n\n return (\n <Component\n className={wizardClasses}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-wizard-steps-line\" />\n {steps.map((step, index) => {\n return (\n <div key={index} className={stepClasses(index)}>\n <div className=\"ndl-wizard-circle\"></div>\n </div>\n );\n })}\n <div className=\"ndl-wizard-steps-line\" />\n </Component>\n );\n};\n\nconst Circle = ({\n status,\n number,\n alignment = 'middle',\n}: {\n status: 'active' | 'complete' | 'incomplete' | 'error';\n number: number;\n text: React.ReactNode;\n alignment?: 'top' | 'middle';\n}) => {\n const innerCircleClasses = classNames({\n 'n-fill-primary-bg-strong': status === 'complete' || status === 'active',\n 'n-fill-neutral-bg-stronger': status === 'incomplete',\n 'n-fill-danger-bg-strong': status === 'error',\n });\n const outerCircleClasses = classNames('ndl-wizard-circle', {\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n\n return (\n <div className={outerCircleClasses}>\n <svg>\n {status === 'active' && (\n <g>\n <circle\n className=\"n-stroke-primary-bg-strong\"\n style={{ fill: 'transparent', strokeWidth: 2 }}\n cx=\"16\"\n cy=\"16\"\n r=\"14\"\n />\n </g>\n )}\n\n <circle className={innerCircleClasses} cx=\"16\" cy=\"16\" r=\"12\" />\n <text\n x=\"50%\"\n y=\"50%\"\n fontSize={14}\n className=\"n-fill-neutral-bg-weak\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n dy=\"0.1em\"\n >\n {status === 'error' ? '!' : number}\n </text>\n </svg>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../src/wizard/Wizard.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAA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EAAE,EAC9C,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,GACN,GACA,CACL,EAED,mCAAQ,SAAS,EAAE,kBAAkB,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EAChE,iCACE,CAAC,EAAC,KAAK,EACP,CAAC,EAAC,KAAK,EACP,QAAQ,EAAE,EAAE,EACZ,SAAS,EAAC,wBAAwB,EAClC,UAAU,EAAC,QAAQ,EACnB,gBAAgB,EAAC,QAAQ,EACzB,EAAE,EAAC,OAAO,YAET,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAC7B,IACH,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport React, { useEffect } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { Typography } from '../typography';\n\ninterface Step {\n /** Content displayed as the step label */\n content: React.ReactNode;\n /** Explicit status for the step. When set to `error`, the step is rendered in an error state */\n status?: 'default' | 'error';\n}\n\ninterface BaseWizardProps {\n /** Layout orientation of the wizard */\n orientation?: 'horizontal' | 'vertical';\n /** Visual size of the wizard */\n size?: 'small' | 'large';\n /** Additional style */\n style?: React.CSSProperties;\n /** Additional class name */\n className?: string;\n /** Zero-based index of the active step */\n activeStepIndex: number;\n /** Steps to display in the wizard */\n steps: Step[];\n}\n\ntype HorizontalWizardProps = BaseWizardProps & {\n orientation: 'horizontal';\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: 'middle';\n};\n\ntype VerticalWizardProps = BaseWizardProps & {\n orientation: 'vertical';\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: 'top' | 'middle';\n};\n\ntype NonOrientationWizardProps = BaseWizardProps & {\n orientation: undefined;\n /** Alignment of labels/content, is set to `middle` for horizontal orientation and can be set to `top` or `middle` for vertical orientation and is not applicable when `orientation` is undefined */\n alignment?: never;\n};\n\ntype WizardProps =\n | HorizontalWizardProps\n | VerticalWizardProps\n | NonOrientationWizardProps;\n\nexport const Wizard = <T extends React.ElementType = 'div'>({\n as,\n className,\n style,\n size = 'large',\n steps,\n activeStepIndex,\n orientation,\n htmlAttributes,\n alignment = orientation === 'vertical' ? 'top' : 'middle',\n ref,\n}: PolymorphicCommonProps<T, WizardProps>) => {\n useEffect(() => {\n if (activeStepIndex > steps.length - 1 || activeStepIndex < 0) {\n console.warn(\n `[🪡 Needle]: The activeStepIndex in Wizard is out of bounds. The activeStepIndex is ${activeStepIndex} and the number of steps is ${steps.length}.`,\n );\n }\n }, [activeStepIndex, steps.length]);\n\n switch (size) {\n case 'small':\n return (\n <WizardSmall\n as={as}\n orientation={orientation}\n style={style}\n className={className}\n steps={steps}\n activeStepIndex={activeStepIndex}\n ref={ref}\n htmlAttributes={htmlAttributes}\n alignment={alignment}\n />\n );\n case 'large':\n return (\n <WizardLarge\n as={as}\n orientation={orientation}\n style={style}\n className={className}\n steps={steps}\n activeStepIndex={activeStepIndex}\n ref={ref}\n htmlAttributes={htmlAttributes}\n alignment={alignment}\n />\n );\n }\n};\n\nconst getStatus = (activeStepIndex: number, stepIndex: number) =>\n stepIndex === activeStepIndex\n ? 'active'\n : activeStepIndex < stepIndex\n ? 'incomplete'\n : 'complete';\n\nconst WizardLarge = <T extends React.ElementType = 'div'>({\n orientation = 'horizontal',\n activeStepIndex,\n steps,\n as,\n style,\n className,\n htmlAttributes,\n alignment,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, Omit<WizardProps, 'size'>>) => {\n const Component: React.ElementType = as || 'div';\n\n const wizardClasses = classNames(\n 'ndl-wizard',\n 'ndl-wizard-large',\n {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n [`ndl-wizard-align-${alignment}`]: alignment,\n },\n className,\n );\n\n const componentStyle = {\n gridTemplateColumns:\n orientation === 'horizontal'\n ? `repeat(${steps.length}, 1fr)`\n : `32px 1fr`,\n\n gridTemplateRows:\n orientation === 'vertical' && `repeat(${steps.length}, 1fr)`,\n };\n\n const stepClasses = (index: number, step: Step) => {\n const status = getStatus(activeStepIndex, index);\n\n return classNames('ndl-wizard-step', {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-wizard-step-line-right': index < steps.length - 1,\n 'ndl-wizard-step-line-left': index > 0,\n 'ndl-wizard-step-complete': status === 'complete',\n 'ndl-wizard-step-active': status === 'active',\n 'ndl-wizard-step-error': step.status === 'error',\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n };\n\n return (\n <Component\n className={wizardClasses}\n style={{ ...style, ...componentStyle }}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {/* iterate over the steps to render the text content (the first row of the component)*/}\n {steps.map((step, index) => {\n if (typeof step.content === 'string') {\n const wizardStepClasses = classNames('ndl-wizard-step-text', {\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-horizontal': orientation === 'horizontal',\n [`ndl-wizard-align-${alignment}`]: alignment,\n 'ndl-wizard-step-incomplete':\n getStatus(activeStepIndex, index) === 'incomplete',\n });\n\n return (\n <div key={index} className={wizardStepClasses}>\n <Typography variant=\"body-large\">{step.content}</Typography>\n </div>\n );\n } else {\n return <React.Fragment key={index}>{step.content}</React.Fragment>;\n }\n })}\n {/* iterate over the steps to render the circles (iterates again to render the second row of the component) */}\n {steps.map((step, index) => {\n return (\n <div\n className={stepClasses(index, step)}\n key={index}\n style={{\n gridRow: orientation === 'vertical' ? index + 1 : '',\n }}\n >\n <Circle\n status={\n step.status === 'error'\n ? 'error'\n : getStatus(activeStepIndex, index)\n }\n number={index + 1}\n text={step.content}\n alignment={alignment}\n />\n </div>\n );\n })}\n </Component>\n );\n};\n\nexport const WizardSmall = <T extends React.ElementType = 'div'>({\n orientation = 'horizontal',\n activeStepIndex,\n steps,\n as,\n className,\n htmlAttributes,\n style,\n alignment = 'middle',\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, Omit<WizardProps, 'size'>>) => {\n const Component = as ?? 'div';\n\n const wizardClasses = classNames(\n 'ndl-wizard',\n 'ndl-wizard-small',\n {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n [`ndl-wizard-align-${alignment}`]: alignment,\n },\n className,\n );\n\n const stepClasses = (index: number) =>\n classNames('ndl-wizard-step', {\n 'ndl-horizontal': orientation === 'horizontal',\n 'ndl-vertical': orientation === 'vertical',\n 'ndl-wizard-step-active': getStatus(activeStepIndex, index) === 'active',\n 'ndl-wizard-step-complete':\n getStatus(activeStepIndex, index) === 'complete',\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n\n return (\n <Component\n className={wizardClasses}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-wizard-steps-line\" />\n {steps.map((step, index) => {\n return (\n <div key={index} className={stepClasses(index)}>\n <div className=\"ndl-wizard-circle\"></div>\n </div>\n );\n })}\n <div className=\"ndl-wizard-steps-line\" />\n </Component>\n );\n};\n\nconst Circle = ({\n status,\n number,\n alignment = 'middle',\n}: {\n status: 'active' | 'complete' | 'incomplete' | 'error';\n number: number;\n text: React.ReactNode;\n alignment?: 'top' | 'middle';\n}) => {\n const innerCircleClasses = classNames({\n 'n-fill-danger-bg-strong': status === 'error',\n 'n-fill-neutral-bg-stronger': status === 'incomplete',\n 'n-fill-primary-bg-strong': status === 'complete' || status === 'active',\n });\n const outerCircleClasses = classNames('ndl-wizard-circle', {\n [`ndl-wizard-align-${alignment}`]: alignment,\n });\n\n return (\n <div className={outerCircleClasses}>\n <svg aria-hidden=\"true\">\n {status === 'active' && (\n <g>\n <circle\n className=\"n-stroke-primary-bg-strong\"\n style={{ fill: 'transparent', strokeWidth: 2 }}\n cx=\"16\"\n cy=\"16\"\n r=\"14\"\n />\n </g>\n )}\n\n <circle className={innerCircleClasses} cx=\"16\" cy=\"16\" r=\"12\" />\n <text\n x=\"50%\"\n y=\"50%\"\n fontSize={14}\n className=\"n-fill-neutral-bg-weak\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n dy=\"0.1em\"\n >\n {status === 'error' ? '!' : number}\n </text>\n </svg>\n </div>\n );\n};\n"]}
@@ -26,21 +26,20 @@ const jsx_runtime_1 = require("react/jsx-runtime");
26
26
  const index_1 = require("../index");
27
27
  const _1 = require(".");
28
28
  const componentMeta = {
29
- title: 'Components/Wizard',
30
- id: 'components-wizard',
31
29
  component: index_1.Wizard,
32
- tags: ['docsPage'],
33
- parameters: {
34
- controls: { disable: true },
35
- },
36
30
  decorators: [
37
31
  (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-w-1/2 n-mx-auto", children: (0, jsx_runtime_1.jsx)(Story, {}) })),
38
32
  ],
33
+ id: 'components-wizard',
34
+ parameters: {
35
+ controls: { disable: true },
36
+ },
37
+ tags: ['docsPage'],
38
+ title: 'Components/Wizard',
39
39
  };
40
40
  exports.default = componentMeta;
41
41
  exports.Horizontal = {
42
42
  args: {},
43
- render: _1.WizardHorizontal,
44
43
  parameters: {
45
44
  docs: {
46
45
  source: {
@@ -48,10 +47,10 @@ exports.Horizontal = {
48
47
  },
49
48
  },
50
49
  },
50
+ render: _1.WizardHorizontal,
51
51
  };
52
52
  exports.HorizontalSmall = {
53
53
  args: {},
54
- render: _1.WizardHorizontalSmall,
55
54
  parameters: {
56
55
  docs: {
57
56
  source: {
@@ -59,10 +58,13 @@ exports.HorizontalSmall = {
59
58
  },
60
59
  },
61
60
  },
61
+ render: _1.WizardHorizontalSmall,
62
62
  };
63
63
  exports.Vertical = {
64
64
  args: {},
65
- render: _1.WizardVertical,
65
+ decorators: [
66
+ (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-justify-center", children: (0, jsx_runtime_1.jsx)(Story, {}) })),
67
+ ],
66
68
  parameters: {
67
69
  docs: {
68
70
  source: {
@@ -70,13 +72,10 @@ exports.Vertical = {
70
72
  },
71
73
  },
72
74
  },
73
- decorators: [
74
- (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-justify-center", children: (0, jsx_runtime_1.jsx)(Story, {}) })),
75
- ],
75
+ render: _1.WizardVertical,
76
76
  };
77
77
  exports.VerticalSmall = {
78
78
  args: {},
79
- render: _1.WizardVerticalSmall,
80
79
  parameters: {
81
80
  docs: {
82
81
  source: {
@@ -84,10 +83,10 @@ exports.VerticalSmall = {
84
83
  },
85
84
  },
86
85
  },
86
+ render: _1.WizardVerticalSmall,
87
87
  };
88
88
  exports.ErrorState = {
89
89
  args: {},
90
- render: _1.WizardErrorState,
91
90
  parameters: {
92
91
  docs: {
93
92
  source: {
@@ -95,5 +94,6 @@ exports.ErrorState = {
95
94
  },
96
95
  },
97
96
  },
97
+ render: _1.WizardErrorState,
98
98
  };
99
99
  //# sourceMappingURL=wizard.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wizard.stories.js","sourceRoot":"","sources":["../../../../src/wizard/stories/wizard.stories.tsx"],"names":[],"mappings":";;;;AAuBA,oCAAkC;AAClC,wBAWW;AAEX,MAAM,aAAa,GAAwB;IACzC,KAAK,EAAE,mBAAmB;IAC1B,EAAE,EAAE,mBAAmB;IACvB,SAAS,EAAE,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E;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;aAC7B;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 */\n\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Wizard } from '../index';\nimport {\n WizardErrorState,\n WizardErrorStateSource,\n WizardHorizontal,\n WizardHorizontalSmall,\n WizardHorizontalSmallSource,\n WizardHorizontalSource,\n WizardVertical,\n WizardVerticalSmall,\n WizardVerticalSmallSource,\n WizardVerticalSource,\n} from '.';\n\nconst componentMeta: Meta<typeof Wizard> = {\n title: 'Components/Wizard',\n id: 'components-wizard',\n component: Wizard,\n tags: ['docsPage'],\n parameters: {\n controls: { disable: true },\n },\n decorators: [\n (Story) => (\n <div className=\"n-w-1/2 n-mx-auto\">\n <Story />\n </div>\n ),\n ],\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof Wizard>;\n\nexport const Horizontal: Story = {\n args: {},\n render: WizardHorizontal,\n parameters: {\n docs: {\n source: {\n code: WizardHorizontalSource,\n },\n },\n },\n};\n\nexport const HorizontalSmall: Story = {\n args: {},\n render: WizardHorizontalSmall,\n parameters: {\n docs: {\n source: {\n code: WizardHorizontalSmallSource,\n },\n },\n },\n};\n\nexport const Vertical: Story = {\n args: {},\n render: WizardVertical,\n parameters: {\n docs: {\n source: {\n code: WizardVerticalSource,\n },\n },\n },\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n};\n\nexport const VerticalSmall: Story = {\n args: {},\n render: WizardVerticalSmall,\n parameters: {\n docs: {\n source: {\n code: WizardVerticalSmallSource,\n },\n },\n },\n};\n\nexport const ErrorState: Story = {\n args: {},\n render: WizardErrorState,\n parameters: {\n docs: {\n source: {\n code: WizardErrorStateSource,\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"wizard.stories.js","sourceRoot":"","sources":["../../../../src/wizard/stories/wizard.stories.tsx"],"names":[],"mappings":";;;;AAuBA,oCAAkC;AAClC,wBAWW;AAEX,MAAM,aAAa,GAAwB;IACzC,SAAS,EAAE,cAAM;IACjB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,gCAAK,SAAS,EAAC,mBAAmB,YAChC,uBAAC,KAAK,KAAG,GACL,CACP;KACF;IACD,EAAE,EAAE,mBAAmB;IACvB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,mBAAmB;CAC3B,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;aAC7B;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,eAAe,GAAU;IACpC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,8BAA2B;aAClC;SACF;KACF;IACD,MAAM,EAAE,wBAAqB;CAC9B,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,gCAAK,SAAS,EAAC,yBAAyB,YACtC,uBAAC,KAAK,KAAG,GACL,CACP;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAoB;aAC3B;SACF;KACF;IACD,MAAM,EAAE,iBAAc;CACvB,CAAC;AAEW,QAAA,aAAa,GAAU;IAClC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,4BAAyB;aAChC;SACF;KACF;IACD,MAAM,EAAE,sBAAmB;CAC5B,CAAC;AAEW,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,yBAAsB;aAC7B;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Wizard } from '../index';\nimport {\n WizardErrorState,\n WizardErrorStateSource,\n WizardHorizontal,\n WizardHorizontalSmall,\n WizardHorizontalSmallSource,\n WizardHorizontalSource,\n WizardVertical,\n WizardVerticalSmall,\n WizardVerticalSmallSource,\n WizardVerticalSource,\n} from '.';\n\nconst componentMeta: Meta<typeof Wizard> = {\n component: Wizard,\n decorators: [\n (Story) => (\n <div className=\"n-w-1/2 n-mx-auto\">\n <Story />\n </div>\n ),\n ],\n id: 'components-wizard',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/Wizard',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof Wizard>;\n\nexport const Horizontal: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: WizardHorizontalSource,\n },\n },\n },\n render: WizardHorizontal,\n};\n\nexport const HorizontalSmall: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: WizardHorizontalSmallSource,\n },\n },\n },\n render: WizardHorizontalSmall,\n};\n\nexport const Vertical: Story = {\n args: {},\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n parameters: {\n docs: {\n source: {\n code: WizardVerticalSource,\n },\n },\n },\n render: WizardVertical,\n};\n\nexport const VerticalSmall: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: WizardVerticalSmallSource,\n },\n },\n },\n render: WizardVerticalSmall,\n};\n\nexport const ErrorState: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: WizardErrorStateSource,\n },\n },\n },\n render: WizardErrorState,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/_common/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type tokens } from '@neo4j-ndl/base';\nimport type React from 'react';\n\nimport type { Tooltip } from '../tooltip';\n\nexport type HtmlAttributes<T extends React.ElementType> =\n React.ComponentPropsWithoutRef<T> & {\n [key: `data-${string}`]: string | undefined;\n };\n\ntype BaseProps<T extends React.ElementType> = {\n /**\n * Additional classnames will be applied to the root element.\n */\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: HtmlAttributes<T>;\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<T>['ref'];\n};\n\nexport type PolymorphicCommonProps<T extends React.ElementType, P> = P & {\n /**\n * An override of the default HTML tag of the root of the component.\n * Can also be another React component.\n */\n as?: T;\n} & BaseProps<T>;\n\nexport type CommonProps<T extends React.ElementType, P> = P & BaseProps<T>;\n\nexport type TooltipObjectProps = {\n root?: Partial<React.ComponentProps<typeof Tooltip>>;\n trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>;\n content?: Partial<React.ComponentProps<typeof Tooltip.Content>>;\n};\n\nexport type Spacing = keyof typeof tokens.space;\n\nexport type Radius = keyof typeof tokens.borderRadius;\n\n/**\n * Currently supporting only native HTML elements.\n */\nexport type CustomElementType = keyof HTMLElementTagNameMap;\n\n/**\n * More info here:\n * https://stackoverflow.com/questions/75085783/conditional-react-component-properties-with-multiple-generics#comment132505139_75086121\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactComponent = (args: any) => React.JSX.Element;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/_common/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type tokens } from '@neo4j-ndl/base';\nimport type React from 'react';\n\nimport type { Tooltip } from '../tooltip';\n\nexport type HtmlAttributes<T extends React.ElementType> =\n React.ComponentPropsWithoutRef<T> & {\n [key: `data-${string}`]: string | undefined;\n };\n\ntype BaseProps<T extends React.ElementType> = {\n /**\n * Additional classnames will be applied to the root element.\n */\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: HtmlAttributes<T>;\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<T>['ref'];\n};\n\nexport type PolymorphicCommonProps<T extends React.ElementType, P> = P & {\n /**\n * An override of the default HTML tag of the root of the component.\n * Can also be another React component.\n */\n as?: T;\n} & BaseProps<T>;\n\nexport type CommonProps<T extends React.ElementType, P> = P & BaseProps<T>;\n\nexport type TooltipObjectProps = {\n root?: Partial<React.ComponentProps<typeof Tooltip>>;\n trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>;\n content?: Partial<React.ComponentProps<typeof Tooltip.Content>>;\n};\n\nexport type Spacing = keyof typeof tokens.space;\n\nexport type Radius = keyof typeof tokens.borderRadius;\n\n/**\n * Currently supporting only native HTML elements.\n */\nexport type CustomElementType = keyof HTMLElementTagNameMap;\n\n/**\n * More info here:\n * https://stackoverflow.com/questions/75085783/conditional-react-component-properties-with-multiple-generics#comment132505139_75086121\n */\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactComponent = (args: any) => React.JSX.Element;\n"]}
@@ -67,14 +67,14 @@ export const useOnClickOutside = (ref, handler) => {
67
67
  }
68
68
  handler(event); // Call the handler only if the click is outside of the element passed.
69
69
  };
70
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
71
71
  document.addEventListener('mousedown', listener);
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
73
73
  document.addEventListener('touchstart', listener);
74
74
  return () => {
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
76
76
  document.removeEventListener('mousedown', listener);
77
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
77
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
78
78
  document.removeEventListener('touchstart', listener);
79
79
  };
80
80
  }, [ref, handler]); // Reload only if ref or handler changes
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAGL,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AAIf,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAE,EAAE,CACtD,OAAO,CAAC,IAAI,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;AAE3C,MAAM,gBAAgB,GAAG,CAAC,GAAa,EAAU,EA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,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC,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 { tokens } from '@neo4j-ndl/base';\nimport {\n type MouseEvent,\n type TouchEvent,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\n\nimport type { Radius, Spacing } from './types';\n\nexport const removeNewlines = (input: string) =>\n input.replace(/(\\r\\n|\\n|\\r)/gm, '');\n\n/** Remove extra spaces from sting */\nexport const removeSpaces = (input: string) =>\n input.replace(/\\s+/g, ' ').trim();\n\nexport const needleWarningMessage = (message: string) =>\n console.warn(`[🪡 Needle]: ${message}`);\n\nconst getScrollbarSize = (doc: Document): number => {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n const scrollBarSize = Math.abs(window.innerWidth - documentWidth);\n // Firefox with 110% and 120% zoom level return 1px even if there is no scrollbar\n return scrollBarSize > 1 ? scrollBarSize : 0;\n};\n\nconst getPaddingRight = (element: Element): number =>\n parseInt(window.getComputedStyle(element).paddingRight, 10) || 0;\n\n/**\n * Toggles scroll on the provided document.\n * Useful for disabling scroll when a popup is open (ie ContextMenu/Modal)\n */\nexport const useDocumentScrollToggle = () => {\n const bodyPadding = useRef<number>(0);\n\n return useCallback((disable: boolean, doc: Document = document) => {\n if (disable) {\n const existingPaddingRight = getPaddingRight(doc.body);\n bodyPadding.current = existingPaddingRight;\n const newPaddingRight = existingPaddingRight + getScrollbarSize(doc);\n doc.body.style.overflow = 'hidden';\n doc.body.style.paddingRight = `${newPaddingRight}px`;\n } else {\n doc.body.style.overflow = '';\n doc.body.style.paddingRight = `${bodyPadding.current}px`;\n }\n }, []);\n};\n\n/**\n * Detect if there is a click event outside\n * of the provided element\n * Source:\n * https://hashnode.com/post/useonclickoutside-custom-hook-to-detect-the-mouse-click-on-outside-typescript-ckrejmy3h0k5r91s18iu42t28\n */\nexport const useOnClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: React.RefObject<T>,\n handler: (event: MouseEvent | TouchEvent) => void,\n) => {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref?.current;\n if (!el || el.contains((event?.target as Node) || null)) {\n return;\n }\n\n handler(event); // Call the handler only if the click is outside of the element passed.\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n document.addEventListener('mousedown', listener as any);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n document.addEventListener('touchstart', listener as any);\n\n return () => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n document.removeEventListener('mousedown', listener as any);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n document.removeEventListener('touchstart', listener as any);\n };\n }, [ref, handler]); // Reload only if ref or handler changes\n};\n\n/**\n * X - char long pseudo-random string\n */\nexport const randomId = (length: number) =>\n Math.random()\n .toString(36)\n .slice(2, length + 2);\n\n// Utility / Type-Guard if the object is a ref\nexport function isRefObject<T>(\n obj: React.RefObject<T> | T,\n): obj is React.RefObject<T> {\n return obj && typeof obj === 'object' && 'current' in obj;\n}\n\n/**\n * Equivalent to prevUntil/nextUntil in jQuery\n * https://api.jquery.com/prevUntil/\n * https://api.jquery.com/nextUntil/\n *\n * Additional functionality is added to circle back\n * to the beginning of a list of siblings if it reaches the end\n * or vice versa.\n */\nexport function findUntil(\n direction: 'next' | 'prev',\n el: Element | ChildNode,\n matchSelector: string,\n): Element | null {\n const element: ChildNode = el;\n\n if (!element.parentElement) {\n return null;\n }\n\n const allSiblings = [...element.parentElement.children].filter((sibling) =>\n sibling.matches(matchSelector),\n );\n\n const index = allSiblings.findIndex((sibling) =>\n sibling.isEqualNode(element),\n );\n\n if (index === -1) {\n return null;\n }\n\n const newIndex =\n direction === 'next'\n ? (index + 1) % allSiblings.length\n : (index - 1 + allSiblings.length) % allSiblings.length;\n\n return allSiblings[newIndex];\n}\n\n/**\n * Find all html elements that are focusable given a parent element\n * @param parentElement the parent element\n * @returns an array of HTML elements\n */\nexport const findFocusableChildren = (parentElement: HTMLElement) => {\n const focusableElements =\n 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex=\"-1\"])';\n\n const focusable = Array.from(\n parentElement.querySelectorAll(focusableElements),\n ).filter((element) => {\n if (element instanceof HTMLElement) {\n return true;\n }\n\n return false;\n });\n return focusable;\n};\n\n/**\n * Using the element that currently has focus, finds the previous sibling of the currently focused element that is focusable\n * @param parentRef the parent element\n * @returns the previous focusable element\n */\nexport const findFocusableSibling = (\n parentRef: React.RefObject<HTMLElement | null>,\n direction: 'prev' | 'next',\n): HTMLElement | undefined => {\n const { current } = parentRef;\n const { activeElement } = document;\n\n if (current === null || activeElement === null) {\n return undefined;\n }\n\n const focusable = findFocusableChildren(current);\n const index = focusable.indexOf(activeElement);\n if (index > -1) {\n const siblingElement = focusable[index + (direction === 'next' ? 1 : -1)];\n if (\n siblingElement === undefined ||\n !(siblingElement instanceof HTMLElement)\n ) {\n return undefined;\n }\n return siblingElement;\n }\n return undefined;\n};\n\n/**\n * Convert hex color to rgb format\n *\n * @param hex color in hex code format\n * @returns color in rgb format rgb(_, _, _)\n */\nexport const convertHexToRGB = (hex: string) => {\n hex = hex.replace(/^#/, '');\n\n const red = parseInt(hex.substring(0, 2), 16);\n const green = parseInt(hex.substring(2, 4), 16);\n const blue = parseInt(hex.substring(4, 6), 16);\n\n return `rgb(${red}, ${green}, ${blue})`;\n};\n\nexport const SpacingDefaults = {\n gap: '4',\n padding: '4',\n paddingBlockEnd: undefined,\n paddingBlockStart: undefined,\n paddingInline: undefined,\n paddingInlineEnd: undefined,\n paddingInlineStart: undefined,\n} as const;\n\nexport const getSpacing = (\n spacing: Spacing | undefined,\n property: keyof typeof SpacingDefaults,\n) => {\n return spacing\n ? tokens.space[spacing || SpacingDefaults[property]]\n : undefined;\n};\n\nexport const RadiusDefaults = {\n borderRadius: undefined,\n};\n\nexport const getRadius = (\n spacing: Radius | undefined,\n property: keyof typeof RadiusDefaults,\n) => {\n return spacing\n ? tokens.borderRadius[spacing || RadiusDefaults[property]]\n : undefined;\n};\n\nexport const parseRgbString = (rgbString: string): [number, number, number] => {\n const match = rgbString.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);\n if (!match) {\n throw new Error(`Unable to parse RGB color: ${rgbString}`);\n }\n return [Number(match[1]), Number(match[2]), Number(match[3])];\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAGL,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AAIf,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EA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IAC5E,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAChE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8BAA8B,SAAS,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC,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 { tokens } from '@neo4j-ndl/base';\nimport {\n type MouseEvent,\n type TouchEvent,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\n\nimport type { Radius, Spacing } from './types';\n\nexport const removeNewlines = (input: string) =>\n input.replace(/(\\r\\n|\\n|\\r)/gm, '');\n\n/** Remove extra spaces from sting */\nexport const removeSpaces = (input: string) =>\n input.replace(/\\s+/g, ' ').trim();\n\nexport const needleWarningMessage = (message: string) =>\n console.warn(`[🪡 Needle]: ${message}`);\n\nconst getScrollbarSize = (doc: Document): number => {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n const scrollBarSize = Math.abs(window.innerWidth - documentWidth);\n // Firefox with 110% and 120% zoom level return 1px even if there is no scrollbar\n return scrollBarSize > 1 ? scrollBarSize : 0;\n};\n\nconst getPaddingRight = (element: Element): number =>\n parseInt(window.getComputedStyle(element).paddingRight, 10) || 0;\n\n/**\n * Toggles scroll on the provided document.\n * Useful for disabling scroll when a popup is open (ie ContextMenu/Modal)\n */\nexport const useDocumentScrollToggle = () => {\n const bodyPadding = useRef<number>(0);\n\n return useCallback((disable: boolean, doc: Document = document) => {\n if (disable) {\n const existingPaddingRight = getPaddingRight(doc.body);\n bodyPadding.current = existingPaddingRight;\n const newPaddingRight = existingPaddingRight + getScrollbarSize(doc);\n doc.body.style.overflow = 'hidden';\n doc.body.style.paddingRight = `${newPaddingRight}px`;\n } else {\n doc.body.style.overflow = '';\n doc.body.style.paddingRight = `${bodyPadding.current}px`;\n }\n }, []);\n};\n\n/**\n * Detect if there is a click event outside\n * of the provided element\n * Source:\n * https://hashnode.com/post/useonclickoutside-custom-hook-to-detect-the-mouse-click-on-outside-typescript-ckrejmy3h0k5r91s18iu42t28\n */\nexport const useOnClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: React.RefObject<T>,\n handler: (event: MouseEvent | TouchEvent) => void,\n) => {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref?.current;\n if (!el || el.contains((event?.target as Node) || null)) {\n return;\n }\n\n handler(event); // Call the handler only if the click is outside of the element passed.\n };\n\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n document.addEventListener('mousedown', listener as any);\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n document.addEventListener('touchstart', listener as any);\n\n return () => {\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n document.removeEventListener('mousedown', listener as any);\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n document.removeEventListener('touchstart', listener as any);\n };\n }, [ref, handler]); // Reload only if ref or handler changes\n};\n\n/**\n * X - char long pseudo-random string\n */\nexport const randomId = (length: number) =>\n Math.random()\n .toString(36)\n .slice(2, length + 2);\n\n// Utility / Type-Guard if the object is a ref\nexport function isRefObject<T>(\n obj: React.RefObject<T> | T,\n): obj is React.RefObject<T> {\n return obj && typeof obj === 'object' && 'current' in obj;\n}\n\n/**\n * Equivalent to prevUntil/nextUntil in jQuery\n * https://api.jquery.com/prevUntil/\n * https://api.jquery.com/nextUntil/\n *\n * Additional functionality is added to circle back\n * to the beginning of a list of siblings if it reaches the end\n * or vice versa.\n */\nexport function findUntil(\n direction: 'next' | 'prev',\n el: Element | ChildNode,\n matchSelector: string,\n): Element | null {\n const element: ChildNode = el;\n\n if (!element.parentElement) {\n return null;\n }\n\n const allSiblings = [...element.parentElement.children].filter((sibling) =>\n sibling.matches(matchSelector),\n );\n\n const index = allSiblings.findIndex((sibling) =>\n sibling.isEqualNode(element),\n );\n\n if (index === -1) {\n return null;\n }\n\n const newIndex =\n direction === 'next'\n ? (index + 1) % allSiblings.length\n : (index - 1 + allSiblings.length) % allSiblings.length;\n\n return allSiblings[newIndex];\n}\n\n/**\n * Find all html elements that are focusable given a parent element\n * @param parentElement the parent element\n * @returns an array of HTML elements\n */\nexport const findFocusableChildren = (parentElement: HTMLElement) => {\n const focusableElements =\n 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex=\"-1\"])';\n\n const focusable = Array.from(\n parentElement.querySelectorAll(focusableElements),\n ).filter((element) => {\n if (element instanceof HTMLElement) {\n return true;\n }\n\n return false;\n });\n return focusable;\n};\n\n/**\n * Using the element that currently has focus, finds the previous sibling of the currently focused element that is focusable\n * @param parentRef the parent element\n * @returns the previous focusable element\n */\nexport const findFocusableSibling = (\n parentRef: React.RefObject<HTMLElement | null>,\n direction: 'prev' | 'next',\n): HTMLElement | undefined => {\n const { current } = parentRef;\n const { activeElement } = document;\n\n if (current === null || activeElement === null) {\n return undefined;\n }\n\n const focusable = findFocusableChildren(current);\n const index = focusable.indexOf(activeElement);\n if (index > -1) {\n const siblingElement = focusable[index + (direction === 'next' ? 1 : -1)];\n if (\n siblingElement === undefined ||\n !(siblingElement instanceof HTMLElement)\n ) {\n return undefined;\n }\n return siblingElement;\n }\n return undefined;\n};\n\n/**\n * Convert hex color to rgb format\n *\n * @param hex color in hex code format\n * @returns color in rgb format rgb(_, _, _)\n */\nexport const convertHexToRGB = (hex: string) => {\n hex = hex.replace(/^#/, '');\n\n const red = parseInt(hex.substring(0, 2), 16);\n const green = parseInt(hex.substring(2, 4), 16);\n const blue = parseInt(hex.substring(4, 6), 16);\n\n return `rgb(${red}, ${green}, ${blue})`;\n};\n\nexport const SpacingDefaults = {\n gap: '4',\n padding: '4',\n paddingBlockEnd: undefined,\n paddingBlockStart: undefined,\n paddingInline: undefined,\n paddingInlineEnd: undefined,\n paddingInlineStart: undefined,\n} as const;\n\nexport const getSpacing = (\n spacing: Spacing | undefined,\n property: keyof typeof SpacingDefaults,\n) => {\n return spacing\n ? tokens.space[spacing || SpacingDefaults[property]]\n : undefined;\n};\n\nexport const RadiusDefaults = {\n borderRadius: undefined,\n};\n\nexport const getRadius = (\n spacing: Radius | undefined,\n property: keyof typeof RadiusDefaults,\n) => {\n return spacing\n ? tokens.borderRadius[spacing || RadiusDefaults[property]]\n : undefined;\n};\n\nexport const parseRgbString = (rgbString: string): [number, number, number] => {\n const match = rgbString.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);\n if (!match) {\n throw new Error(`Unable to parse RGB color: ${rgbString}`);\n }\n return [Number(match[1]), Number(match[2]), Number(match[3])];\n};\n"]}
@@ -99,14 +99,14 @@ const AccordionComponent = function AccordionComponent(_a) {
99
99
  const { expandedItemId } = restProps;
100
100
  const contextValue = isMultiple
101
101
  ? {
102
- onChange,
103
- isMultiple,
104
102
  expandedItemIds,
103
+ isMultiple,
104
+ onChange,
105
105
  }
106
106
  : {
107
- onChange,
108
- isMultiple,
109
107
  expandedItemId,
108
+ isMultiple,
109
+ onChange,
110
110
  };
111
111
  return (_jsx(Component, Object.assign({ className: classes, style: style, ref: accordionRef, onKeyDown: handleKeyDown, role: "presentation" }, restProps, htmlAttributes, { children: _jsx(AccordionContext.Provider, { value: contextValue, children: children }) })));
112
112
  };
@@ -185,8 +185,8 @@ const BaseAccordionItem = ({ itemId, children, title, className = '', arrowPosit
185
185
  'ndl-accordion-item-content-leading': arrowPosition === 'leading',
186
186
  });
187
187
  return (_jsxs(Component, Object.assign({ className: classes, style: style, id: itemElementId }, htmlAttributes, { children: [_jsxs("div", { className: headerClasses, id: headerElementId, children: [_jsx("button", { id: buttonElementId, onClick: handleOnClick, className: buttonClasses, "aria-expanded": isExpanded, "aria-disabled": isDisabled, "aria-label": title, "aria-controls": panelElementId, disabled: isDisabled, children: _jsxs("span", { className: iconClasses, children: [_jsx(Typography, { variant: titleTypographyVariant, className: titleClasses, htmlAttributes: {
188
- role: 'heading',
189
188
  'aria-level': 2,
189
+ role: 'heading',
190
190
  }, children: title }), _jsx(ChevronDownIconOutline, { className: classNames('ndl-accordion-item-header-icon', {
191
191
  '-n-rotate-180': isExpanded,
192
192
  }) })] }) }), trailingContent && (_jsx(Typography, { as: "div", variant: "body-medium", children: trailingContent }))] }), _jsx("div", { id: panelElementId, ref: contentRef, className: contentClasses, "aria-hidden": !isExpanded, "aria-labelledby": buttonElementId, role: "region", children: _jsx("div", { ref: innerContentRef, className: "ndl-accordion-item-content-inner", onKeyDown: (event) => event.stopPropagation(), children: _jsx(Typography, { variant: "body-medium", className: "n-text-neutral-text-weak", as: "div", children: children }) }) }), hasDivider && _jsx(Divider, {})] })));
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../src/accordion/Accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;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IAAI,KAAC,OAAO,KAAG,KAChB,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAGpB,EAG+C,EAAE,EAAE;QAHnD,EACA,SAAS,OAEsC,EAD5C,SAAS,cAFZ,aAGD,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;IAEpE,OAAO,KAAC,iBAAiB,oBAAK,SAAS,IAAE,SAAS,EAAE,OAAO,IAAI,CAAC;AAClE,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAO7C,MAAM,SAAS,GAAG,CAGhB,EAG6C,EAAE,EAAE;QAHjD,EACA,SAAS,OAEoC,EAD1C,SAAS,cAFZ,aAGD,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;IAElE,OAAO,CACL,KAAC,iBAAiB,oBAAK,SAAS,IAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAE9C,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useCallback, useImperativeHandle, useRef } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { findUntil } from '../_common/utils';\nimport { Divider } from '../divider';\nimport { ChevronDownIconOutline } from '../icons';\nimport { Typography } from '../typography';\nimport { AccordionContext, useAccordionContext } from './accordion-context';\nimport {\n type AccordionIsMultiple,\n type AccordionIsNotMultiple,\n type AccordionItemId,\n type AccordionItemProps,\n type AccordionProps,\n type ClassicItemProps,\n type IsMultiple,\n type IsNotMultiple,\n} from './accordion-types';\n\nenum AccordionSelector {\n Item = '.ndl-accordion-item',\n ItemNotDisabled = '.ndl-accordion-item:not(.ndl-accordion-item-disabled)',\n}\n\nconst getAccordionItem = (\n accordionElement: Element,\n selector: string,\n direction: 'next' | 'prev' = 'next',\n): Element | null => {\n const itemParent = accordionElement.closest(AccordionSelector.Item);\n if (!itemParent) {\n return null;\n }\n\n return findUntil(direction, itemParent, selector);\n};\n\nconst AccordionComponent = function AccordionComponent<\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n children,\n as,\n isMultiple,\n onChange,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, AccordionProps<T>>) {\n const accordionRef = useRef<U>(null);\n\n useImperativeHandle(ref, () => accordionRef.current!);\n\n const Component: React.ElementType = as || 'div';\n\n // The following function includes code needed to be\n // able to navigate with the arrow keys (not tab).\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const accordionElement = accordionRef.current;\n if (!accordionElement) {\n return;\n }\n const activeElement = document.activeElement as HTMLElement;\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n const newFocusedElement = getAccordionItem(\n activeElement,\n AccordionSelector.ItemNotDisabled,\n 'next',\n );\n const newHeader = newFocusedElement?.firstElementChild;\n\n if (newHeader && newHeader instanceof HTMLElement) {\n focusAccordionItem(newHeader as HTMLElement);\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n const newFocusedElement = getAccordionItem(\n activeElement,\n AccordionSelector.ItemNotDisabled,\n 'prev',\n );\n const newHeader = newFocusedElement?.firstElementChild;\n\n if (newHeader && newHeader instanceof HTMLElement) {\n focusAccordionItem(newHeader as HTMLElement);\n }\n } else if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n activeElement.click();\n }\n };\n\n const focusAccordionItem = (accordionHtmlElement: HTMLElement) => {\n const accordionButton = accordionHtmlElement\n .getElementsByClassName('ndl-accordion-item-header-button')\n .item(0);\n\n if (accordionButton !== null && accordionButton instanceof HTMLElement) {\n accordionButton.focus();\n }\n };\n\n const classes = classNames('ndl-accordion', className);\n\n const { expandedItemIds } = restProps as AccordionIsMultiple<T>;\n const { expandedItemId } = restProps as AccordionIsNotMultiple<T>;\n\n const contextValue = isMultiple\n ? ({\n onChange,\n isMultiple,\n expandedItemIds,\n } as IsMultiple<T>)\n : ({\n onChange,\n isMultiple,\n expandedItemId,\n } as IsNotMultiple<T>);\n\n return (\n <Component\n className={classes}\n style={style}\n ref={accordionRef}\n onKeyDown={handleKeyDown}\n role=\"presentation\"\n {...restProps}\n {...htmlAttributes}\n >\n <AccordionContext.Provider value={contextValue}>\n {children}\n </AccordionContext.Provider>\n </Component>\n );\n};\n\nconst createItemId = (type: string, id: AccordionItemId) =>\n `ndl-accordionitem${type}id-${id}`;\n\nconst BaseAccordionItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n itemId,\n children,\n title,\n className = '',\n arrowPosition = 'leading',\n isDisabled = false,\n onExpandedChange,\n htmlAttributes,\n style,\n as,\n titleTypographyVariant = 'subheading-medium',\n hasDivider = true,\n trailingContent,\n}: PolymorphicCommonProps<U, AccordionItemProps<T>>) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const innerContentRef = useRef<HTMLDivElement>(null);\n const itemElementId = createItemId('item', itemId);\n const headerElementId = createItemId('header', itemId);\n const buttonElementId = createItemId('button', itemId);\n const panelElementId = createItemId('panel', itemId);\n const Component: React.ElementType = as || 'div';\n\n const context = useAccordionContext();\n const { isMultiple } = context;\n\n const isExpanded = isMultiple\n ? context.expandedItemIds.includes(itemId)\n : context.expandedItemId === itemId;\n\n const handleOnClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n // Custom callback to call.\n if (onExpandedChange !== undefined) {\n onExpandedChange(!isExpanded);\n }\n\n if (isMultiple) {\n const { expandedItemIds, onChange }: IsMultiple<T> = context;\n // Multiple expanded.\n if (isExpanded) {\n // Remove from list.\n const newArray: T[] = expandedItemIds.filter(\n (activeId) => activeId !== itemId,\n );\n onChange(newArray);\n } else if (!isExpanded) {\n // Add to list.\n const newArray = [...expandedItemIds];\n newArray.push(itemId);\n onChange(newArray);\n }\n } else {\n const { onChange }: IsNotMultiple<T> = context;\n // Single expanded.\n if (isExpanded) {\n // Set null.\n onChange(null);\n } else if (!isExpanded) {\n // Set to id.\n onChange(itemId);\n }\n }\n\n // The W3 WAI-ARIA states that focus can only happen on the header not the header button.\n document.activeElement?.parentElement?.focus();\n }, [isExpanded, isMultiple, isDisabled, itemId, onExpandedChange, context]);\n\n const classes = classNames('ndl-accordion-item', className, {\n 'ndl-accordion-item-disabled': isDisabled,\n 'ndl-accordion-item-expanded': isExpanded,\n });\n\n const headerClasses = classNames('ndl-accordion-item-header', {\n 'ndl-accordion-item-header-disabled': isDisabled,\n });\n\n const iconClasses = classNames('ndl-accordion-item-header-icon-wrapper', {\n 'ndl-accordion-item-header-icon-wrapper-leading':\n arrowPosition === 'leading',\n });\n\n const buttonClasses = classNames('ndl-accordion-item-header-button', {\n 'ndl-accordion-item-header-button-disabled': isDisabled,\n });\n\n const titleClasses = classNames('ndl-accordion-item-header-button-title', {\n 'ndl-accordion-item-header-button-title': isDisabled,\n 'ndl-accordion-item-header-button-title-leading':\n arrowPosition === 'leading',\n });\n\n const contentClasses = classNames('ndl-accordion-item-content', {\n 'ndl-accordion-item-content-expanded': isExpanded,\n 'ndl-accordion-item-content-leading': arrowPosition === 'leading',\n });\n\n return (\n <Component\n className={classes}\n style={style}\n id={itemElementId}\n {...htmlAttributes}\n >\n <div className={headerClasses} id={headerElementId}>\n <button\n id={buttonElementId}\n onClick={handleOnClick}\n className={buttonClasses}\n aria-expanded={isExpanded}\n aria-disabled={isDisabled}\n aria-label={title}\n aria-controls={panelElementId}\n disabled={isDisabled}\n >\n <span className={iconClasses}>\n <Typography\n variant={titleTypographyVariant}\n className={titleClasses}\n htmlAttributes={{\n role: 'heading',\n 'aria-level': 2,\n }}\n >\n {title}\n </Typography>\n\n <ChevronDownIconOutline\n className={classNames('ndl-accordion-item-header-icon', {\n '-n-rotate-180': isExpanded,\n })}\n />\n </span>\n </button>\n {trailingContent && (\n <Typography as=\"div\" variant=\"body-medium\">\n {trailingContent}\n </Typography>\n )}\n </div>\n\n <div\n id={panelElementId}\n ref={contentRef}\n className={contentClasses}\n aria-hidden={!isExpanded}\n aria-labelledby={buttonElementId}\n role=\"region\"\n >\n {/* The <div> element has a child <button> element that allows keyboard interaction */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n ref={innerContentRef}\n className=\"ndl-accordion-item-content-inner\"\n onKeyDown={(event) => event.stopPropagation()}\n >\n <Typography\n variant=\"body-medium\"\n className=\"n-text-neutral-text-weak\"\n as=\"div\"\n >\n {children}\n </Typography>\n </div>\n </div>\n {hasDivider && <Divider />}\n </Component>\n );\n};\n\nconst AccordionItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n className,\n ...restProps\n}: PolymorphicCommonProps<U, ClassicItemProps<T>>) => {\n const classes = classNames('ndl-accordion-item-classic', className);\n\n return <BaseAccordionItem {...restProps} className={classes} />;\n};\nAccordionItem.displayName = 'Accordion.Item';\n\ntype CleanItemProps<T extends AccordionItemId> = Omit<\n AccordionItemProps<T>,\n 'hasDivider'\n>;\n\nconst CleanItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n className,\n ...restProps\n}: PolymorphicCommonProps<U, CleanItemProps<T>>) => {\n const classes = classNames('ndl-accordion-item-clean', className);\n\n return (\n <BaseAccordionItem {...restProps} className={classes} hasDivider={false} />\n );\n};\n\nCleanItem.displayName = 'Accordion.CleanItem';\n\nconst Accordion = Object.assign(AccordionComponent, {\n CleanItem: CleanItem,\n Item: AccordionItem,\n});\n\nexport { Accordion };\n"]}
1
+ {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../src/accordion/Accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAY5E,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,iDAA4B,CAAA;IAC5B,8FAAyE,CAAA;AAC3E,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,MAAM,gBAAgB,GAAG,CACvB,gBAAyB,EACzB,QAAgB,EAChB,YAA6B,MAAM,EACnB,EAAE;IAClB,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,SAAS,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CA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AAI,CAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAE9C,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useCallback, useImperativeHandle, useRef } from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { findUntil } from '../_common/utils';\nimport { Divider } from '../divider';\nimport { ChevronDownIconOutline } from '../icons';\nimport { Typography } from '../typography';\nimport { AccordionContext, useAccordionContext } from './accordion-context';\nimport {\n type AccordionIsMultiple,\n type AccordionIsNotMultiple,\n type AccordionItemId,\n type AccordionItemProps,\n type AccordionProps,\n type ClassicItemProps,\n type IsMultiple,\n type IsNotMultiple,\n} from './accordion-types';\n\nenum AccordionSelector {\n Item = '.ndl-accordion-item',\n ItemNotDisabled = '.ndl-accordion-item:not(.ndl-accordion-item-disabled)',\n}\n\nconst getAccordionItem = (\n accordionElement: Element,\n selector: string,\n direction: 'next' | 'prev' = 'next',\n): Element | null => {\n const itemParent = accordionElement.closest(AccordionSelector.Item);\n if (!itemParent) {\n return null;\n }\n\n return findUntil(direction, itemParent, selector);\n};\n\nconst AccordionComponent = function AccordionComponent<\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n children,\n as,\n isMultiple,\n onChange,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, AccordionProps<T>>) {\n const accordionRef = useRef<U>(null);\n\n useImperativeHandle(ref, () => accordionRef.current!);\n\n const Component: React.ElementType = as || 'div';\n\n // The following function includes code needed to be\n // able to navigate with the arrow keys (not tab).\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const accordionElement = accordionRef.current;\n if (!accordionElement) {\n return;\n }\n const activeElement = document.activeElement as HTMLElement;\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n const newFocusedElement = getAccordionItem(\n activeElement,\n AccordionSelector.ItemNotDisabled,\n 'next',\n );\n const newHeader = newFocusedElement?.firstElementChild;\n\n if (newHeader && newHeader instanceof HTMLElement) {\n focusAccordionItem(newHeader as HTMLElement);\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n const newFocusedElement = getAccordionItem(\n activeElement,\n AccordionSelector.ItemNotDisabled,\n 'prev',\n );\n const newHeader = newFocusedElement?.firstElementChild;\n\n if (newHeader && newHeader instanceof HTMLElement) {\n focusAccordionItem(newHeader as HTMLElement);\n }\n } else if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n activeElement.click();\n }\n };\n\n const focusAccordionItem = (accordionHtmlElement: HTMLElement) => {\n const accordionButton = accordionHtmlElement\n .getElementsByClassName('ndl-accordion-item-header-button')\n .item(0);\n\n if (accordionButton !== null && accordionButton instanceof HTMLElement) {\n accordionButton.focus();\n }\n };\n\n const classes = classNames('ndl-accordion', className);\n\n const { expandedItemIds } = restProps as AccordionIsMultiple<T>;\n const { expandedItemId } = restProps as AccordionIsNotMultiple<T>;\n\n const contextValue = isMultiple\n ? ({\n expandedItemIds,\n isMultiple,\n onChange,\n } as IsMultiple<T>)\n : ({\n expandedItemId,\n isMultiple,\n onChange,\n } as IsNotMultiple<T>);\n\n return (\n <Component\n className={classes}\n style={style}\n ref={accordionRef}\n onKeyDown={handleKeyDown}\n role=\"presentation\"\n {...restProps}\n {...htmlAttributes}\n >\n <AccordionContext.Provider value={contextValue}>\n {children}\n </AccordionContext.Provider>\n </Component>\n );\n};\n\nconst createItemId = (type: string, id: AccordionItemId) =>\n `ndl-accordionitem${type}id-${id}`;\n\nconst BaseAccordionItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n itemId,\n children,\n title,\n className = '',\n arrowPosition = 'leading',\n isDisabled = false,\n onExpandedChange,\n htmlAttributes,\n style,\n as,\n titleTypographyVariant = 'subheading-medium',\n hasDivider = true,\n trailingContent,\n}: PolymorphicCommonProps<U, AccordionItemProps<T>>) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const innerContentRef = useRef<HTMLDivElement>(null);\n const itemElementId = createItemId('item', itemId);\n const headerElementId = createItemId('header', itemId);\n const buttonElementId = createItemId('button', itemId);\n const panelElementId = createItemId('panel', itemId);\n const Component: React.ElementType = as || 'div';\n\n const context = useAccordionContext();\n const { isMultiple } = context;\n\n const isExpanded = isMultiple\n ? context.expandedItemIds.includes(itemId)\n : context.expandedItemId === itemId;\n\n const handleOnClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n // Custom callback to call.\n if (onExpandedChange !== undefined) {\n onExpandedChange(!isExpanded);\n }\n\n if (isMultiple) {\n const { expandedItemIds, onChange }: IsMultiple<T> = context;\n // Multiple expanded.\n if (isExpanded) {\n // Remove from list.\n const newArray: T[] = expandedItemIds.filter(\n (activeId) => activeId !== itemId,\n );\n onChange(newArray);\n } else if (!isExpanded) {\n // Add to list.\n const newArray = [...expandedItemIds];\n newArray.push(itemId);\n onChange(newArray);\n }\n } else {\n const { onChange }: IsNotMultiple<T> = context;\n // Single expanded.\n if (isExpanded) {\n // Set null.\n onChange(null);\n } else if (!isExpanded) {\n // Set to id.\n onChange(itemId);\n }\n }\n\n // The W3 WAI-ARIA states that focus can only happen on the header not the header button.\n document.activeElement?.parentElement?.focus();\n }, [isExpanded, isMultiple, isDisabled, itemId, onExpandedChange, context]);\n\n const classes = classNames('ndl-accordion-item', className, {\n 'ndl-accordion-item-disabled': isDisabled,\n 'ndl-accordion-item-expanded': isExpanded,\n });\n\n const headerClasses = classNames('ndl-accordion-item-header', {\n 'ndl-accordion-item-header-disabled': isDisabled,\n });\n\n const iconClasses = classNames('ndl-accordion-item-header-icon-wrapper', {\n 'ndl-accordion-item-header-icon-wrapper-leading':\n arrowPosition === 'leading',\n });\n\n const buttonClasses = classNames('ndl-accordion-item-header-button', {\n 'ndl-accordion-item-header-button-disabled': isDisabled,\n });\n\n const titleClasses = classNames('ndl-accordion-item-header-button-title', {\n 'ndl-accordion-item-header-button-title': isDisabled,\n 'ndl-accordion-item-header-button-title-leading':\n arrowPosition === 'leading',\n });\n\n const contentClasses = classNames('ndl-accordion-item-content', {\n 'ndl-accordion-item-content-expanded': isExpanded,\n 'ndl-accordion-item-content-leading': arrowPosition === 'leading',\n });\n\n return (\n <Component\n className={classes}\n style={style}\n id={itemElementId}\n {...htmlAttributes}\n >\n <div className={headerClasses} id={headerElementId}>\n <button\n id={buttonElementId}\n onClick={handleOnClick}\n className={buttonClasses}\n aria-expanded={isExpanded}\n aria-disabled={isDisabled}\n aria-label={title}\n aria-controls={panelElementId}\n disabled={isDisabled}\n >\n <span className={iconClasses}>\n <Typography\n variant={titleTypographyVariant}\n className={titleClasses}\n htmlAttributes={{\n 'aria-level': 2,\n role: 'heading',\n }}\n >\n {title}\n </Typography>\n\n <ChevronDownIconOutline\n className={classNames('ndl-accordion-item-header-icon', {\n '-n-rotate-180': isExpanded,\n })}\n />\n </span>\n </button>\n {trailingContent && (\n <Typography as=\"div\" variant=\"body-medium\">\n {trailingContent}\n </Typography>\n )}\n </div>\n\n <div\n id={panelElementId}\n ref={contentRef}\n className={contentClasses}\n aria-hidden={!isExpanded}\n aria-labelledby={buttonElementId}\n role=\"region\"\n >\n {/* The <div> element has a child <button> element that allows keyboard interaction */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n ref={innerContentRef}\n className=\"ndl-accordion-item-content-inner\"\n onKeyDown={(event) => event.stopPropagation()}\n >\n <Typography\n variant=\"body-medium\"\n className=\"n-text-neutral-text-weak\"\n as=\"div\"\n >\n {children}\n </Typography>\n </div>\n </div>\n {hasDivider && <Divider />}\n </Component>\n );\n};\n\nconst AccordionItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n className,\n ...restProps\n}: PolymorphicCommonProps<U, ClassicItemProps<T>>) => {\n const classes = classNames('ndl-accordion-item-classic', className);\n\n return <BaseAccordionItem {...restProps} className={classes} />;\n};\nAccordionItem.displayName = 'Accordion.Item';\n\ntype CleanItemProps<T extends AccordionItemId> = Omit<\n AccordionItemProps<T>,\n 'hasDivider'\n>;\n\nconst CleanItem = <\n T extends AccordionItemId,\n U extends React.ElementType = 'div',\n>({\n className,\n ...restProps\n}: PolymorphicCommonProps<U, CleanItemProps<T>>) => {\n const classes = classNames('ndl-accordion-item-clean', className);\n\n return (\n <BaseAccordionItem {...restProps} className={classes} hasDivider={false} />\n );\n};\n\nCleanItem.displayName = 'Accordion.CleanItem';\n\nconst Accordion = Object.assign(AccordionComponent, {\n CleanItem: CleanItem,\n Item: AccordionItem,\n});\n\nexport { Accordion };\n"]}
@@ -19,7 +19,7 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
  import { createContext, useContext } from 'react';
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
23
23
  export const AccordionContext = createContext(null);
24
24
  export const useAccordionContext = () => {
25
25
  const context = useContext(AccordionContext);
@@ -1 +1 @@
1
- {"version":3,"file":"accordion-context.js","sourceRoot":"","sources":["../../../src/accordion/accordion-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAsBlD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,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 { createContext, useContext } from 'react';\n\nimport {\n type AccordionIsMultiple,\n type AccordionIsNotMultiple,\n type AccordionItemId,\n} from './accordion-types';\n\ntype AccordionContextType<T extends AccordionItemId> =\n | Required<\n Pick<\n AccordionIsMultiple<T>,\n 'onChange' | 'expandedItemIds' | 'isMultiple'\n >\n >\n | Required<\n Pick<\n AccordionIsNotMultiple<T>,\n 'onChange' | 'expandedItemId' | 'isMultiple'\n >\n >;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const AccordionContext = createContext<AccordionContextType<any> | null>(\n null,\n);\n\nexport const useAccordionContext = () => {\n const context = useContext(AccordionContext);\n if (context === null) {\n throw new Error('Accordion used without context');\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"accordion-context.js","sourceRoot":"","sources":["../../../src/accordion/accordion-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAsBlD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,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 { createContext, useContext } from 'react';\n\nimport {\n type AccordionIsMultiple,\n type AccordionIsNotMultiple,\n type AccordionItemId,\n} from './accordion-types';\n\ntype AccordionContextType<T extends AccordionItemId> =\n | Required<\n Pick<\n AccordionIsMultiple<T>,\n 'onChange' | 'expandedItemIds' | 'isMultiple'\n >\n >\n | Required<\n Pick<\n AccordionIsNotMultiple<T>,\n 'onChange' | 'expandedItemId' | 'isMultiple'\n >\n >;\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport const AccordionContext = createContext<AccordionContextType<any> | null>(\n null,\n);\n\nexport const useAccordionContext = () => {\n const context = useContext(AccordionContext);\n if (context === null) {\n throw new Error('Accordion used without context');\n }\n return context;\n};\n"]}
@@ -22,118 +22,118 @@
22
22
  import { Accordion } from '../../index';
23
23
  import { AccordionCleanItems, AccordionCleanItemsSrc, AccordionDefault, AccordionDefaultSrc, AccordionFull, AccordionFullSrc, AccordionMultipleExpanded, AccordionMultipleExpandedSrc, AccordionRightContent, AccordionRightContentSrc, AccordionSingleExpanded, AccordionSingleExpandedSrc, } from '.';
24
24
  const componentMeta = {
25
- title: 'Components/Accordion',
26
- id: 'components-accordion',
27
25
  component: Accordion,
28
- tags: ['docsPage'],
26
+ id: 'components-accordion',
29
27
  parameters: {
30
28
  controls: { disable: true },
31
29
  },
30
+ tags: ['docsPage'],
31
+ title: 'Components/Accordion',
32
32
  };
33
33
  export default componentMeta;
34
34
  export const Default = {
35
35
  args: {
36
36
  children: undefined,
37
- isMultiple: undefined,
38
37
  expandedItemId: null,
38
+ isMultiple: undefined,
39
39
  onChange: () => undefined,
40
40
  },
41
- render: AccordionDefault,
42
41
  parameters: {
43
42
  docs: {
44
43
  source: {
44
+ code: AccordionDefaultSrc,
45
45
  language: 'tsx',
46
46
  type: 'code',
47
- code: AccordionDefaultSrc,
48
47
  },
49
48
  },
50
49
  },
50
+ render: AccordionDefault,
51
51
  };
52
52
  export const SingleExpanded = {
53
53
  args: {
54
54
  children: undefined,
55
- isMultiple: undefined,
56
55
  expandedItemId: null,
56
+ isMultiple: undefined,
57
57
  onChange: () => undefined,
58
58
  },
59
- render: AccordionSingleExpanded,
60
59
  parameters: {
61
60
  docs: {
62
61
  source: {
62
+ code: AccordionSingleExpandedSrc,
63
63
  language: 'tsx',
64
64
  type: 'code',
65
- code: AccordionSingleExpandedSrc,
66
65
  },
67
66
  },
68
67
  },
68
+ render: AccordionSingleExpanded,
69
69
  };
70
70
  export const MultipleExpanded = {
71
71
  args: {
72
72
  children: undefined,
73
- isMultiple: undefined,
74
73
  expandedItemId: null,
74
+ isMultiple: undefined,
75
75
  onChange: () => undefined,
76
76
  },
77
- render: AccordionMultipleExpanded,
78
77
  parameters: {
79
78
  docs: {
80
79
  source: {
80
+ code: AccordionMultipleExpandedSrc,
81
81
  language: 'tsx',
82
82
  type: 'code',
83
- code: AccordionMultipleExpandedSrc,
84
83
  },
85
84
  },
86
85
  },
86
+ render: AccordionMultipleExpanded,
87
87
  };
88
88
  export const CleanItems = {
89
89
  args: {
90
90
  children: undefined,
91
- isMultiple: undefined,
92
91
  expandedItemId: null,
92
+ isMultiple: undefined,
93
93
  onChange: () => undefined,
94
94
  },
95
- render: AccordionCleanItems,
96
95
  parameters: {
97
96
  docs: {
98
97
  source: {
98
+ code: AccordionCleanItemsSrc,
99
99
  language: 'tsx',
100
100
  type: 'code',
101
- code: AccordionCleanItemsSrc,
102
101
  },
103
102
  },
104
103
  },
104
+ render: AccordionCleanItems,
105
105
  };
106
106
  export const RightContent = {
107
107
  args: {
108
108
  children: undefined,
109
- isMultiple: undefined,
110
109
  expandedItemId: null,
110
+ isMultiple: undefined,
111
111
  onChange: () => undefined,
112
112
  },
113
- render: AccordionRightContent,
114
113
  parameters: {
115
114
  docs: {
116
115
  source: {
116
+ code: AccordionRightContentSrc,
117
117
  language: 'tsx',
118
118
  type: 'code',
119
- code: AccordionRightContentSrc,
120
119
  },
121
120
  },
122
121
  },
122
+ render: AccordionRightContent,
123
123
  };
124
124
  export const Full = {
125
125
  args: {
126
126
  children: undefined,
127
- isMultiple: undefined,
128
127
  expandedItemId: null,
128
+ isMultiple: undefined,
129
129
  onChange: () => undefined,
130
130
  },
131
131
  parameters: {
132
132
  docs: {
133
133
  source: {
134
+ code: AccordionFullSrc,
134
135
  language: 'tsx',
135
136
  type: 'code',
136
- code: AccordionFullSrc,
137
137
  },
138
138
  },
139
139
  },