@neo4j-ndl/react 4.20.1 → 4.21.1-alpha.b78fc61

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 (494) hide show
  1. package/lib/cjs/_common/export-stories-utils.js +1 -1
  2. package/lib/cjs/_common/export-stories-utils.js.map +1 -1
  3. package/lib/cjs/_common/utils.js +3 -3
  4. package/lib/cjs/_common/utils.js.map +1 -1
  5. package/lib/cjs/_generated/style-rules/color-utils.js +3 -0
  6. package/lib/cjs/_generated/style-rules/color-utils.js.map +1 -1
  7. package/lib/cjs/_generated/style-rules/date-utils.js +14 -13
  8. package/lib/cjs/_generated/style-rules/date-utils.js.map +1 -1
  9. package/lib/cjs/_generated/style-rules/literal-schemas.js +5 -3
  10. package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
  11. package/lib/cjs/ai/code-preview/CodePreview.js +1 -1
  12. package/lib/cjs/ai/code-preview/CodePreview.js.map +1 -1
  13. package/lib/cjs/ai/file-tag/FileTag.js.map +1 -1
  14. package/lib/cjs/ai/image-tag/ImageTag.js.map +1 -1
  15. package/lib/cjs/ai/prompt/Prompt.js +10 -10
  16. package/lib/cjs/ai/prompt/Prompt.js.map +1 -1
  17. package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js +1 -1
  18. package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js.map +1 -1
  19. package/lib/cjs/ai/prompt/stories/prompt-context.story.js +1 -1
  20. package/lib/cjs/ai/prompt/stories/prompt-context.story.js.map +1 -1
  21. package/lib/cjs/ai/prompt/stories/prompt-default.story.js +1 -1
  22. package/lib/cjs/ai/prompt/stories/prompt-default.story.js.map +1 -1
  23. package/lib/cjs/ai/prompt/stories/prompt-header.story.js +1 -1
  24. package/lib/cjs/ai/prompt/stories/prompt-header.story.js.map +1 -1
  25. package/lib/cjs/ai/reasoning/Reasoning.js +1 -1
  26. package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -1
  27. package/lib/cjs/ai/response/Response.js +4 -4
  28. package/lib/cjs/ai/response/Response.js.map +1 -1
  29. package/lib/cjs/ai/response/stories/response-full-example.story.js +1 -1
  30. package/lib/cjs/ai/response/stories/response-full-example.story.js.map +1 -1
  31. package/lib/cjs/ai/suggestion/Suggestion.js.map +1 -1
  32. package/lib/cjs/ai/thinking/thinking-duration-formatter.js +5 -5
  33. package/lib/cjs/ai/thinking/thinking-duration-formatter.js.map +1 -1
  34. package/lib/cjs/banner/Banner.js +2 -2
  35. package/lib/cjs/banner/Banner.js.map +1 -1
  36. package/lib/cjs/button/ButtonBase.js +4 -4
  37. package/lib/cjs/button/ButtonBase.js.map +1 -1
  38. package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
  39. package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
  40. package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
  41. package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
  42. package/lib/cjs/code/Code.js +3 -3
  43. package/lib/cjs/code/Code.js.map +1 -1
  44. package/lib/cjs/code-block/CodeBlock.js +2 -2
  45. package/lib/cjs/code-block/CodeBlock.js.map +1 -1
  46. package/lib/cjs/color-picker/ColorPicker.js +22 -22
  47. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  48. package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js +20 -20
  49. package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -1
  50. package/lib/cjs/color-picker/stories/color-picker-default.story.js +4 -4
  51. package/lib/cjs/color-picker/stories/color-picker-default.story.js.map +1 -1
  52. package/lib/cjs/color-picker/stories/color-picker-dialog.story.js +4 -4
  53. package/lib/cjs/color-picker/stories/color-picker-dialog.story.js.map +1 -1
  54. package/lib/cjs/color-picker/stories/color-picker-without-eyedropper.story.js +4 -4
  55. package/lib/cjs/color-picker/stories/color-picker-without-eyedropper.story.js.map +1 -1
  56. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js +1 -1
  57. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js.map +1 -1
  58. package/lib/cjs/data-grid/Components.js +20 -20
  59. package/lib/cjs/data-grid/Components.js.map +1 -1
  60. package/lib/cjs/data-grid/DataGrid.js +3 -3
  61. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  62. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js +55 -54
  63. package/lib/cjs/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  64. package/lib/cjs/data-grid/data-grid-nav/helpers.js +1 -1
  65. package/lib/cjs/data-grid/data-grid-nav/helpers.js.map +1 -1
  66. package/lib/cjs/data-grid/data-grid-nav/index.js +2 -2
  67. package/lib/cjs/data-grid/data-grid-nav/index.js.map +1 -1
  68. package/lib/cjs/data-grid/helpers/index.js +42 -40
  69. package/lib/cjs/data-grid/helpers/index.js.map +1 -1
  70. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js +10 -7
  71. package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  72. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js +10 -7
  73. package/lib/cjs/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  74. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +5 -5
  75. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  76. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
  77. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  78. package/lib/cjs/data-grid/stories/datagrid-virtualization.story.js +5 -5
  79. package/lib/cjs/data-grid/stories/datagrid-virtualization.story.js.map +1 -1
  80. package/lib/cjs/data-grid/style-rules/evaluate.js +23 -23
  81. package/lib/cjs/data-grid/style-rules/evaluate.js.map +1 -1
  82. package/lib/cjs/data-grid/style-rules/types.js +1 -1
  83. package/lib/cjs/data-grid/style-rules/types.js.map +1 -1
  84. package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js +1 -1
  85. package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
  86. package/lib/cjs/dialog/Dialog.js +5 -5
  87. package/lib/cjs/dialog/Dialog.js.map +1 -1
  88. package/lib/cjs/dialog/dialog-types.js.map +1 -1
  89. package/lib/cjs/drawer/Drawer.js +5 -5
  90. package/lib/cjs/drawer/Drawer.js.map +1 -1
  91. package/lib/cjs/dropdown-button/DropdownButton.js +4 -4
  92. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  93. package/lib/cjs/dropzone/stories/dropzone-full.story.js +7 -7
  94. package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
  95. package/lib/cjs/flex/stories/flex-default.story.js +1 -1
  96. package/lib/cjs/flex/stories/flex-default.story.js.map +1 -1
  97. package/lib/cjs/hooks/index.js +3 -3
  98. package/lib/cjs/hooks/index.js.map +1 -1
  99. package/lib/cjs/icon-button/stories/icon-button-sizes.story.js +1 -1
  100. package/lib/cjs/icon-button/stories/icon-button-sizes.story.js.map +1 -1
  101. package/lib/cjs/icon-button/stories/icon-button-tone.story.js +1 -1
  102. package/lib/cjs/icon-button/stories/icon-button-tone.story.js.map +1 -1
  103. package/lib/cjs/icon-button-base/IconButtonBase.js +4 -4
  104. package/lib/cjs/icon-button-base/IconButtonBase.js.map +1 -1
  105. package/lib/cjs/icons/generated/custom/ScatterPlot.js +30 -0
  106. package/lib/cjs/icons/generated/custom/ScatterPlot.js.map +1 -0
  107. package/lib/cjs/icons/generated/custom/index.js +4 -2
  108. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  109. package/lib/cjs/inline-edit/InlineEdit.js +8 -8
  110. package/lib/cjs/inline-edit/InlineEdit.js.map +1 -1
  111. package/lib/cjs/kbd/kbd-utils.js +2 -2
  112. package/lib/cjs/kbd/kbd-utils.js.map +1 -1
  113. package/lib/cjs/modal/Modal.js +6 -6
  114. package/lib/cjs/modal/Modal.js.map +1 -1
  115. package/lib/cjs/next/tree-view/TreeView.js +23 -23
  116. package/lib/cjs/next/tree-view/TreeView.js.map +1 -1
  117. package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js +1 -1
  118. package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js.map +1 -1
  119. package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js +6 -6
  120. package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js.map +1 -1
  121. package/lib/cjs/popover/Popover.js.map +1 -1
  122. package/lib/cjs/popover/stories/popover-custom-offset.story.js +3 -3
  123. package/lib/cjs/popover/stories/popover-custom-offset.story.js.map +1 -1
  124. package/lib/cjs/popover/use-popover.js +2 -0
  125. package/lib/cjs/popover/use-popover.js.map +1 -1
  126. package/lib/cjs/radio/stories/radio-custom-label.story.js +1 -1
  127. package/lib/cjs/radio/stories/radio-custom-label.story.js.map +1 -1
  128. package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
  129. package/lib/cjs/select/Overrides.js +30 -30
  130. package/lib/cjs/select/Overrides.js.map +1 -1
  131. package/lib/cjs/select-icon-button/SelectIconButton.js +4 -4
  132. package/lib/cjs/select-icon-button/SelectIconButton.js.map +1 -1
  133. package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
  134. package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
  135. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  136. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  137. package/lib/cjs/selectable-tag/stories/selectable-tag-sizes.story.js +1 -1
  138. package/lib/cjs/selectable-tag/stories/selectable-tag-sizes.story.js.map +1 -1
  139. package/lib/cjs/side-navigation/SideNavigation.js +10 -10
  140. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  141. package/lib/cjs/slider/Slider.js +1 -1
  142. package/lib/cjs/slider/Slider.js.map +1 -1
  143. package/lib/cjs/slider/stories/slider-single-controlled.story.js +2 -2
  144. package/lib/cjs/slider/stories/slider-single-controlled.story.js.map +1 -1
  145. package/lib/cjs/spotlight/Spotlight.js +6 -6
  146. package/lib/cjs/spotlight/Spotlight.js.map +1 -1
  147. package/lib/cjs/spotlight/SpotlightProvider.js +6 -6
  148. package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -1
  149. package/lib/cjs/spotlight/SpotlightTarget.js +18 -16
  150. package/lib/cjs/spotlight/SpotlightTarget.js.map +1 -1
  151. package/lib/cjs/status-indicator/StatusIndicator.js +4 -2
  152. package/lib/cjs/status-indicator/StatusIndicator.js.map +1 -1
  153. package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js +1 -1
  154. package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
  155. package/lib/cjs/tabs/Tabs.js +3 -3
  156. package/lib/cjs/tabs/Tabs.js.map +1 -1
  157. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js +1 -1
  158. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  159. package/lib/cjs/tabs/stories/tabs-sizes.story.js +1 -1
  160. package/lib/cjs/tabs/stories/tabs-sizes.story.js.map +1 -1
  161. package/lib/cjs/tabs/use-tabs-scroll-overflow.js +2 -2
  162. package/lib/cjs/tabs/use-tabs-scroll-overflow.js.map +1 -1
  163. package/lib/cjs/text-input/stories/text-input-full.story.js +1 -1
  164. package/lib/cjs/text-input/stories/text-input-full.story.js.map +1 -1
  165. package/lib/cjs/text-input/stories/text-input-with-icons.story.js +1 -1
  166. package/lib/cjs/text-input/stories/text-input-with-icons.story.js.map +1 -1
  167. package/lib/cjs/theme/agnostic.js +4 -4
  168. package/lib/cjs/theme/agnostic.js.map +1 -1
  169. package/lib/cjs/time-picker/TimePicker.js +24 -24
  170. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  171. package/lib/cjs/time-picker/generate-time-options.js +3 -3
  172. package/lib/cjs/time-picker/generate-time-options.js.map +1 -1
  173. package/lib/cjs/timezone-picker/TimeZonePicker.js +44 -44
  174. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  175. package/lib/cjs/timezone-picker/generate-timezone-options.js +5 -5
  176. package/lib/cjs/timezone-picker/generate-timezone-options.js.map +1 -1
  177. package/lib/cjs/toast/ToastControlled.js +1 -1
  178. package/lib/cjs/toast/ToastControlled.js.map +1 -1
  179. package/lib/cjs/tooltip/use-tooltip.js +8 -1
  180. package/lib/cjs/tooltip/use-tooltip.js.map +1 -1
  181. package/lib/cjs/tree-view/TreeItemWrapper.js +8 -8
  182. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  183. package/lib/cjs/tree-view/TreeView.js +6 -2
  184. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  185. package/lib/cjs/tree-view/TreeViewTextItem.js +17 -17
  186. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  187. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js +2 -0
  188. package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  189. package/lib/cjs/tree-view/tree-view-utils.js +12 -12
  190. package/lib/cjs/tree-view/tree-view-utils.js.map +1 -1
  191. package/lib/cjs/typography/Typography.js.map +1 -1
  192. package/lib/esm/_common/export-stories-utils.js +1 -1
  193. package/lib/esm/_common/export-stories-utils.js.map +1 -1
  194. package/lib/esm/_common/utils.js +3 -3
  195. package/lib/esm/_common/utils.js.map +1 -1
  196. package/lib/esm/_generated/style-rules/color-utils.js +3 -0
  197. package/lib/esm/_generated/style-rules/color-utils.js.map +1 -1
  198. package/lib/esm/_generated/style-rules/date-utils.js +14 -13
  199. package/lib/esm/_generated/style-rules/date-utils.js.map +1 -1
  200. package/lib/esm/_generated/style-rules/literal-schemas.js +5 -3
  201. package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
  202. package/lib/esm/ai/code-preview/CodePreview.js +1 -1
  203. package/lib/esm/ai/code-preview/CodePreview.js.map +1 -1
  204. package/lib/esm/ai/file-tag/FileTag.js.map +1 -1
  205. package/lib/esm/ai/image-tag/ImageTag.js.map +1 -1
  206. package/lib/esm/ai/prompt/Prompt.js +10 -10
  207. package/lib/esm/ai/prompt/Prompt.js.map +1 -1
  208. package/lib/esm/ai/prompt/stories/prompt-advanced.story.js +1 -1
  209. package/lib/esm/ai/prompt/stories/prompt-advanced.story.js.map +1 -1
  210. package/lib/esm/ai/prompt/stories/prompt-context.story.js +1 -1
  211. package/lib/esm/ai/prompt/stories/prompt-context.story.js.map +1 -1
  212. package/lib/esm/ai/prompt/stories/prompt-default.story.js +1 -1
  213. package/lib/esm/ai/prompt/stories/prompt-default.story.js.map +1 -1
  214. package/lib/esm/ai/prompt/stories/prompt-header.story.js +1 -1
  215. package/lib/esm/ai/prompt/stories/prompt-header.story.js.map +1 -1
  216. package/lib/esm/ai/reasoning/Reasoning.js +1 -1
  217. package/lib/esm/ai/reasoning/Reasoning.js.map +1 -1
  218. package/lib/esm/ai/response/Response.js +4 -4
  219. package/lib/esm/ai/response/Response.js.map +1 -1
  220. package/lib/esm/ai/response/stories/response-full-example.story.js +1 -1
  221. package/lib/esm/ai/response/stories/response-full-example.story.js.map +1 -1
  222. package/lib/esm/ai/suggestion/Suggestion.js.map +1 -1
  223. package/lib/esm/ai/thinking/thinking-duration-formatter.js +5 -5
  224. package/lib/esm/ai/thinking/thinking-duration-formatter.js.map +1 -1
  225. package/lib/esm/banner/Banner.js +2 -2
  226. package/lib/esm/banner/Banner.js.map +1 -1
  227. package/lib/esm/button/ButtonBase.js +4 -4
  228. package/lib/esm/button/ButtonBase.js.map +1 -1
  229. package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
  230. package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
  231. package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
  232. package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
  233. package/lib/esm/code/Code.js +3 -3
  234. package/lib/esm/code/Code.js.map +1 -1
  235. package/lib/esm/code-block/CodeBlock.js +2 -2
  236. package/lib/esm/code-block/CodeBlock.js.map +1 -1
  237. package/lib/esm/color-picker/ColorPicker.js +22 -22
  238. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  239. package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js +20 -20
  240. package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -1
  241. package/lib/esm/color-picker/stories/color-picker-default.story.js +4 -4
  242. package/lib/esm/color-picker/stories/color-picker-default.story.js.map +1 -1
  243. package/lib/esm/color-picker/stories/color-picker-dialog.story.js +4 -4
  244. package/lib/esm/color-picker/stories/color-picker-dialog.story.js.map +1 -1
  245. package/lib/esm/color-picker/stories/color-picker-without-eyedropper.story.js +4 -4
  246. package/lib/esm/color-picker/stories/color-picker-without-eyedropper.story.js.map +1 -1
  247. package/lib/esm/combobox/stories/combobox-large-data-set.story.js +1 -1
  248. package/lib/esm/combobox/stories/combobox-large-data-set.story.js.map +1 -1
  249. package/lib/esm/data-grid/Components.js +20 -20
  250. package/lib/esm/data-grid/Components.js.map +1 -1
  251. package/lib/esm/data-grid/DataGrid.js +3 -3
  252. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  253. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js +55 -54
  254. package/lib/esm/data-grid/data-grid-nav/data-grid-nav.js.map +1 -1
  255. package/lib/esm/data-grid/data-grid-nav/helpers.js +1 -1
  256. package/lib/esm/data-grid/data-grid-nav/helpers.js.map +1 -1
  257. package/lib/esm/data-grid/data-grid-nav/index.js +2 -2
  258. package/lib/esm/data-grid/data-grid-nav/index.js.map +1 -1
  259. package/lib/esm/data-grid/helpers/index.js +42 -40
  260. package/lib/esm/data-grid/helpers/index.js.map +1 -1
  261. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js +10 -7
  262. package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
  263. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js +10 -7
  264. package/lib/esm/data-grid/stories/datagrid-keyboard-navigation.story.js.map +1 -1
  265. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +5 -5
  266. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  267. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
  268. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  269. package/lib/esm/data-grid/stories/datagrid-virtualization.story.js +5 -5
  270. package/lib/esm/data-grid/stories/datagrid-virtualization.story.js.map +1 -1
  271. package/lib/esm/data-grid/style-rules/evaluate.js +23 -23
  272. package/lib/esm/data-grid/style-rules/evaluate.js.map +1 -1
  273. package/lib/esm/data-grid/style-rules/types.js +1 -1
  274. package/lib/esm/data-grid/style-rules/types.js.map +1 -1
  275. package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js +1 -1
  276. package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
  277. package/lib/esm/dialog/Dialog.js +5 -5
  278. package/lib/esm/dialog/Dialog.js.map +1 -1
  279. package/lib/esm/dialog/dialog-types.js.map +1 -1
  280. package/lib/esm/drawer/Drawer.js +5 -5
  281. package/lib/esm/drawer/Drawer.js.map +1 -1
  282. package/lib/esm/dropdown-button/DropdownButton.js +4 -4
  283. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  284. package/lib/esm/dropzone/stories/dropzone-full.story.js +7 -7
  285. package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
  286. package/lib/esm/flex/stories/flex-default.story.js +1 -1
  287. package/lib/esm/flex/stories/flex-default.story.js.map +1 -1
  288. package/lib/esm/hooks/index.js +3 -3
  289. package/lib/esm/hooks/index.js.map +1 -1
  290. package/lib/esm/icon-button/stories/icon-button-sizes.story.js +1 -1
  291. package/lib/esm/icon-button/stories/icon-button-sizes.story.js.map +1 -1
  292. package/lib/esm/icon-button/stories/icon-button-tone.story.js +1 -1
  293. package/lib/esm/icon-button/stories/icon-button-tone.story.js.map +1 -1
  294. package/lib/esm/icon-button-base/IconButtonBase.js +4 -4
  295. package/lib/esm/icon-button-base/IconButtonBase.js.map +1 -1
  296. package/lib/esm/icons/generated/custom/ScatterPlot.js +28 -0
  297. package/lib/esm/icons/generated/custom/ScatterPlot.js.map +1 -0
  298. package/lib/esm/icons/generated/custom/index.js +1 -0
  299. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  300. package/lib/esm/inline-edit/InlineEdit.js +8 -8
  301. package/lib/esm/inline-edit/InlineEdit.js.map +1 -1
  302. package/lib/esm/kbd/kbd-utils.js +2 -2
  303. package/lib/esm/kbd/kbd-utils.js.map +1 -1
  304. package/lib/esm/modal/Modal.js +6 -6
  305. package/lib/esm/modal/Modal.js.map +1 -1
  306. package/lib/esm/next/tree-view/TreeView.js +23 -23
  307. package/lib/esm/next/tree-view/TreeView.js.map +1 -1
  308. package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js +1 -1
  309. package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js.map +1 -1
  310. package/lib/esm/next/tree-view/stories/tree-view-multi.story.js +6 -6
  311. package/lib/esm/next/tree-view/stories/tree-view-multi.story.js.map +1 -1
  312. package/lib/esm/popover/Popover.js.map +1 -1
  313. package/lib/esm/popover/stories/popover-custom-offset.story.js +3 -3
  314. package/lib/esm/popover/stories/popover-custom-offset.story.js.map +1 -1
  315. package/lib/esm/popover/use-popover.js +2 -0
  316. package/lib/esm/popover/use-popover.js.map +1 -1
  317. package/lib/esm/radio/stories/radio-custom-label.story.js +1 -1
  318. package/lib/esm/radio/stories/radio-custom-label.story.js.map +1 -1
  319. package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
  320. package/lib/esm/select/Overrides.js +30 -30
  321. package/lib/esm/select/Overrides.js.map +1 -1
  322. package/lib/esm/select-icon-button/SelectIconButton.js +4 -4
  323. package/lib/esm/select-icon-button/SelectIconButton.js.map +1 -1
  324. package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
  325. package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
  326. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  327. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  328. package/lib/esm/selectable-tag/stories/selectable-tag-sizes.story.js +1 -1
  329. package/lib/esm/selectable-tag/stories/selectable-tag-sizes.story.js.map +1 -1
  330. package/lib/esm/side-navigation/SideNavigation.js +10 -10
  331. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  332. package/lib/esm/slider/Slider.js +1 -1
  333. package/lib/esm/slider/Slider.js.map +1 -1
  334. package/lib/esm/slider/stories/slider-single-controlled.story.js +2 -2
  335. package/lib/esm/slider/stories/slider-single-controlled.story.js.map +1 -1
  336. package/lib/esm/spotlight/Spotlight.js +6 -6
  337. package/lib/esm/spotlight/Spotlight.js.map +1 -1
  338. package/lib/esm/spotlight/SpotlightProvider.js +6 -6
  339. package/lib/esm/spotlight/SpotlightProvider.js.map +1 -1
  340. package/lib/esm/spotlight/SpotlightTarget.js +18 -16
  341. package/lib/esm/spotlight/SpotlightTarget.js.map +1 -1
  342. package/lib/esm/status-indicator/StatusIndicator.js +4 -2
  343. package/lib/esm/status-indicator/StatusIndicator.js.map +1 -1
  344. package/lib/esm/status-indicator/stories/status-indicator-variants.story.js +1 -1
  345. package/lib/esm/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
  346. package/lib/esm/tabs/Tabs.js +3 -3
  347. package/lib/esm/tabs/Tabs.js.map +1 -1
  348. package/lib/esm/tabs/stories/tabs-fill-variants.story.js +1 -1
  349. package/lib/esm/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  350. package/lib/esm/tabs/stories/tabs-sizes.story.js +1 -1
  351. package/lib/esm/tabs/stories/tabs-sizes.story.js.map +1 -1
  352. package/lib/esm/tabs/use-tabs-scroll-overflow.js +2 -2
  353. package/lib/esm/tabs/use-tabs-scroll-overflow.js.map +1 -1
  354. package/lib/esm/text-input/stories/text-input-full.story.js +1 -1
  355. package/lib/esm/text-input/stories/text-input-full.story.js.map +1 -1
  356. package/lib/esm/text-input/stories/text-input-with-icons.story.js +1 -1
  357. package/lib/esm/text-input/stories/text-input-with-icons.story.js.map +1 -1
  358. package/lib/esm/theme/agnostic.js +3 -3
  359. package/lib/esm/theme/agnostic.js.map +1 -1
  360. package/lib/esm/time-picker/TimePicker.js +24 -24
  361. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  362. package/lib/esm/time-picker/generate-time-options.js +3 -3
  363. package/lib/esm/time-picker/generate-time-options.js.map +1 -1
  364. package/lib/esm/timezone-picker/TimeZonePicker.js +44 -44
  365. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  366. package/lib/esm/timezone-picker/generate-timezone-options.js +5 -5
  367. package/lib/esm/timezone-picker/generate-timezone-options.js.map +1 -1
  368. package/lib/esm/toast/ToastControlled.js +1 -1
  369. package/lib/esm/toast/ToastControlled.js.map +1 -1
  370. package/lib/esm/tooltip/use-tooltip.js +8 -1
  371. package/lib/esm/tooltip/use-tooltip.js.map +1 -1
  372. package/lib/esm/tree-view/TreeItemWrapper.js +8 -8
  373. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  374. package/lib/esm/tree-view/TreeView.js +6 -2
  375. package/lib/esm/tree-view/TreeView.js.map +1 -1
  376. package/lib/esm/tree-view/TreeViewTextItem.js +17 -17
  377. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  378. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js +2 -0
  379. package/lib/esm/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
  380. package/lib/esm/tree-view/tree-view-utils.js +12 -12
  381. package/lib/esm/tree-view/tree-view-utils.js.map +1 -1
  382. package/lib/esm/typography/Typography.js.map +1 -1
  383. package/lib/types/_common/export-stories-utils.d.ts +1 -1
  384. package/lib/types/_common/utils.d.ts +3 -3
  385. package/lib/types/_generated/style-rules/color-utils.d.ts.map +1 -1
  386. package/lib/types/_generated/style-rules/date-utils.d.ts +3 -3
  387. package/lib/types/_generated/style-rules/date-utils.d.ts.map +1 -1
  388. package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -1
  389. package/lib/types/ai/code-preview/CodePreview.d.ts +1 -1
  390. package/lib/types/ai/file-tag/FileTag.d.ts +1 -1
  391. package/lib/types/ai/file-tag/FileTag.d.ts.map +1 -1
  392. package/lib/types/ai/image-tag/ImageTag.d.ts +1 -1
  393. package/lib/types/ai/image-tag/ImageTag.d.ts.map +1 -1
  394. package/lib/types/ai/prompt/Prompt.d.ts +3 -3
  395. package/lib/types/ai/prompt/Prompt.d.ts.map +1 -1
  396. package/lib/types/ai/suggestion/Suggestion.d.ts +1 -1
  397. package/lib/types/ai/suggestion/Suggestion.d.ts.map +1 -1
  398. package/lib/types/ai/thinking/thinking-duration-formatter.d.ts +5 -5
  399. package/lib/types/banner/Banner.d.ts +1 -1
  400. package/lib/types/banner/Banner.d.ts.map +1 -1
  401. package/lib/types/button/ButtonBase.d.ts +2 -2
  402. package/lib/types/button/ButtonBase.d.ts.map +1 -1
  403. package/lib/types/code/Code.d.ts +1 -1
  404. package/lib/types/code/Code.d.ts.map +1 -1
  405. package/lib/types/data-grid/Components.d.ts +2 -2
  406. package/lib/types/data-grid/Components.d.ts.map +1 -1
  407. package/lib/types/data-grid/DataGrid.d.ts +2 -2
  408. package/lib/types/data-grid/data-grid-nav/data-grid-nav.d.ts +4 -4
  409. package/lib/types/data-grid/data-grid-nav/data-grid-nav.d.ts.map +1 -1
  410. package/lib/types/data-grid/data-grid-nav/helpers.d.ts +1 -1
  411. package/lib/types/data-grid/data-grid-nav/index.d.ts +1 -1
  412. package/lib/types/data-grid/data-grid-nav/index.d.ts.map +1 -1
  413. package/lib/types/data-grid/helpers/index.d.ts +5 -5
  414. package/lib/types/data-grid/helpers/index.d.ts.map +1 -1
  415. package/lib/types/data-grid/stories/datagrid-in-dialog.story.d.ts.map +1 -1
  416. package/lib/types/data-grid/stories/datagrid-keyboard-navigation.story.d.ts.map +1 -1
  417. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +2 -2
  418. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +2 -2
  419. package/lib/types/data-grid/stories/datagrid-virtualization.story.d.ts.map +1 -1
  420. package/lib/types/data-grid/style-rules/evaluate.d.ts +1 -1
  421. package/lib/types/dialog/Dialog.d.ts.map +1 -1
  422. package/lib/types/dialog/dialog-types.d.ts +1 -1
  423. package/lib/types/dialog/dialog-types.d.ts.map +1 -1
  424. package/lib/types/drawer/Drawer.d.ts +1 -1
  425. package/lib/types/drawer/Drawer.d.ts.map +1 -1
  426. package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
  427. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  428. package/lib/types/hooks/index.d.ts +3 -3
  429. package/lib/types/icon-button-base/IconButtonBase.d.ts +1 -1
  430. package/lib/types/icon-button-base/IconButtonBase.d.ts.map +1 -1
  431. package/lib/types/icons/generated/custom/ScatterPlot.d.ts +29 -0
  432. package/lib/types/icons/generated/custom/ScatterPlot.d.ts.map +1 -0
  433. package/lib/types/icons/generated/custom/index.d.ts +1 -0
  434. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  435. package/lib/types/modal/Modal.d.ts +1 -1
  436. package/lib/types/modal/Modal.d.ts.map +1 -1
  437. package/lib/types/popover/Popover.d.ts.map +1 -1
  438. package/lib/types/popover/use-popover.d.ts.map +1 -1
  439. package/lib/types/segmented-control/SegmentedControl.d.ts +1 -1
  440. package/lib/types/segmented-control/SegmentedControl.d.ts.map +1 -1
  441. package/lib/types/select/Overrides.d.ts.map +1 -1
  442. package/lib/types/select-icon-button/SelectIconButton.d.ts +1 -1
  443. package/lib/types/select-icon-button/SelectIconButton.d.ts.map +1 -1
  444. package/lib/types/selectable-tag/stories/selectable-tag-sizes.story.d.ts.map +1 -1
  445. package/lib/types/spotlight/SpotlightProvider.d.ts.map +1 -1
  446. package/lib/types/spotlight/SpotlightTarget.d.ts +4 -3
  447. package/lib/types/spotlight/SpotlightTarget.d.ts.map +1 -1
  448. package/lib/types/status-indicator/StatusIndicator.d.ts.map +1 -1
  449. package/lib/types/tabs/Tabs.d.ts +1 -1
  450. package/lib/types/tabs/Tabs.d.ts.map +1 -1
  451. package/lib/types/theme/agnostic.d.ts +2 -2
  452. package/lib/types/theme/agnostic.d.ts.map +1 -1
  453. package/lib/types/tooltip/use-tooltip.d.ts.map +1 -1
  454. package/lib/types/tree-view/TreeView.d.ts.map +1 -1
  455. package/lib/types/tree-view/TreeViewTextItem.d.ts.map +1 -1
  456. package/lib/types/tree-view/tree-view-keyboard-coordinates.d.ts.map +1 -1
  457. package/lib/types/tree-view/tree-view-utils.d.ts +12 -12
  458. package/lib/types/tree-view/tree-view-utils.d.ts.map +1 -1
  459. package/lib/types/typography/Typography.d.ts +6 -1
  460. package/lib/types/typography/Typography.d.ts.map +1 -1
  461. package/package.json +7 -4
  462. package/skills/ndl-react/components/ai/file-tag.md +1 -1
  463. package/skills/ndl-react/components/ai/image-tag.md +1 -1
  464. package/skills/ndl-react/components/ai/prompt.md +10 -10
  465. package/skills/ndl-react/components/ai/response.md +1 -1
  466. package/skills/ndl-react/components/ai/suggestion.md +1 -1
  467. package/skills/ndl-react/components/banner.md +1 -1
  468. package/skills/ndl-react/components/clean-icon-button.md +6 -6
  469. package/skills/ndl-react/components/code.md +1 -1
  470. package/skills/ndl-react/components/color-picker.md +32 -32
  471. package/skills/ndl-react/components/combobox.md +1 -1
  472. package/skills/ndl-react/components/data-grid.md +35 -28
  473. package/skills/ndl-react/components/date-picker.md +1 -1
  474. package/skills/ndl-react/components/dialog.md +1 -1
  475. package/skills/ndl-react/components/drawer.md +1 -1
  476. package/skills/ndl-react/components/dropdown-button.md +1 -1
  477. package/skills/ndl-react/components/dropzone.md +7 -7
  478. package/skills/ndl-react/components/filled-button.md +2 -2
  479. package/skills/ndl-react/components/flex.md +2 -2
  480. package/skills/ndl-react/components/icon-button.md +6 -6
  481. package/skills/ndl-react/components/modal.md +1 -1
  482. package/skills/ndl-react/components/next/tree-view.md +8 -8
  483. package/skills/ndl-react/components/outlined-button.md +2 -2
  484. package/skills/ndl-react/components/popover.md +3 -3
  485. package/skills/ndl-react/components/radio.md +1 -1
  486. package/skills/ndl-react/components/segmented-control.md +1 -1
  487. package/skills/ndl-react/components/select-icon-button.md +7 -7
  488. package/skills/ndl-react/components/selectable-tag.md +10 -4
  489. package/skills/ndl-react/components/slider.md +2 -2
  490. package/skills/ndl-react/components/status-indicator.md +5 -5
  491. package/skills/ndl-react/components/tabs.md +5 -5
  492. package/skills/ndl-react/components/text-button.md +2 -2
  493. package/skills/ndl-react/components/text-input.md +2 -2
  494. package/skills/ndl-react/components/typography.md +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Suggestion.js","sourceRoot":"","sources":["../../../../src/ai/suggestion/Suggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAiBpC;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,EAWqB,EAAE,EAAE;QAXzB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,GAAG,OAAO,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEyB,EADpC,SAAS,cAVM,4GAWnB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,mBAAmB,EAAE,SAAS,EAAE;QACzD,2BAA2B,EAAE,SAAS;QACtC,cAAc,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,QAAQ;QACxC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,iDACE,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,IACZ,SAAS,EACT,cAAc,cAElB,iCAAK,SAAS,EAAC,yBAAyB,aACrC,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,gCAAK,SAAS,EAAC,2BAA2B,YAAE,aAAa,GAAO,CACjE,EACA,QAAQ,IACL,IACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEO,gCAAU","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 classNames from 'classnames';\n\nimport { type CommonProps } from '../../_common/types';\n\ntype SuggestionProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** The visual to display before the content. Should be an icon. */\n leadingVisual?: React.ReactNode;\n /** Whether the suggestion is primary. Renders an animated border. */\n isPrimary?: boolean;\n /** Callback function triggered when the suggestion is clicked */\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** The size of the suggestion */\n size?: 'small' | 'large';\n};\n\n/**\n * The component is used to display a suggestion in a chat, or in a prompt.\n * It can be primary, which animates its border.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Suggestion = ({\n children,\n leadingVisual,\n isPrimary,\n onClick,\n size = 'small',\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'button', SuggestionProps>) => {\n const classes = classNames('ndl-ai-suggestion', className, {\n 'ndl-ai-suggestion-special': isPrimary,\n 'ndl-disabled': htmlAttributes?.disabled,\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n\n return (\n <button\n type=\"button\"\n ref={ref}\n className={classes}\n style={style}\n onClick={onClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-suggestion-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-ai-suggestion-leading\">{leadingVisual}</div>\n )}\n {children}\n </div>\n </button>\n );\n};\n\nexport { Suggestion };\n"]}
1
+ {"version":3,"file":"Suggestion.js","sourceRoot":"","sources":["../../../../src/ai/suggestion/Suggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAiBpC;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,EAWqB,EAAE,EAAE;QAXzB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,GAAG,OAAO,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEyB,EADpC,SAAS,cAVM,4GAWnB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,mBAAmB,EAAE,SAAS,EAAE;QACzD,2BAA2B,EAAE,SAAS;QACtC,cAAc,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,QAAQ;QACxC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,iDACE,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,IACZ,SAAS,EACT,cAAc,cAElB,iCAAK,SAAS,EAAC,yBAAyB,aACrC,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,gCAAK,SAAS,EAAC,2BAA2B,YAAE,aAAa,GAAO,CACjE,EACA,QAAQ,IACL,IACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEO,gCAAU","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 classNames from 'classnames';\n\nimport { type CommonProps } from '../../_common/types';\n\ntype SuggestionProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** The visual to display before the content. Should be an icon. */\n leadingVisual?: React.ReactNode;\n /** Whether the suggestion is primary. Renders an animated border. */\n isPrimary?: boolean;\n /** Callback function triggered when the suggestion is clicked */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** The size of the suggestion */\n size?: 'small' | 'large';\n};\n\n/**\n * The component is used to display a suggestion in a chat, or in a prompt.\n * It can be primary, which animates its border.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Suggestion = ({\n children,\n leadingVisual,\n isPrimary,\n onClick,\n size = 'small',\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'button', SuggestionProps>) => {\n const classes = classNames('ndl-ai-suggestion', className, {\n 'ndl-ai-suggestion-special': isPrimary,\n 'ndl-disabled': htmlAttributes?.disabled,\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n\n return (\n <button\n type=\"button\"\n ref={ref}\n className={classes}\n style={style}\n onClick={onClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-suggestion-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-ai-suggestion-leading\">{leadingVisual}</div>\n )}\n {children}\n </div>\n </button>\n );\n};\n\nexport { Suggestion };\n"]}
@@ -30,16 +30,16 @@ exports.formatThinkingDuration = void 0;
30
30
  * - Values 10 or greater are rounded to whole numbers
31
31
  * - Unit names are automatically pluralized based on the value
32
32
  *
33
- * @param ms - The duration in milliseconds to format. Negative or NaN values return { unit: 'seconds', value: 0 }
33
+ * @param ms - The duration in milliseconds to format. Negative or NaN values return `{ unit: 'seconds', value: 0 }`
34
34
  * @returns An object containing:
35
35
  * - `unit`: The time unit string (e.g., 'second', 'seconds', 'minute', 'minutes')
36
36
  * - `value`: The numeric value in the selected unit
37
37
  *
38
38
  * @example
39
- * formatThinkingDuration(500) // { unit: 'milliseconds', value: 500 }
40
- * formatThinkingDuration(1500) // { unit: 'seconds', value: 1.5 }
41
- * formatThinkingDuration(65000) // { unit: 'minutes', value: 1.1 }
42
- * formatThinkingDuration(3600000) // { unit: 'hour', value: 1 }
39
+ * formatThinkingDuration(500) // `{ unit: 'milliseconds', value: 500 }`
40
+ * formatThinkingDuration(1500) // `{ unit: 'seconds', value: 1.5 }`
41
+ * formatThinkingDuration(65000) // `{ unit: 'minutes', value: 1.1 }`
42
+ * formatThinkingDuration(3600000) // `{ unit: 'hour', value: 1 }`
43
43
  */
44
44
  const formatThinkingDuration = (ms) => {
45
45
  if (Number.isNaN(ms) || ms < 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-duration-formatter.js","sourceRoot":"","sources":["../../../../src/ai/thinking/thinking-duration-formatter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,sBAAsB,GAAG,CACpC,EAAU,EACuB,EAAE;IACnC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,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CAAC;IAC3B,MAAM,KAAK,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAE5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC,CAAC;AApCW,QAAA,sBAAsB,0BAoCjC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/**\n * Formats a duration in milliseconds to a human-readable representation with automatic unit selection.\n *\n * The function selects the most appropriate time unit (milliseconds, seconds, minutes, or hours)\n * based on the input value and applies smart rounding:\n * - Values under 10 in a given unit are rounded to 1 decimal place\n * - Values 10 or greater are rounded to whole numbers\n * - Unit names are automatically pluralized based on the value\n *\n * @param ms - The duration in milliseconds to format. Negative or NaN values return { unit: 'seconds', value: 0 }\n * @returns An object containing:\n * - `unit`: The time unit string (e.g., 'second', 'seconds', 'minute', 'minutes')\n * - `value`: The numeric value in the selected unit\n *\n * @example\n * formatThinkingDuration(500) // { unit: 'milliseconds', value: 500 }\n * formatThinkingDuration(1500) // { unit: 'seconds', value: 1.5 }\n * formatThinkingDuration(65000) // { unit: 'minutes', value: 1.1 }\n * formatThinkingDuration(3600000) // { unit: 'hour', value: 1 }\n */\nexport const formatThinkingDuration = (\n ms: number,\n): { unit: string; value: number } => {\n if (Number.isNaN(ms) || ms < 0) {\n return { unit: 'seconds', value: 0 };\n }\n\n if (ms < 1000) {\n const value = Math.round(ms);\n const unit = value === 1 ? 'millisecond' : 'milliseconds';\n return { unit, value };\n }\n\n const seconds = ms / 1000;\n\n if (seconds < 60) {\n const value =\n seconds < 10 ? Math.round(seconds * 10) / 10 : Math.round(seconds);\n const unit = value === 1 ? 'second' : 'seconds';\n return { unit, value };\n }\n\n const minutes = seconds / 60;\n\n if (minutes < 60) {\n const value =\n minutes < 10 ? Math.round(minutes * 10) / 10 : Math.round(minutes);\n const unit = value === 1 ? 'minute' : 'minutes';\n return { unit, value };\n }\n\n const hours = minutes / 60;\n const value = hours < 10 ? Math.round(hours * 10) / 10 : Math.round(hours);\n const unit = value === 1 ? 'hour' : 'hours';\n\n return { unit, value };\n};\n"]}
1
+ {"version":3,"file":"thinking-duration-formatter.js","sourceRoot":"","sources":["../../../../src/ai/thinking/thinking-duration-formatter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,sBAAsB,GAAG,CACpC,EAAU,EACuB,EAAE;IACnC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;QAC1D,OAAO,EAAE,IAAI,EAAE,KAAK,EAA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KAAK,EAAE,CAAC;AACzB,CAAC,CAAC;AApCW,QAAA,sBAAsB,0BAoCjC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/**\n * Formats a duration in milliseconds to a human-readable representation with automatic unit selection.\n *\n * The function selects the most appropriate time unit (milliseconds, seconds, minutes, or hours)\n * based on the input value and applies smart rounding:\n * - Values under 10 in a given unit are rounded to 1 decimal place\n * - Values 10 or greater are rounded to whole numbers\n * - Unit names are automatically pluralized based on the value\n *\n * @param ms - The duration in milliseconds to format. Negative or NaN values return `{ unit: 'seconds', value: 0 }`\n * @returns An object containing:\n * - `unit`: The time unit string (e.g., 'second', 'seconds', 'minute', 'minutes')\n * - `value`: The numeric value in the selected unit\n *\n * @example\n * formatThinkingDuration(500) // `{ unit: 'milliseconds', value: 500 }`\n * formatThinkingDuration(1500) // `{ unit: 'seconds', value: 1.5 }`\n * formatThinkingDuration(65000) // `{ unit: 'minutes', value: 1.1 }`\n * formatThinkingDuration(3600000) // `{ unit: 'hour', value: 1 }`\n */\nexport const formatThinkingDuration = (\n ms: number,\n): { unit: string; value: number } => {\n if (Number.isNaN(ms) || ms < 0) {\n return { unit: 'seconds', value: 0 };\n }\n\n if (ms < 1000) {\n const value = Math.round(ms);\n const unit = value === 1 ? 'millisecond' : 'milliseconds';\n return { unit, value };\n }\n\n const seconds = ms / 1000;\n\n if (seconds < 60) {\n const value =\n seconds < 10 ? Math.round(seconds * 10) / 10 : Math.round(seconds);\n const unit = value === 1 ? 'second' : 'seconds';\n return { unit, value };\n }\n\n const minutes = seconds / 60;\n\n if (minutes < 60) {\n const value =\n minutes < 10 ? Math.round(minutes * 10) / 10 : Math.round(minutes);\n const unit = value === 1 ? 'minute' : 'minutes';\n return { unit, value };\n }\n\n const hours = minutes / 60;\n const value = hours < 10 ? Math.round(hours * 10) / 10 : Math.round(hours);\n const unit = value === 1 ? 'hour' : 'hours';\n\n return { unit, value };\n};\n"]}
@@ -91,9 +91,9 @@ const BannerComponent = (_a) => {
91
91
  'ndl-success': variant === 'success',
92
92
  'ndl-warning': variant === 'warning',
93
93
  });
94
- const handleClose = (e) => {
94
+ const handleClose = (event) => {
95
95
  if (onClose && typeof onClose === 'function') {
96
- onClose(e);
96
+ onClose(event);
97
97
  }
98
98
  };
99
99
  return ((0, jsx_runtime_1.jsxs)(Element, Object.assign({ className: classes, role: isAlert ? 'alert' : undefined, ref: ref }, restProps, htmlAttributes, { children: [hasIcon && (0, jsx_runtime_1.jsx)(StatusIcon, { variant: variant }), (0, jsx_runtime_1.jsx)("div", { className: "ndl-banner-content", children: children }), isCloseable && ((0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { size: "small", onClick: handleClose, description: null, htmlAttributes: { 'aria-label': 'Close' }, children: (0, jsx_runtime_1.jsx)(XMarkIconOutline_1.XMarkIconOutline, {}) }))] })));
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/banner/Banner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAOpC,4DAAuD;AACvD,kFAA+E;AAC/E,4FAAyF;AACzF,wGAAqG;AACrG,4GAAyG;AACzG,wGAAqG;AACrG,oFAAiF;AACjF,8CAA2C;AA8C3C,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAA8B,EAAE,EAAE;IAC7D,MAAM,aAAa,GAAG,CAAC,G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AO,KAAK,SAAS;KACrC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAClB,CAEoC,EACpC,EAAE;QACF,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAC7C,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,wBAAC,OAAO,kBACN,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACnC,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,eAEjB,OAAO,IAAI,uBAAC,UAAU,IAAC,OAAO,EAAE,OAAO,GAAI,EAC5C,gCAAK,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAO,EACnD,WAAW,IAAI,CACd,uBAAC,mCAAe,IACd,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,IAAI,EACjB,cAAc,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,YAEzC,uBAAC,mCAAgB,KAAG,GACJ,CACnB,KACO,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,iBAAiB;IAC9B,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEM,wBAAM","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { BoltIconOutline } from '../icons/generated/heroIcons/BoltIconOutline';\nimport { CheckCircleIconSolid } from '../icons/generated/heroIcons/CheckCircleIconSolid';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { ExclamationTriangleIconSolid } from '../icons/generated/heroIcons/ExclamationTriangleIconSolid';\nimport { InformationCircleIconSolid } from '../icons/generated/heroIcons/InformationCircleIconSolid';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { Typography } from '../typography';\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype BannerCommonProps = {\n /** Shows a status icon. The icon is based on the value of the `variant` prop */\n hasIcon?: boolean;\n\n /** Content to be shown in the banner. */\n children?: React.ReactNode;\n\n /** Sets the role to alert */\n isAlert?: boolean;\n\n /** How the banner is used. */\n usage?: 'inline' | 'global';\n\n /** The variant of the banner */\n variant?: BannerVariant;\n};\n\ntype CloseableBannerProps = {\n /** If the banner is closeable. Renders an icon button in the top right corner */\n isCloseable: true;\n\n /** Event handler for when the close icon is clicked */\n onClose: (\n e?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\ntype NonCloseableBannerProps = {\n isCloseable?: false;\n onClose?: never;\n};\n\ntype BannerCloseProps = CloseableBannerProps | NonCloseableBannerProps;\n\ntype BannerProps = BannerCommonProps & BannerCloseProps;\ntype BannerVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\n\nconst StatusIcon = ({ variant }: { variant: BannerVariant }) => {\n const iconComponent = (() => {\n switch (variant) {\n case 'success':\n return <CheckCircleIconSolid />;\n case 'warning':\n return <ExclamationTriangleIconSolid />;\n case 'danger':\n return <ExclamationCircleIconSolid />;\n case 'info':\n return <InformationCircleIconSolid />;\n case 'neutral':\n return <BoltIconOutline />;\n default:\n return null;\n }\n })();\n\n return <div className=\"ndl-banner-status-icon\">{iconComponent}</div>;\n};\n\nconst BannerHeader = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'span', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-header', className);\n return (\n <Typography\n as=\"span\"\n variant=\"title-4\"\n className={classes}\n style={style}\n ref={ref}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\nconst BannerDescription = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-description', className);\n return (\n <Typography\n as=\"div\"\n variant=\"body-medium\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n};\n\nconst BannerActions = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-actions', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst BannerComponent = <T extends React.ElementType = 'section'>({\n as,\n variant = 'info',\n hasIcon = false,\n onClose,\n className,\n children,\n isCloseable = false,\n usage = 'inline',\n htmlAttributes,\n isAlert = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, BannerProps>) => {\n const Element: React.ElementType = as ?? 'section';\n\n const classes = classNames('ndl-banner', className, {\n 'ndl-danger': variant === 'danger',\n 'ndl-global': usage === 'global',\n 'ndl-info': variant === 'info',\n 'ndl-inline': usage === 'inline',\n 'ndl-neutral': variant === 'neutral',\n 'ndl-success': variant === 'success',\n 'ndl-warning': variant === 'warning',\n });\n\n const handleClose = (\n e:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => {\n if (onClose && typeof onClose === 'function') {\n onClose(e);\n }\n };\n\n return (\n <Element\n className={classes}\n role={isAlert ? 'alert' : undefined}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {hasIcon && <StatusIcon variant={variant} />}\n <div className=\"ndl-banner-content\">{children}</div>\n {isCloseable && (\n <CleanIconButton\n size=\"small\"\n onClick={handleClose}\n description={null}\n htmlAttributes={{ 'aria-label': 'Close' }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </Element>\n );\n};\n\nconst Banner = Object.assign(BannerComponent, {\n Actions: BannerActions,\n Description: BannerDescription,\n Header: BannerHeader,\n});\n\nexport { Banner };\n"]}
1
+ {"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/banner/Banner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAOpC,4DAAuD;AACvD,kFAA+E;AAC/E,4FAAyF;AACzF,wGAAqG;AACrG,4GAAyG;AACzG,wGAAqG;AACrG,oFAAiF;AACjF,8CAA2C;AA8C3C,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAA8B,EAAE,EAAE;IAC7D,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,SAAS;gBACZ,OAAO,uBAAC,2CAAoB,KAAG,CAAC;YAClC,KAAK,SAAS;gBACZ,OAAO,uBAAC,2DAA4B,KAAG,CAAC;YAC1C,KAAK,QAAQ;gBACX,OAAO,uBAAC,uDAA0B,KAAG,CAAC;YACxC,KAAK,MAAM;gBACT,OAAO,uBAAC,uDAA0B,KAAG,CAAC;YACxC,KAAK,SAAS;gBACZ,OAAO,uBAAC,iCAAe,KAAG,CAAC;YAC7B;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,gCAAK,SAAS,EAA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GAAI,EAC5C,gCAAK,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAO,EACnD,WAAW,IAAI,CACd,uBAAC,mCAAe,IACd,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,IAAI,EACjB,cAAc,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,YAEzC,uBAAC,mCAAgB,KAAG,GACJ,CACnB,KACO,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,iBAAiB;IAC9B,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEM,wBAAM","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { BoltIconOutline } from '../icons/generated/heroIcons/BoltIconOutline';\nimport { CheckCircleIconSolid } from '../icons/generated/heroIcons/CheckCircleIconSolid';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { ExclamationTriangleIconSolid } from '../icons/generated/heroIcons/ExclamationTriangleIconSolid';\nimport { InformationCircleIconSolid } from '../icons/generated/heroIcons/InformationCircleIconSolid';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { Typography } from '../typography';\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype BannerCommonProps = {\n /** Shows a status icon. The icon is based on the value of the `variant` prop */\n hasIcon?: boolean;\n\n /** Content to be shown in the banner. */\n children?: React.ReactNode;\n\n /** Sets the role to alert */\n isAlert?: boolean;\n\n /** How the banner is used. */\n usage?: 'inline' | 'global';\n\n /** The variant of the banner */\n variant?: BannerVariant;\n};\n\ntype CloseableBannerProps = {\n /** If the banner is closeable. Renders an icon button in the top right corner */\n isCloseable: true;\n\n /** Event handler for when the close icon is clicked */\n onClose: (\n event?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\ntype NonCloseableBannerProps = {\n isCloseable?: false;\n onClose?: never;\n};\n\ntype BannerCloseProps = CloseableBannerProps | NonCloseableBannerProps;\n\ntype BannerProps = BannerCommonProps & BannerCloseProps;\ntype BannerVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\n\nconst StatusIcon = ({ variant }: { variant: BannerVariant }) => {\n const iconComponent = (() => {\n switch (variant) {\n case 'success':\n return <CheckCircleIconSolid />;\n case 'warning':\n return <ExclamationTriangleIconSolid />;\n case 'danger':\n return <ExclamationCircleIconSolid />;\n case 'info':\n return <InformationCircleIconSolid />;\n case 'neutral':\n return <BoltIconOutline />;\n default:\n return null;\n }\n })();\n\n return <div className=\"ndl-banner-status-icon\">{iconComponent}</div>;\n};\n\nconst BannerHeader = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'span', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-header', className);\n return (\n <Typography\n as=\"span\"\n variant=\"title-4\"\n className={classes}\n style={style}\n ref={ref}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\nconst BannerDescription = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-description', className);\n return (\n <Typography\n as=\"div\"\n variant=\"body-medium\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n};\n\nconst BannerActions = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-banner-actions', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst BannerComponent = <T extends React.ElementType = 'section'>({\n as,\n variant = 'info',\n hasIcon = false,\n onClose,\n className,\n children,\n isCloseable = false,\n usage = 'inline',\n htmlAttributes,\n isAlert = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, BannerProps>) => {\n const Element: React.ElementType = as ?? 'section';\n\n const classes = classNames('ndl-banner', className, {\n 'ndl-danger': variant === 'danger',\n 'ndl-global': usage === 'global',\n 'ndl-info': variant === 'info',\n 'ndl-inline': usage === 'inline',\n 'ndl-neutral': variant === 'neutral',\n 'ndl-success': variant === 'success',\n 'ndl-warning': variant === 'warning',\n });\n\n const handleClose = (\n event:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => {\n if (onClose && typeof onClose === 'function') {\n onClose(event);\n }\n };\n\n return (\n <Element\n className={classes}\n role={isAlert ? 'alert' : undefined}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {hasIcon && <StatusIcon variant={variant} />}\n <div className=\"ndl-banner-content\">{children}</div>\n {isCloseable && (\n <CleanIconButton\n size=\"small\"\n onClick={handleClose}\n description={null}\n htmlAttributes={{ 'aria-label': 'Close' }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </Element>\n );\n};\n\nconst Banner = Object.assign(BannerComponent, {\n Actions: BannerActions,\n Description: BannerDescription,\n Header: BannerHeader,\n});\n\nexport { Banner };\n"]}
@@ -53,18 +53,18 @@ const ButtonBase = (_a) => {
53
53
  [`ndl-${buttonFill}-button`]: buttonFill,
54
54
  [`ndl-${variant}`]: variant,
55
55
  });
56
- const handleClick = (e) => {
56
+ const handleClick = (event) => {
57
57
  if (!isInteractable) {
58
58
  // By default, a <button /> element with disabled set to true will not get its
59
59
  // on click handler called. To support the same behavior on <a /> tags we
60
60
  // swallow the event here when disabled, since the <a /> tag with disabled set to
61
61
  // true will have its onClick handler called
62
- e.preventDefault();
63
- e.stopPropagation();
62
+ event.preventDefault();
63
+ event.stopPropagation();
64
64
  return;
65
65
  }
66
66
  if (onClick) {
67
- onClick(e);
67
+ onClick(event);
68
68
  }
69
69
  };
70
70
  return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ type: type, onClick: handleClick, disabled: isDisabled, "aria-disabled": !isInteractable, className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsxs)("div", { className: "ndl-btn-inner", children: [Boolean(leadingVisual) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-btn-leading-element", children: leadingVisual })), Boolean(children) && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-btn-content", children: children })), isLoading && ((0, jsx_runtime_1.jsx)(ButtonSpinner_1.ButtonSpinner, { loadingMessage: loadingMessage, size: size }))] }) })));
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/button/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAGpC,4DAAyD;AAgElD,MAAM,UAAU,GAAG,CAAyC,EAoBtB,EAAE,EAAE;QApBkB,EACjE,EAAE,EACF,UAAU,GAAG,QAAQ,EACrB,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,cAAc,EACd,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,SAAS,GAAG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3B,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,gCAAK,SAAS,EAAC,yBAAyB,YAAE,aAAa,GAAO,CAC/D,EACA,OAAO,CAAC,QAAQ,CAAC,IAAI,CACpB,iCAAM,SAAS,EAAC,iBAAiB,YAAE,QAAQ,GAAQ,CACpD,EACA,SAAS,IAAI,CACZ,uBAAC,6BAAa,IAAC,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,GAAI,CAC9D,IACG,IACI,CACb,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,UAAU,cA2ErB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { ButtonSpinner } from '../_common/ButtonSpinner';\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\n\n/**\n *\n * Types\n *\n */\n\ntype ButtonTypes = 'submit' | 'button' | 'reset';\nexport type ButtonSizes = 'small' | 'medium' | 'large';\nexport type ButtonVariants = 'primary' | 'danger' | 'neutral';\n\nexport type CommonButtonProps = {\n children?: React.ReactNode;\n /** Icon to display before the button content */\n leadingVisual?: React.ReactNode;\n /** If the button is doing something Async, it will display a loading spinner */\n isLoading?: boolean;\n /** If the button is in disabled state */\n isDisabled?: boolean;\n /** If the button is fluid, it will take the full width of its container */\n isFluid?: boolean;\n /** Type of button */\n type?: ButtonTypes;\n /** Size of button */\n size?: ButtonSizes;\n /** onClick callback*/\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** onKeyDown callback */\n onKeyDown?: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n /** Accessible message for screen readers when the button is in a loading state */\n loadingMessage?: string;\n} /**\n * If `as=\"a\"`, `href` is required and `target` is available.\n * For all other elements, these props are not present.\n */ & (\n | {\n as: 'a';\n /** The URL to link to. Only applies when `as=\"a\"` */\n href?: HtmlAttributes<'a'>['href'];\n /**\n * The target window for the link. Only applies when `as=\"a\"`.\n * Not present or required for other element types.\n */\n target?: HtmlAttributes<'a'>['target'];\n }\n | {\n as?: React.ElementType;\n }\n);\n\ntype ButtonBaseProps = CommonButtonProps & {\n /** If the button is in floating state */\n isFloating?: boolean;\n /** variant of the button */\n variant?: ButtonVariants;\n /** fill of the button */\n buttonFill?: 'filled' | 'outlined' | 'text';\n};\n\nexport const ButtonBase = <T extends React.ElementType = 'button'>({\n as,\n buttonFill = 'filled',\n children,\n className,\n variant = 'primary',\n htmlAttributes,\n isDisabled = false,\n isFloating = false,\n isFluid = false,\n isLoading = false,\n leadingVisual,\n onClick,\n ref,\n size = 'medium',\n style,\n type = 'button',\n // TODO v5: maybe update default message to 'Loading'. This value is for backward compatibility with loading spinners old aria-label\n loadingMessage = 'Loading content',\n ...restProps\n}: PolymorphicCommonProps<T, ButtonBaseProps>) => {\n const Component: React.ElementType = as ?? 'button';\n const isInteractable = !isDisabled && !isLoading;\n\n const classes = classNames(className, 'ndl-btn', {\n 'ndl-disabled': isDisabled,\n 'ndl-floating': isFloating,\n 'ndl-fluid': isFluid,\n 'ndl-loading': isLoading,\n [`ndl-${size}`]: size,\n [`ndl-${buttonFill}-button`]: buttonFill,\n [`ndl-${variant}`]: variant,\n });\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (!isInteractable) {\n // By default, a <button /> element with disabled set to true will not get its\n // on click handler called. To support the same behavior on <a /> tags we\n // swallow the event here when disabled, since the <a /> tag with disabled set to\n // true will have its onClick handler called\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n if (onClick) {\n onClick(e);\n }\n };\n\n return (\n <Component\n type={type}\n onClick={handleClick}\n disabled={isDisabled}\n aria-disabled={!isInteractable}\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-btn-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-btn-leading-element\">{leadingVisual}</div>\n )}\n {Boolean(children) && (\n <span className=\"ndl-btn-content\">{children}</span>\n )}\n {isLoading && (\n <ButtonSpinner loadingMessage={loadingMessage} size={size} />\n )}\n </div>\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/button/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAGpC,4DAAyD;AAgElD,MAAM,UAAU,GAAG,CAAyC,EAoBtB,EAAE,EAAE;QApBkB,EACjE,EAAE,EACF,UAAU,GAAG,QAAQ,EACrB,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,cAAc,EACd,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,KAAK,EACjB,aAAa,EACb,OAAO,EACP,GAAG,EACH,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,IAAI,GAAG,QAAQ;IACf,oIAAoI;IACpI,cAAc,GAAG,iBAAiB,OAES,EADxC,SAAS,cAnBqD,4MAoBlE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC;IAEjD,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,SAAS,EAAE,SAAS,EAAE;QAC/C,cAAc,EAAE,UAA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AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { ButtonSpinner } from '../_common/ButtonSpinner';\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\n\n/**\n *\n * Types\n *\n */\n\ntype ButtonTypes = 'submit' | 'button' | 'reset';\nexport type ButtonSizes = 'small' | 'medium' | 'large';\nexport type ButtonVariants = 'primary' | 'danger' | 'neutral';\n\nexport type CommonButtonProps = {\n children?: React.ReactNode;\n /** Icon to display before the button content */\n leadingVisual?: React.ReactNode;\n /** If the button is doing something Async, it will display a loading spinner */\n isLoading?: boolean;\n /** If the button is in disabled state */\n isDisabled?: boolean;\n /** If the button is fluid, it will take the full width of its container */\n isFluid?: boolean;\n /** Type of button */\n type?: ButtonTypes;\n /** Size of button */\n size?: ButtonSizes;\n /** onClick callback*/\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** onKeyDown callback */\n onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n /** Accessible message for screen readers when the button is in a loading state */\n loadingMessage?: string;\n} /**\n * If `as=\"a\"`, `href` is required and `target` is available.\n * For all other elements, these props are not present.\n */ & (\n | {\n as: 'a';\n /** The URL to link to. Only applies when `as=\"a\"` */\n href?: HtmlAttributes<'a'>['href'];\n /**\n * The target window for the link. Only applies when `as=\"a\"`.\n * Not present or required for other element types.\n */\n target?: HtmlAttributes<'a'>['target'];\n }\n | {\n as?: React.ElementType;\n }\n);\n\ntype ButtonBaseProps = CommonButtonProps & {\n /** If the button is in floating state */\n isFloating?: boolean;\n /** variant of the button */\n variant?: ButtonVariants;\n /** fill of the button */\n buttonFill?: 'filled' | 'outlined' | 'text';\n};\n\nexport const ButtonBase = <T extends React.ElementType = 'button'>({\n as,\n buttonFill = 'filled',\n children,\n className,\n variant = 'primary',\n htmlAttributes,\n isDisabled = false,\n isFloating = false,\n isFluid = false,\n isLoading = false,\n leadingVisual,\n onClick,\n ref,\n size = 'medium',\n style,\n type = 'button',\n // TODO v5: maybe update default message to 'Loading'. This value is for backward compatibility with loading spinners old aria-label\n loadingMessage = 'Loading content',\n ...restProps\n}: PolymorphicCommonProps<T, ButtonBaseProps>) => {\n const Component: React.ElementType = as ?? 'button';\n const isInteractable = !isDisabled && !isLoading;\n\n const classes = classNames(className, 'ndl-btn', {\n 'ndl-disabled': isDisabled,\n 'ndl-floating': isFloating,\n 'ndl-fluid': isFluid,\n 'ndl-loading': isLoading,\n [`ndl-${size}`]: size,\n [`ndl-${buttonFill}-button`]: buttonFill,\n [`ndl-${variant}`]: variant,\n });\n\n const handleClick = (\n event: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n ) => {\n if (!isInteractable) {\n // By default, a <button /> element with disabled set to true will not get its\n // on click handler called. To support the same behavior on <a /> tags we\n // swallow the event here when disabled, since the <a /> tag with disabled set to\n // true will have its onClick handler called\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <Component\n type={type}\n onClick={handleClick}\n disabled={isDisabled}\n aria-disabled={!isInteractable}\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-btn-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-btn-leading-element\">{leadingVisual}</div>\n )}\n {Boolean(children) && (\n <span className=\"ndl-btn-content\">{children}</span>\n )}\n {isLoading && (\n <ButtonSpinner loadingMessage={loadingMessage} size={size} />\n )}\n </div>\n </Component>\n );\n};\n"]}
@@ -25,7 +25,7 @@ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const icons_1 = require("@neo4j-ndl/react/icons");
27
27
  const Component = () => {
28
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "small", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Small" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "medium", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Medium" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "large", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Large" })] })] }));
28
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "small", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-4", children: " Small" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "medium", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-4", children: " Medium" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", size: "large", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-4", children: " Large" })] })] }));
29
29
  };
30
30
  exports.default = Component;
31
31
  //# sourceMappingURL=clean-icon-button-sizes.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clean-icon-button-sizes.story.js","sourceRoot":"","sources":["../../../../src/clean-icon-button/stories/clean-icon-button-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,kDAAoE;AAEpE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,YAChD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,uBAAoB,IAC3C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,YACjD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,wBAAqB,IAC5C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,YAChD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,uBAAoB,IAC3C,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { MagnifyingGlassIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"small\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"label\"> Small</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"medium\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"label\"> Medium</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"large\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"label\"> Large</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"clean-icon-button-sizes.story.js","sourceRoot":"","sources":["../../../../src/clean-icon-button/stories/clean-icon-button-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,kDAAoE;AAEpE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,YAChD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,uBAAoB,IAC7C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,YACjD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,wBAAqB,IAC9C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,YAChD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,uBAAoB,IAC7C,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { MagnifyingGlassIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"small\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"title-4\"> Small</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"medium\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"title-4\"> Medium</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" size=\"large\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"title-4\"> Large</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -25,7 +25,7 @@ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const icons_1 = require("@neo4j-ndl/react/icons");
27
27
  const Component = () => {
28
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", variant: "neutral", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: "Default" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", variant: "danger", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: "Danger" })] })] }));
28
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", variant: "neutral", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-4", children: "Default" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-16 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { description: "Search", variant: "danger", children: (0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-4", children: "Danger" })] })] }));
29
29
  };
30
30
  exports.default = Component;
31
31
  //# sourceMappingURL=clean-icon-button-tone.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clean-icon-button-tone.story.js","sourceRoot":"","sources":["../../../../src/clean-icon-button/stories/clean-icon-button-tone.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,kDAAoE;AAEpE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,YACrD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,wBAAqB,IAC5C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,YACpD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,uBAAoB,IAC3C,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { MagnifyingGlassIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" variant=\"neutral\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"label\">Default</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" variant=\"danger\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"label\">Danger</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"clean-icon-button-tone.story.js","sourceRoot":"","sources":["../../../../src/clean-icon-button/stories/clean-icon-button-tone.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,kDAAoE;AAEpE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,YACrD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,wBAAqB,IAC9C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,uBAAe,IAAC,WAAW,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,YACpD,uBAAC,kCAA0B,KAAG,GACd,EAClB,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,uBAAoB,IAC7C,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { MagnifyingGlassIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" variant=\"neutral\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"title-4\">Default</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <CleanIconButton description=\"Search\" variant=\"danger\">\n <MagnifyingGlassIconOutline />\n </CleanIconButton>\n <Typography variant=\"title-4\">Danger</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -46,12 +46,12 @@ const Code = (_a) => {
46
46
  'ndl-disabled': isDisabled,
47
47
  'ndl-runnable': isRunnable,
48
48
  }, className);
49
- const handleClick = (e) => {
49
+ const handleClick = (event) => {
50
50
  if (isDisabled) {
51
- e.preventDefault();
51
+ event.preventDefault();
52
52
  return;
53
53
  }
54
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
54
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
55
55
  };
56
56
  return ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: Boolean(description) === true, wrap: (children) => ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { type: "simple", children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Trigger, { hasButtonWrapper: Component === 'button', children: children }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Content, { children: description })] })), children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ className: classes, style: style, onClick: handleClick, disabled: isDisabled, ref: ref }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsx)("code", { children: children }) })) }));
57
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../src/code/Code.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAGpC,0DAAsD;AACtD,wCAAqC;AAmB9B,MAAM,IAAI,GAAG,CAAyC,EAYtB,EAAE,EAAE;QAZkB,EAC3D,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,OAAO,EACP,EAAE,EACF,GAAG,EACH,cAAc,OAEuB,EADlC,SAAS,cAX+C,uHAY5D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,IAAA,oBAAU,EACxB,UAAU,EACV;QACE,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;KAC3B,EACD,SAAS,CACV,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAA4C,EAAE,EAAE;QACnE,IAAI,UAAU,EAAE,CAAC;YACf,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,kCAAe,IACd,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,EACzC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAClB,wBAAC,iBAAO,IAAC,IAAI,EAAC,QAAQ,aACpB,uBAAC,iBAAO,CAAC,OAAO,IAAC,gBAAgB,EAAE,SAAS,KAAK,QAAQ,YACtD,QAAQ,GACO,EAClB,uBAAC,iBAAO,CAAC,OAAO,cAAE,WAAW,GAAmB,IACxC,CACX,YAED,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,UAAU,EACpB,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAElB,2CAAO,QAAQ,GAAQ,IACb,GACI,CACnB,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,IAAI,QA0Df","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 classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { Tooltip } from '../tooltip';\n\ntype CodeProps = {\n /** The content of the code */\n children?: React.ReactNode;\n /** Whether the code is disabled */\n isDisabled?: boolean;\n /** Whether the code is runnable */\n isRunnable?: boolean;\n /** The description of the code, will be displayed in a tooltip */\n description?: string;\n /** The callback function triggered when the inline code is clicked */\n onClick?: (\n e:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\nexport const Code = <T extends React.ElementType = 'button'>({\n children,\n className,\n isDisabled = false,\n style,\n isRunnable = false,\n description,\n onClick,\n as,\n ref,\n htmlAttributes,\n ...restProps\n}: PolymorphicCommonProps<T, CodeProps>) => {\n const Component: React.ElementType = as ?? (onClick ? 'button' : 'span');\n\n const classes = classNames(\n 'ndl-code',\n {\n 'ndl-disabled': isDisabled,\n 'ndl-runnable': isRunnable,\n },\n className,\n );\n\n const handleClick = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (isDisabled) {\n e.preventDefault();\n return;\n }\n\n onClick?.(e);\n };\n\n return (\n <ConditionalWrap\n shouldWrap={Boolean(description) === true}\n wrap={(children) => (\n <Tooltip type=\"simple\">\n <Tooltip.Trigger hasButtonWrapper={Component === 'button'}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content>{description}</Tooltip.Content>\n </Tooltip>\n )}\n >\n <Component\n className={classes}\n style={style}\n onClick={handleClick}\n disabled={isDisabled}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <code>{children}</code>\n </Component>\n </ConditionalWrap>\n );\n};\n"]}
1
+ {"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../src/code/Code.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAGpC,0DAAsD;AACtD,wCAAqC;AAmB9B,MAAM,IAAI,GAAG,CAAyC,EAYtB,EAAE,EAAE;QAZkB,EAC3D,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,OAAO,EACP,EAAE,EACF,GAAG,EACH,cAAc,OAEuB,EADlC,SAAS,cAX+C,uHAY5D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,IAAA,oBAAU,EACxB,UAAU,EACV;QACE,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;KAC3B,EACD,SAAS,CACV,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,KAAgD,EAAE,EAAE;QACvE,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,kCAAe,IACd,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,EACzC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAClB,wBAAC,iBAAO,IAAC,IAAI,EAAC,QAAQ,aACpB,uBAAC,iBAAO,CAAC,OAAO,IAAC,gBAAgB,EAAE,SAAS,KAAK,QAAQ,YACtD,QAAQ,GACO,EAClB,uBAAC,iBAAO,CAAC,OAAO,cAAE,WAAW,GAAmB,IACxC,CACX,YAED,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,UAAU,EACpB,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAElB,2CAAO,QAAQ,GAAQ,IACb,GACI,CACnB,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,IAAI,QA0Df","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 classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { Tooltip } from '../tooltip';\n\ntype CodeProps = {\n /** The content of the code */\n children?: React.ReactNode;\n /** Whether the code is disabled */\n isDisabled?: boolean;\n /** Whether the code is runnable */\n isRunnable?: boolean;\n /** The description of the code, will be displayed in a tooltip */\n description?: string;\n /** The callback function triggered when the inline code is clicked */\n onClick?: (\n event:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\nexport const Code = <T extends React.ElementType = 'button'>({\n children,\n className,\n isDisabled = false,\n style,\n isRunnable = false,\n description,\n onClick,\n as,\n ref,\n htmlAttributes,\n ...restProps\n}: PolymorphicCommonProps<T, CodeProps>) => {\n const Component: React.ElementType = as ?? (onClick ? 'button' : 'span');\n\n const classes = classNames(\n 'ndl-code',\n {\n 'ndl-disabled': isDisabled,\n 'ndl-runnable': isRunnable,\n },\n className,\n );\n\n const handleClick = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <ConditionalWrap\n shouldWrap={Boolean(description) === true}\n wrap={(children) => (\n <Tooltip type=\"simple\">\n <Tooltip.Trigger hasButtonWrapper={Component === 'button'}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content>{description}</Tooltip.Content>\n </Tooltip>\n )}\n >\n <Component\n className={classes}\n style={style}\n onClick={handleClick}\n disabled={isDisabled}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <code>{children}</code>\n </Component>\n </ConditionalWrap>\n );\n};\n"]}
@@ -81,9 +81,9 @@ const CodeBlock = (_a) => {
81
81
  // wrapLongLines
82
82
  showLineNumbers: shouldShowLineNumbers, children: code }) }) })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('ndl-code-block-actions', {
83
83
  'ndl-disabled': isDisabled,
84
- }), children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, i) => {
84
+ }), children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, index) => {
85
85
  var _a;
86
- return ((0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, Object.assign({ isDisabled: isDisabled }, iconButtonProps, { description: `${(_a = iconButtonProps.description) !== null && _a !== void 0 ? _a : 'CodeBlock Action'}`, htmlAttributes: Object.assign({ 'data-testid': `ndl-action-button-${i}` }, iconButtonProps.htmlAttributes) }), i));
86
+ return ((0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, Object.assign({ isDisabled: isDisabled }, iconButtonProps, { description: `${(_a = iconButtonProps.description) !== null && _a !== void 0 ? _a : 'CodeBlock Action'}`, htmlAttributes: Object.assign({ 'data-testid': `ndl-action-button-${index}` }, iconButtonProps.htmlAttributes) }), index));
87
87
  }) }), shouldShowExpandButton && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-code-block-expand-button", children: (0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { description: isExpanded ? 'Collapse' : 'Expand', tooltipProps: {
88
88
  root: {
89
89
  shouldCloseOnReferenceClick: true,
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,uEAA2E;AAG3E,4DAAuD;AAEvD,gGAA6F;AAC7F,4FAAyF;AAGzF,iEAA4D;AAC5D,2DAAsD;AACtD,2DAAuD;AAavD,MAAM,cAAc,GAAG,KAAK,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAyC,EAgBtB,EAAE,EAAE;;QAhBkB,EAChE,EAAE,EACF,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAGuC,EAFvC,SAAS,cAdoD,4JAgBjE,CAFa;IACZ,wEAAwE;;IAExE,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,cAAc,CAAC;IAE1D,MAAM,EACJ,eAAe,EACf,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,GAAG,EAAE,2BAA2B,GACjC,GAAG,IAAA,8BAAa,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,KAAK,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,QAAQ,CAAC,CAAC;IAE/C,MAAM,YAAY,GAAG,SAAS,KAAK,SAAS,CAAC;IAC7C,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CA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C,+CAAsB,KAAG,GACnD,GACd,CACP,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AArIW,QAAA,SAAS,aAqIpB","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 { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { type IconButton } from '../icon-button';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronUpIconOutline } from '../icons/generated/heroIcons/ChevronUpIconOutline';\nimport { type LanguageProp } from './code-languages';\nimport { type CodeTheme } from './code-themes';\nimport { useCodeLanguage } from './hooks/use-code-language';\nimport { useCodeTheme } from './hooks/use-code-theme';\nimport { useExpandable } from './hooks/use-expandable';\n\ninterface CodeBlockProps {\n code: string;\n isDisabled?: boolean;\n maxHeight?: number;\n language: LanguageProp | 'text';\n shouldShowLineNumbers?: boolean;\n theme?: CodeTheme;\n heading?: React.ReactNode;\n actions?: React.ComponentProps<typeof IconButton<'button'>>[];\n}\n\nconst defaultElement = 'div';\n\nexport const CodeBlock = <T extends React.ElementType = 'button'>({\n as,\n maxHeight,\n code,\n language,\n shouldShowLineNumbers,\n theme,\n heading,\n actions,\n isDisabled,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n // TODO: Should not be polymorphic (at least not defaulting to a button)\n}: PolymorphicCommonProps<T, CodeBlockProps>) => {\n const Component: React.ElementType = as ?? defaultElement;\n\n const {\n containerHeight,\n isExpanded,\n toggleExpand,\n hasOverflowingContent,\n ref: syntaxHighlighterWrapperRef,\n } = useExpandable(maxHeight, code);\n const codeTheme = useCodeTheme(theme);\n const codeLanguage = useCodeLanguage(language);\n\n const hasMaxHeight = maxHeight !== undefined;\n const hasHeading = Boolean(heading);\n const numberOfActions = actions?.length ?? 0;\n\n const shouldShowExpandButton = hasMaxHeight && hasOverflowingContent;\n const rightPadding = hasHeading\n ? 0\n : Math.max(numberOfActions * 36, (shouldShowExpandButton ? 1 : 0) * 36) + 8;\n\n return (\n <Component\n ref={ref}\n className={classNames('ndl-code-block-container', className)}\n style={{ height: containerHeight, ...style }}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"n-flex n-flex-col n-h-full\">\n {hasHeading && (\n <div\n className={classNames('ndl-code-block-title', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n maxWidth: `calc(100% - ${(actions?.length ?? 0) * 36 + 20}px)`,\n }}\n data-testid=\"ndl-code-block-title\"\n >\n {heading}\n </div>\n )}\n <div\n className={classNames('ndl-code-content-container', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n height: hasHeading ? 'calc(100% - 24px - 12px)' : '100%',\n }}\n >\n <div\n ref={syntaxHighlighterWrapperRef}\n className=\"ndl-highlight-wrapper\"\n tabIndex={0}\n role=\"region\"\n aria-label={`Code content ${isDisabled ? '(disabled)' : ''}`}\n >\n <SyntaxHighlighter\n language={codeLanguage}\n style={{\n ...codeTheme,\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n padding: `0 ${rightPadding}px 0.75em 0.75em`,\n width: 'fit-content',\n },\n }}\n codeTagProps={{ className: 'n-code' }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n showLineNumbers={shouldShowLineNumbers}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </div>\n </div>\n <div\n className={classNames('ndl-code-block-actions', {\n 'ndl-disabled': isDisabled,\n })}\n >\n {actions?.map((iconButtonProps, i) => (\n <CleanIconButton\n key={i}\n isDisabled={isDisabled}\n {...iconButtonProps}\n description={`${iconButtonProps.description ?? 'CodeBlock Action'}`}\n htmlAttributes={{\n 'data-testid': `ndl-action-button-${i}`,\n ...iconButtonProps.htmlAttributes,\n }}\n />\n ))}\n </div>\n {shouldShowExpandButton && (\n <div className=\"ndl-code-block-expand-button\">\n <CleanIconButton\n description={isExpanded ? 'Collapse' : 'Expand'}\n tooltipProps={{\n root: {\n shouldCloseOnReferenceClick: true,\n },\n }}\n onClick={toggleExpand}\n >\n {isExpanded ? <ChevronUpIconOutline /> : <ChevronDownIconOutline />}\n </CleanIconButton>\n </div>\n )}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,uEAA2E;AAG3E,4DAAuD;AAEvD,gGAA6F;AAC7F,4FAAyF;AAGzF,iEAA4D;AAC5D,2DAAsD;AACtD,2DAAuD;AAavD,MAAM,cAAc,GAAG,KAAK,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAyC,EAgBtB,EAAE,EAAE;;QAhBkB,EAChE,EAAE,EACF,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAGuC,EAFvC,SAAS,cAdoD,4JAgBjE,CAFa;IACZ,wEAAwE;;IAExE,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,cAAc,CAA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Ac,MAN9B,KAAK,CAQV,CACH,CAAA;iBAAA,CAAC,GACE,EACL,sBAAsB,IAAI,CACzB,gCAAK,SAAS,EAAC,8BAA8B,YAC3C,uBAAC,mCAAe,IACd,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAC/C,YAAY,EAAE;wBACZ,IAAI,EAAE;4BACJ,2BAA2B,EAAE,IAAI;yBAClC;qBACF,EACD,OAAO,EAAE,YAAY,YAEpB,UAAU,CAAC,CAAC,CAAC,uBAAC,2CAAoB,KAAG,CAAC,CAAC,CAAC,uBAAC,+CAAsB,KAAG,GACnD,GACd,CACP,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AArIW,QAAA,SAAS,aAqIpB","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 { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { type IconButton } from '../icon-button';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronUpIconOutline } from '../icons/generated/heroIcons/ChevronUpIconOutline';\nimport { type LanguageProp } from './code-languages';\nimport { type CodeTheme } from './code-themes';\nimport { useCodeLanguage } from './hooks/use-code-language';\nimport { useCodeTheme } from './hooks/use-code-theme';\nimport { useExpandable } from './hooks/use-expandable';\n\ninterface CodeBlockProps {\n code: string;\n isDisabled?: boolean;\n maxHeight?: number;\n language: LanguageProp | 'text';\n shouldShowLineNumbers?: boolean;\n theme?: CodeTheme;\n heading?: React.ReactNode;\n actions?: React.ComponentProps<typeof IconButton<'button'>>[];\n}\n\nconst defaultElement = 'div';\n\nexport const CodeBlock = <T extends React.ElementType = 'button'>({\n as,\n maxHeight,\n code,\n language,\n shouldShowLineNumbers,\n theme,\n heading,\n actions,\n isDisabled,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n // TODO: Should not be polymorphic (at least not defaulting to a button)\n}: PolymorphicCommonProps<T, CodeBlockProps>) => {\n const Component: React.ElementType = as ?? defaultElement;\n\n const {\n containerHeight,\n isExpanded,\n toggleExpand,\n hasOverflowingContent,\n ref: syntaxHighlighterWrapperRef,\n } = useExpandable(maxHeight, code);\n const codeTheme = useCodeTheme(theme);\n const codeLanguage = useCodeLanguage(language);\n\n const hasMaxHeight = maxHeight !== undefined;\n const hasHeading = Boolean(heading);\n const numberOfActions = actions?.length ?? 0;\n\n const shouldShowExpandButton = hasMaxHeight && hasOverflowingContent;\n const rightPadding = hasHeading\n ? 0\n : Math.max(numberOfActions * 36, (shouldShowExpandButton ? 1 : 0) * 36) + 8;\n\n return (\n <Component\n ref={ref}\n className={classNames('ndl-code-block-container', className)}\n style={{ height: containerHeight, ...style }}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"n-flex n-flex-col n-h-full\">\n {hasHeading && (\n <div\n className={classNames('ndl-code-block-title', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n maxWidth: `calc(100% - ${(actions?.length ?? 0) * 36 + 20}px)`,\n }}\n data-testid=\"ndl-code-block-title\"\n >\n {heading}\n </div>\n )}\n <div\n className={classNames('ndl-code-content-container', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n height: hasHeading ? 'calc(100% - 24px - 12px)' : '100%',\n }}\n >\n <div\n ref={syntaxHighlighterWrapperRef}\n className=\"ndl-highlight-wrapper\"\n tabIndex={0}\n role=\"region\"\n aria-label={`Code content ${isDisabled ? '(disabled)' : ''}`}\n >\n <SyntaxHighlighter\n language={codeLanguage}\n style={{\n ...codeTheme,\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n padding: `0 ${rightPadding}px 0.75em 0.75em`,\n width: 'fit-content',\n },\n }}\n codeTagProps={{ className: 'n-code' }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n showLineNumbers={shouldShowLineNumbers}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </div>\n </div>\n <div\n className={classNames('ndl-code-block-actions', {\n 'ndl-disabled': isDisabled,\n })}\n >\n {actions?.map((iconButtonProps, index) => (\n <CleanIconButton\n key={index}\n isDisabled={isDisabled}\n {...iconButtonProps}\n description={`${iconButtonProps.description ?? 'CodeBlock Action'}`}\n htmlAttributes={{\n 'data-testid': `ndl-action-button-${index}`,\n ...iconButtonProps.htmlAttributes,\n }}\n />\n ))}\n </div>\n {shouldShowExpandButton && (\n <div className=\"ndl-code-block-expand-button\">\n <CleanIconButton\n description={isExpanded ? 'Collapse' : 'Expand'}\n tooltipProps={{\n root: {\n shouldCloseOnReferenceClick: true,\n },\n }}\n onClick={toggleExpand}\n >\n {isExpanded ? <ChevronUpIconOutline /> : <ChevronDownIconOutline />}\n </CleanIconButton>\n </div>\n )}\n </Component>\n );\n};\n"]}
@@ -54,7 +54,7 @@ exports.ColorPicker = (0, react_1.forwardRef)(function ColorPicker({ color, onCh
54
54
  if (typeof color === 'object' && 'r' in color) {
55
55
  return (0, react_color_1.rgbaToHsva)(color);
56
56
  }
57
- return Object.assign(Object.assign({ h: 0, s: 0, v: 0 }, color), { a: 1 });
57
+ return Object.assign(Object.assign({ h: 0, s: 0, v: 0 }, color), { a: 1 }); // oxlint-disable-line id-length
58
58
  }, [color]);
59
59
  const [hsva, setHsva] = (0, react_1.useState)(derivedHsva);
60
60
  const [format, setFormat] = (0, react_1.useState)({
@@ -74,7 +74,7 @@ exports.ColorPicker = (0, react_1.forwardRef)(function ColorPicker({ color, onCh
74
74
  });
75
75
  };
76
76
  return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, classnames_1.default)('ndl-color-picker', className), style: style, children: [(0, jsx_runtime_1.jsx)(react_color_1.Saturation, { hsva: hsva, className: "ndl-color-picker-saturation", onChange: (newColor) => {
77
- handleChange(Object.assign(Object.assign(Object.assign({}, hsva), newColor), { a: hsva.a }));
77
+ handleChange(Object.assign(Object.assign(Object.assign({}, hsva), newColor), { a: hsva.a })); // oxlint-disable-line id-length
78
78
  }, pointer: (_a) => {
79
79
  var { left, top } = _a, props = __rest(_a, ["left", "top"]);
80
80
  return ((0, jsx_runtime_1.jsx)(Pointer, Object.assign({ left: left === null || left === void 0 ? void 0 : left.toString(), top: top === null || top === void 0 ? void 0 : top.toString() }, props, { hsva: hsva })));
@@ -98,12 +98,12 @@ exports.ColorPicker = (0, react_1.forwardRef)(function ColorPicker({ color, onCh
98
98
  setIsEyeDropperActiveState(false);
99
99
  });
100
100
  }, description: "Pick color from the screen with eye dropper tool", children: (0, jsx_runtime_1.jsx)(EyeDropperIconOutline_1.EyeDropperIconOutline, {}) })), (0, jsx_runtime_1.jsx)(react_color_1.Hue, { className: "ndl-color-picker-hue", hue: hsva.h, onChange: (newHue) => {
101
- handleChange(Object.assign(Object.assign({}, hsva), { h: newHue.h }));
101
+ handleChange(Object.assign(Object.assign({}, hsva), { h: newHue.h })); // oxlint-disable-line id-length
102
102
  }, radius: base_1.tokens.borderRadius['lg'], pointer: (props) => ((0, jsx_runtime_1.jsx)(Pointer, Object.assign({}, props, { hsva: {
103
- a: 1,
104
- h: hsva.h,
105
- s: 100,
106
- v: 100,
103
+ a: 1, // oxlint-disable-line id-length
104
+ h: hsva.h, // oxlint-disable-line id-length
105
+ s: 100, // oxlint-disable-line id-length
106
+ v: 100, // oxlint-disable-line id-length
107
107
  } }))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-inputs", children: [(0, jsx_runtime_1.jsx)(select_1.Select, { size: "small", type: "select", ariaLabel: "Color format", style: {
108
108
  flexShrink: 0,
109
109
  }, selectProps: {
@@ -143,8 +143,8 @@ const HexInput = ({ hsva, onChange, }) => {
143
143
  (0, react_1.useEffect)(() => {
144
144
  setInputValue(removeHashPrefix((0, react_color_1.hsvaToHex)(hsva)));
145
145
  }, [hsva]);
146
- const handleChange = (e) => {
147
- const value = removeHashPrefix(e.target.value);
146
+ const handleChange = (event) => {
147
+ const value = removeHashPrefix(event.target.value);
148
148
  // Always update the input value for immediate feedback
149
149
  setInputValue(value);
150
150
  // Check if the input is a valid hex color (only 6 characters)
@@ -157,8 +157,8 @@ const HexInput = ({ hsva, onChange, }) => {
157
157
  return ((0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", value: inputValue, leadingElement: (0, jsx_runtime_1.jsx)("div", { className: "ndl-color-picker-hex-input-prefix", children: "#" }), onChange: handleChange, isFluid: true, htmlAttributes: {
158
158
  'aria-label': 'Hex color code',
159
159
  maxLength: 6,
160
- onCopy: (e) => {
161
- e.preventDefault();
160
+ onCopy: (event) => {
161
+ event.preventDefault();
162
162
  navigator.clipboard.writeText(hexValue);
163
163
  },
164
164
  } }));
@@ -166,21 +166,21 @@ const HexInput = ({ hsva, onChange, }) => {
166
166
  const RgbInput = ({ hsva, onChange, }) => {
167
167
  const rgba = (0, react_color_1.hsvaToRgba)(hsva);
168
168
  const [rgbValues, setRgbValues] = (0, react_1.useState)({
169
- b: rgba.b,
170
- g: rgba.g,
171
- r: rgba.r,
169
+ b: rgba.b, // oxlint-disable-line id-length
170
+ g: rgba.g, // oxlint-disable-line id-length
171
+ r: rgba.r, // oxlint-disable-line id-length
172
172
  });
173
173
  // Update input values when hsva changes from outside
174
174
  (0, react_1.useEffect)(() => {
175
175
  const newRgba = (0, react_color_1.hsvaToRgba)(hsva);
176
176
  setRgbValues({
177
- b: newRgba.b,
178
- g: newRgba.g,
179
- r: newRgba.r,
177
+ b: newRgba.b, // oxlint-disable-line id-length
178
+ g: newRgba.g, // oxlint-disable-line id-length
179
+ r: newRgba.r, // oxlint-disable-line id-length
180
180
  });
181
181
  }, [hsva]);
182
- const handleChange = (channel, e) => {
183
- const value = parseInt(e.target.value, 10);
182
+ const handleChange = (channel, event) => {
183
+ const value = parseInt(event.target.value, 10);
184
184
  // Validate the input is a number between 0-255
185
185
  const validValue = isNaN(value) ? 0 : Math.max(0, Math.min(255, value));
186
186
  const newRgbValues = Object.assign(Object.assign({}, rgbValues), { [channel]: validValue });
@@ -189,17 +189,17 @@ const RgbInput = ({ hsva, onChange, }) => {
189
189
  const hexColor = `#${newRgbValues.r.toString(16).padStart(2, '0')}${newRgbValues.g.toString(16).padStart(2, '0')}${newRgbValues.b.toString(16).padStart(2, '0')}`;
190
190
  onChange(hexColor);
191
191
  };
192
- return ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-rgb-inputs", children: [(0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.r.toString(), onChange: (e) => handleChange('r', e), htmlAttributes: {
192
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-rgb-inputs", children: [(0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.r.toString(), onChange: (event) => handleChange('r', event), htmlAttributes: {
193
193
  'aria-label': 'Red',
194
194
  max: '255',
195
195
  min: '0',
196
196
  type: 'number',
197
- } }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.g.toString(), onChange: (e) => handleChange('g', e), htmlAttributes: {
197
+ } }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.g.toString(), onChange: (event) => handleChange('g', event), htmlAttributes: {
198
198
  'aria-label': 'Green',
199
199
  max: '255',
200
200
  min: '0',
201
201
  type: 'number',
202
- } }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.b.toString(), onChange: (e) => handleChange('b', e), htmlAttributes: {
202
+ } }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.b.toString(), onChange: (event) => handleChange('b', event), htmlAttributes: {
203
203
  'aria-label': 'Blue',
204
204
  max: '255',
205
205
  min: '0',