@neo4j-ndl/react 4.9.18 → 4.9.19

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 (354) hide show
  1. package/lib/cjs/_common/ButtonSpinner.js +53 -0
  2. package/lib/cjs/_common/ButtonSpinner.js.map +1 -0
  3. package/lib/cjs/button/ButtonBase.js +5 -3
  4. package/lib/cjs/button/ButtonBase.js.map +1 -1
  5. package/lib/cjs/button/stories/button-loading.story.js +1 -1
  6. package/lib/cjs/button/stories/button-loading.story.js.map +1 -1
  7. package/lib/cjs/clean-icon-button/stories/clean-icon-button-loading.story.js +1 -1
  8. package/lib/cjs/clean-icon-button/stories/clean-icon-button-loading.story.js.map +1 -1
  9. package/lib/cjs/color-picker/ColorPicker.js +1 -1
  10. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  11. package/lib/cjs/dialog/stories/dialog-danger.story.js +1 -1
  12. package/lib/cjs/dialog/stories/dialog-danger.story.js.map +1 -1
  13. package/lib/cjs/dialog/stories/dialog-default.story.js +1 -1
  14. package/lib/cjs/dialog/stories/dialog-default.story.js.map +1 -1
  15. package/lib/cjs/dialog/stories/dialog-image.story.js +1 -1
  16. package/lib/cjs/dialog/stories/dialog-image.story.js.map +1 -1
  17. package/lib/cjs/dialog/stories/dialog-info.story.js +1 -1
  18. package/lib/cjs/dialog/stories/dialog-info.story.js.map +1 -1
  19. package/lib/cjs/dialog/stories/dialog-top-aligned.story.js +1 -1
  20. package/lib/cjs/dialog/stories/dialog-top-aligned.story.js.map +1 -1
  21. package/lib/cjs/dialog/stories/dialog-variants.story.js +1 -1
  22. package/lib/cjs/dialog/stories/dialog-variants.story.js.map +1 -1
  23. package/lib/cjs/dialog/stories/dialog-warning.story.js +1 -1
  24. package/lib/cjs/dialog/stories/dialog-warning.story.js.map +1 -1
  25. package/lib/cjs/dropdown-button/DropdownButton.js +18 -4
  26. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  27. package/lib/cjs/dropdown-button/stories/dropdown-button-loading.story.js +30 -0
  28. package/lib/cjs/dropdown-button/stories/dropdown-button-loading.story.js.map +1 -0
  29. package/lib/cjs/dropdown-button/stories/index.js +5 -1
  30. package/lib/cjs/dropdown-button/stories/index.js.map +1 -1
  31. package/lib/cjs/icon-button/stories/icon-button-loading.story.js +1 -1
  32. package/lib/cjs/icon-button/stories/icon-button-loading.story.js.map +1 -1
  33. package/lib/cjs/icon-button-base/IconButtonBase.js +7 -3
  34. package/lib/cjs/icon-button-base/IconButtonBase.js.map +1 -1
  35. package/lib/cjs/menu/stories/menu-custom-items.story.js +1 -1
  36. package/lib/cjs/menu/stories/menu-custom-items.story.js.map +1 -1
  37. package/lib/cjs/menu/stories/menu-default.story.js +2 -2
  38. package/lib/cjs/menu/stories/menu-default.story.js.map +1 -1
  39. package/lib/cjs/menu/stories/menu-in-dialog.story.js +2 -2
  40. package/lib/cjs/menu/stories/menu-in-dialog.story.js.map +1 -1
  41. package/lib/cjs/menu/stories/menu-in-popover.story.js +1 -1
  42. package/lib/cjs/menu/stories/menu-in-popover.story.js.map +1 -1
  43. package/lib/cjs/menu/stories/menu-nested.story.js +1 -1
  44. package/lib/cjs/menu/stories/menu-nested.story.js.map +1 -1
  45. package/lib/cjs/menu/stories/menu-placements.story.js +2 -2
  46. package/lib/cjs/menu/stories/menu-placements.story.js.map +1 -1
  47. package/lib/cjs/menu/stories/menu-radio-and-normal.story.js +2 -2
  48. package/lib/cjs/menu/stories/menu-radio-and-normal.story.js.map +1 -1
  49. package/lib/cjs/menu/stories/menu-radio-items.story.js +2 -2
  50. package/lib/cjs/menu/stories/menu-radio-items.story.js.map +1 -1
  51. package/lib/cjs/menu/stories/menu-with-category.story.js +1 -1
  52. package/lib/cjs/menu/stories/menu-with-category.story.js.map +1 -1
  53. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js +1 -1
  54. package/lib/cjs/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  55. package/lib/cjs/menu/stories/menu-with-divider.story.js +1 -1
  56. package/lib/cjs/menu/stories/menu-with-divider.story.js.map +1 -1
  57. package/lib/cjs/menu/stories/menu-with-icon.story.js +1 -1
  58. package/lib/cjs/menu/stories/menu-with-icon.story.js.map +1 -1
  59. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js +1 -1
  60. package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  61. package/lib/cjs/select/Overrides.js +17 -2
  62. package/lib/cjs/select/Overrides.js.map +1 -1
  63. package/lib/cjs/select/Select.js +10 -5
  64. package/lib/cjs/select/Select.js.map +1 -1
  65. package/lib/cjs/select/types.js.map +1 -1
  66. package/lib/cjs/select-icon-button/SelectIconButton.js +16 -5
  67. package/lib/cjs/select-icon-button/SelectIconButton.js.map +1 -1
  68. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  69. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  70. package/lib/cjs/text-area/TextArea.js +1 -1
  71. package/lib/cjs/text-area/TextArea.js.map +1 -1
  72. package/lib/cjs/text-input/TextInput.js +1 -1
  73. package/lib/cjs/text-input/TextInput.js.map +1 -1
  74. package/lib/cjs/text-input/stories/text-input-clearable.story.js +1 -1
  75. package/lib/cjs/text-input/stories/text-input-clearable.story.js.map +1 -1
  76. package/lib/cjs/text-input/stories/text-input-default.story.js +1 -1
  77. package/lib/cjs/text-input/stories/text-input-default.story.js.map +1 -1
  78. package/lib/cjs/text-input/stories/text-input-disabled.story.js +1 -1
  79. package/lib/cjs/text-input/stories/text-input-disabled.story.js.map +1 -1
  80. package/lib/cjs/text-input/stories/text-input-email.story.js +1 -0
  81. package/lib/cjs/text-input/stories/text-input-email.story.js.map +1 -1
  82. package/lib/cjs/text-input/stories/text-input-error.story.js +1 -1
  83. package/lib/cjs/text-input/stories/text-input-error.story.js.map +1 -1
  84. package/lib/cjs/text-input/stories/text-input-full.story.js +1 -1
  85. package/lib/cjs/text-input/stories/text-input-full.story.js.map +1 -1
  86. package/lib/cjs/text-input/stories/text-input-information-icon.story.js +1 -1
  87. package/lib/cjs/text-input/stories/text-input-information-icon.story.js.map +1 -1
  88. package/lib/cjs/text-input/stories/text-input-loading-spinner.story.js +1 -1
  89. package/lib/cjs/text-input/stories/text-input-loading-spinner.story.js.map +1 -1
  90. package/lib/cjs/text-input/stories/text-input-loading.story.js +1 -1
  91. package/lib/cjs/text-input/stories/text-input-loading.story.js.map +1 -1
  92. package/lib/cjs/text-input/stories/text-input-number.story.js +1 -0
  93. package/lib/cjs/text-input/stories/text-input-number.story.js.map +1 -1
  94. package/lib/cjs/text-input/stories/text-input-optional.story.js +1 -1
  95. package/lib/cjs/text-input/stories/text-input-optional.story.js.map +1 -1
  96. package/lib/cjs/text-input/stories/text-input-password.story.js +1 -0
  97. package/lib/cjs/text-input/stories/text-input-password.story.js.map +1 -1
  98. package/lib/cjs/text-input/stories/text-input-readonly.story.js +1 -1
  99. package/lib/cjs/text-input/stories/text-input-readonly.story.js.map +1 -1
  100. package/lib/cjs/text-input/stories/text-input-required.story.js +1 -1
  101. package/lib/cjs/text-input/stories/text-input-required.story.js.map +1 -1
  102. package/lib/cjs/text-input/stories/text-input-sizes.story.js +1 -1
  103. package/lib/cjs/text-input/stories/text-input-sizes.story.js.map +1 -1
  104. package/lib/cjs/text-input/stories/text-input-with-icons.story.js +1 -1
  105. package/lib/cjs/text-input/stories/text-input-with-icons.story.js.map +1 -1
  106. package/lib/cjs/time-picker/TimePicker.js +5 -4
  107. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  108. package/lib/cjs/time-picker/stories/index.js +5 -1
  109. package/lib/cjs/time-picker/stories/index.js.map +1 -1
  110. package/lib/cjs/time-picker/stories/time-picker-default.story.js +1 -1
  111. package/lib/cjs/time-picker/stories/time-picker-default.story.js.map +1 -1
  112. package/lib/cjs/time-picker/stories/time-picker-error.story.js +32 -0
  113. package/lib/cjs/time-picker/stories/time-picker-error.story.js.map +1 -0
  114. package/lib/cjs/time-picker/stories/time-picker-in-dialog.story.js +1 -1
  115. package/lib/cjs/time-picker/stories/time-picker-in-dialog.story.js.map +1 -1
  116. package/lib/cjs/timezone-picker/TimeZonePicker.js +5 -4
  117. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  118. package/lib/cjs/timezone-picker/stories/index.js +5 -1
  119. package/lib/cjs/timezone-picker/stories/index.js.map +1 -1
  120. package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
  121. package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
  122. package/lib/cjs/timezone-picker/stories/timezone-picker-default.story.js +1 -1
  123. package/lib/cjs/timezone-picker/stories/timezone-picker-default.story.js.map +1 -1
  124. package/lib/cjs/timezone-picker/stories/timezone-picker-disabled.story.js +1 -1
  125. package/lib/cjs/timezone-picker/stories/timezone-picker-disabled.story.js.map +1 -1
  126. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js +1 -1
  127. package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  128. package/lib/cjs/timezone-picker/stories/timezone-picker-error.story.js +35 -0
  129. package/lib/cjs/timezone-picker/stories/timezone-picker-error.story.js.map +1 -0
  130. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  131. package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  132. package/lib/cjs/timezone-picker/stories/timezone-picker-in-dialog.story.js +1 -1
  133. package/lib/cjs/timezone-picker/stories/timezone-picker-in-dialog.story.js.map +1 -1
  134. package/lib/cjs/timezone-picker/stories/timezone-picker-sizes.story.js +1 -1
  135. package/lib/cjs/timezone-picker/stories/timezone-picker-sizes.story.js.map +1 -1
  136. package/lib/cjs/timezone-picker/stories/timezone-picker-utc-only.story.js +1 -1
  137. package/lib/cjs/timezone-picker/stories/timezone-picker-utc-only.story.js.map +1 -1
  138. package/lib/esm/_common/ButtonSpinner.js +46 -0
  139. package/lib/esm/_common/ButtonSpinner.js.map +1 -0
  140. package/lib/esm/button/ButtonBase.js +5 -3
  141. package/lib/esm/button/ButtonBase.js.map +1 -1
  142. package/lib/esm/button/stories/button-loading.story.js +1 -1
  143. package/lib/esm/button/stories/button-loading.story.js.map +1 -1
  144. package/lib/esm/clean-icon-button/stories/clean-icon-button-loading.story.js +1 -1
  145. package/lib/esm/clean-icon-button/stories/clean-icon-button-loading.story.js.map +1 -1
  146. package/lib/esm/color-picker/ColorPicker.js +1 -1
  147. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  148. package/lib/esm/dialog/stories/dialog-danger.story.js +1 -1
  149. package/lib/esm/dialog/stories/dialog-danger.story.js.map +1 -1
  150. package/lib/esm/dialog/stories/dialog-default.story.js +1 -1
  151. package/lib/esm/dialog/stories/dialog-default.story.js.map +1 -1
  152. package/lib/esm/dialog/stories/dialog-image.story.js +1 -1
  153. package/lib/esm/dialog/stories/dialog-image.story.js.map +1 -1
  154. package/lib/esm/dialog/stories/dialog-info.story.js +1 -1
  155. package/lib/esm/dialog/stories/dialog-info.story.js.map +1 -1
  156. package/lib/esm/dialog/stories/dialog-top-aligned.story.js +1 -1
  157. package/lib/esm/dialog/stories/dialog-top-aligned.story.js.map +1 -1
  158. package/lib/esm/dialog/stories/dialog-variants.story.js +1 -1
  159. package/lib/esm/dialog/stories/dialog-variants.story.js.map +1 -1
  160. package/lib/esm/dialog/stories/dialog-warning.story.js +1 -1
  161. package/lib/esm/dialog/stories/dialog-warning.story.js.map +1 -1
  162. package/lib/esm/dropdown-button/DropdownButton.js +18 -4
  163. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  164. package/lib/esm/dropdown-button/stories/dropdown-button-loading.story.js +28 -0
  165. package/lib/esm/dropdown-button/stories/dropdown-button-loading.story.js.map +1 -0
  166. package/lib/esm/dropdown-button/stories/index.js +3 -0
  167. package/lib/esm/dropdown-button/stories/index.js.map +1 -1
  168. package/lib/esm/icon-button/stories/icon-button-loading.story.js +1 -1
  169. package/lib/esm/icon-button/stories/icon-button-loading.story.js.map +1 -1
  170. package/lib/esm/icon-button-base/IconButtonBase.js +7 -3
  171. package/lib/esm/icon-button-base/IconButtonBase.js.map +1 -1
  172. package/lib/esm/menu/stories/menu-custom-items.story.js +1 -1
  173. package/lib/esm/menu/stories/menu-custom-items.story.js.map +1 -1
  174. package/lib/esm/menu/stories/menu-default.story.js +2 -2
  175. package/lib/esm/menu/stories/menu-default.story.js.map +1 -1
  176. package/lib/esm/menu/stories/menu-in-dialog.story.js +2 -2
  177. package/lib/esm/menu/stories/menu-in-dialog.story.js.map +1 -1
  178. package/lib/esm/menu/stories/menu-in-popover.story.js +1 -1
  179. package/lib/esm/menu/stories/menu-in-popover.story.js.map +1 -1
  180. package/lib/esm/menu/stories/menu-nested.story.js +1 -1
  181. package/lib/esm/menu/stories/menu-nested.story.js.map +1 -1
  182. package/lib/esm/menu/stories/menu-placements.story.js +2 -2
  183. package/lib/esm/menu/stories/menu-placements.story.js.map +1 -1
  184. package/lib/esm/menu/stories/menu-radio-and-normal.story.js +2 -2
  185. package/lib/esm/menu/stories/menu-radio-and-normal.story.js.map +1 -1
  186. package/lib/esm/menu/stories/menu-radio-items.story.js +2 -2
  187. package/lib/esm/menu/stories/menu-radio-items.story.js.map +1 -1
  188. package/lib/esm/menu/stories/menu-with-category.story.js +1 -1
  189. package/lib/esm/menu/stories/menu-with-category.story.js.map +1 -1
  190. package/lib/esm/menu/stories/menu-with-disabled-item.story.js +1 -1
  191. package/lib/esm/menu/stories/menu-with-disabled-item.story.js.map +1 -1
  192. package/lib/esm/menu/stories/menu-with-divider.story.js +1 -1
  193. package/lib/esm/menu/stories/menu-with-divider.story.js.map +1 -1
  194. package/lib/esm/menu/stories/menu-with-icon.story.js +1 -1
  195. package/lib/esm/menu/stories/menu-with-icon.story.js.map +1 -1
  196. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js +1 -1
  197. package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
  198. package/lib/esm/select/Overrides.js +17 -2
  199. package/lib/esm/select/Overrides.js.map +1 -1
  200. package/lib/esm/select/Select.js +10 -5
  201. package/lib/esm/select/Select.js.map +1 -1
  202. package/lib/esm/select/types.js.map +1 -1
  203. package/lib/esm/select-icon-button/SelectIconButton.js +16 -5
  204. package/lib/esm/select-icon-button/SelectIconButton.js.map +1 -1
  205. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  206. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  207. package/lib/esm/text-area/TextArea.js +1 -1
  208. package/lib/esm/text-area/TextArea.js.map +1 -1
  209. package/lib/esm/text-input/TextInput.js +1 -1
  210. package/lib/esm/text-input/TextInput.js.map +1 -1
  211. package/lib/esm/text-input/stories/text-input-clearable.story.js +1 -1
  212. package/lib/esm/text-input/stories/text-input-clearable.story.js.map +1 -1
  213. package/lib/esm/text-input/stories/text-input-default.story.js +1 -1
  214. package/lib/esm/text-input/stories/text-input-default.story.js.map +1 -1
  215. package/lib/esm/text-input/stories/text-input-disabled.story.js +1 -1
  216. package/lib/esm/text-input/stories/text-input-disabled.story.js.map +1 -1
  217. package/lib/esm/text-input/stories/text-input-email.story.js +1 -0
  218. package/lib/esm/text-input/stories/text-input-email.story.js.map +1 -1
  219. package/lib/esm/text-input/stories/text-input-error.story.js +1 -1
  220. package/lib/esm/text-input/stories/text-input-error.story.js.map +1 -1
  221. package/lib/esm/text-input/stories/text-input-full.story.js +1 -1
  222. package/lib/esm/text-input/stories/text-input-full.story.js.map +1 -1
  223. package/lib/esm/text-input/stories/text-input-information-icon.story.js +1 -1
  224. package/lib/esm/text-input/stories/text-input-information-icon.story.js.map +1 -1
  225. package/lib/esm/text-input/stories/text-input-loading-spinner.story.js +1 -1
  226. package/lib/esm/text-input/stories/text-input-loading-spinner.story.js.map +1 -1
  227. package/lib/esm/text-input/stories/text-input-loading.story.js +1 -1
  228. package/lib/esm/text-input/stories/text-input-loading.story.js.map +1 -1
  229. package/lib/esm/text-input/stories/text-input-number.story.js +1 -0
  230. package/lib/esm/text-input/stories/text-input-number.story.js.map +1 -1
  231. package/lib/esm/text-input/stories/text-input-optional.story.js +1 -1
  232. package/lib/esm/text-input/stories/text-input-optional.story.js.map +1 -1
  233. package/lib/esm/text-input/stories/text-input-password.story.js +1 -0
  234. package/lib/esm/text-input/stories/text-input-password.story.js.map +1 -1
  235. package/lib/esm/text-input/stories/text-input-readonly.story.js +1 -1
  236. package/lib/esm/text-input/stories/text-input-readonly.story.js.map +1 -1
  237. package/lib/esm/text-input/stories/text-input-required.story.js +1 -1
  238. package/lib/esm/text-input/stories/text-input-required.story.js.map +1 -1
  239. package/lib/esm/text-input/stories/text-input-sizes.story.js +1 -1
  240. package/lib/esm/text-input/stories/text-input-sizes.story.js.map +1 -1
  241. package/lib/esm/text-input/stories/text-input-with-icons.story.js +1 -1
  242. package/lib/esm/text-input/stories/text-input-with-icons.story.js.map +1 -1
  243. package/lib/esm/time-picker/TimePicker.js +6 -5
  244. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  245. package/lib/esm/time-picker/stories/index.js +3 -0
  246. package/lib/esm/time-picker/stories/index.js.map +1 -1
  247. package/lib/esm/time-picker/stories/time-picker-default.story.js +1 -1
  248. package/lib/esm/time-picker/stories/time-picker-default.story.js.map +1 -1
  249. package/lib/esm/time-picker/stories/time-picker-error.story.js +30 -0
  250. package/lib/esm/time-picker/stories/time-picker-error.story.js.map +1 -0
  251. package/lib/esm/time-picker/stories/time-picker-in-dialog.story.js +1 -1
  252. package/lib/esm/time-picker/stories/time-picker-in-dialog.story.js.map +1 -1
  253. package/lib/esm/timezone-picker/TimeZonePicker.js +6 -5
  254. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  255. package/lib/esm/timezone-picker/stories/index.js +3 -0
  256. package/lib/esm/timezone-picker/stories/index.js.map +1 -1
  257. package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
  258. package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
  259. package/lib/esm/timezone-picker/stories/timezone-picker-default.story.js +1 -1
  260. package/lib/esm/timezone-picker/stories/timezone-picker-default.story.js.map +1 -1
  261. package/lib/esm/timezone-picker/stories/timezone-picker-disabled.story.js +1 -1
  262. package/lib/esm/timezone-picker/stories/timezone-picker-disabled.story.js.map +1 -1
  263. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js +1 -1
  264. package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
  265. package/lib/esm/timezone-picker/stories/timezone-picker-error.story.js +33 -0
  266. package/lib/esm/timezone-picker/stories/timezone-picker-error.story.js.map +1 -0
  267. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
  268. package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
  269. package/lib/esm/timezone-picker/stories/timezone-picker-in-dialog.story.js +1 -1
  270. package/lib/esm/timezone-picker/stories/timezone-picker-in-dialog.story.js.map +1 -1
  271. package/lib/esm/timezone-picker/stories/timezone-picker-sizes.story.js +1 -1
  272. package/lib/esm/timezone-picker/stories/timezone-picker-sizes.story.js.map +1 -1
  273. package/lib/esm/timezone-picker/stories/timezone-picker-utc-only.story.js +1 -1
  274. package/lib/esm/timezone-picker/stories/timezone-picker-utc-only.story.js.map +1 -1
  275. package/lib/types/_common/ButtonSpinner.d.ts +29 -0
  276. package/lib/types/_common/ButtonSpinner.d.ts.map +1 -0
  277. package/lib/types/button/ButtonBase.d.ts +3 -1
  278. package/lib/types/button/ButtonBase.d.ts.map +1 -1
  279. package/lib/types/button/stories/button-loading.story.d.ts.map +1 -1
  280. package/lib/types/dialog/stories/dialog-danger.story.d.ts.map +1 -1
  281. package/lib/types/dialog/stories/dialog-default.story.d.ts.map +1 -1
  282. package/lib/types/dialog/stories/dialog-image.story.d.ts.map +1 -1
  283. package/lib/types/dialog/stories/dialog-info.story.d.ts.map +1 -1
  284. package/lib/types/dialog/stories/dialog-top-aligned.story.d.ts.map +1 -1
  285. package/lib/types/dialog/stories/dialog-variants.story.d.ts.map +1 -1
  286. package/lib/types/dialog/stories/dialog-warning.story.d.ts.map +1 -1
  287. package/lib/types/dropdown-button/DropdownButton.d.ts +5 -1
  288. package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
  289. package/lib/types/dropdown-button/stories/dropdown-button-loading.story.d.ts +24 -0
  290. package/lib/types/dropdown-button/stories/dropdown-button-loading.story.d.ts.map +1 -0
  291. package/lib/types/dropdown-button/stories/index.d.ts +2 -0
  292. package/lib/types/dropdown-button/stories/index.d.ts.map +1 -1
  293. package/lib/types/icon-button-base/IconButtonBase.d.ts +3 -1
  294. package/lib/types/icon-button-base/IconButtonBase.d.ts.map +1 -1
  295. package/lib/types/menu/stories/menu-custom-items.story.d.ts.map +1 -1
  296. package/lib/types/menu/stories/menu-default.story.d.ts.map +1 -1
  297. package/lib/types/menu/stories/menu-in-dialog.story.d.ts.map +1 -1
  298. package/lib/types/menu/stories/menu-in-popover.story.d.ts.map +1 -1
  299. package/lib/types/menu/stories/menu-nested.story.d.ts.map +1 -1
  300. package/lib/types/menu/stories/menu-placements.story.d.ts.map +1 -1
  301. package/lib/types/menu/stories/menu-radio-and-normal.story.d.ts.map +1 -1
  302. package/lib/types/menu/stories/menu-radio-items.story.d.ts.map +1 -1
  303. package/lib/types/menu/stories/menu-with-category.story.d.ts.map +1 -1
  304. package/lib/types/menu/stories/menu-with-disabled-item.story.d.ts.map +1 -1
  305. package/lib/types/menu/stories/menu-with-divider.story.d.ts.map +1 -1
  306. package/lib/types/menu/stories/menu-with-icon.story.d.ts.map +1 -1
  307. package/lib/types/menu/stories/menu-with-keyboard-shortcuts.story.d.ts.map +1 -1
  308. package/lib/types/select/Overrides.d.ts +1 -1
  309. package/lib/types/select/Overrides.d.ts.map +1 -1
  310. package/lib/types/select/Select.d.ts.map +1 -1
  311. package/lib/types/select/types.d.ts +4 -1
  312. package/lib/types/select/types.d.ts.map +1 -1
  313. package/lib/types/select-icon-button/SelectIconButton.d.ts +3 -1
  314. package/lib/types/select-icon-button/SelectIconButton.d.ts.map +1 -1
  315. package/lib/types/select-icon-button/stories/select-icon-button-states.story.d.ts.map +1 -1
  316. package/lib/types/text-area/TextArea.d.ts.map +1 -1
  317. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  318. package/lib/types/text-input/stories/text-input-clearable.story.d.ts.map +1 -1
  319. package/lib/types/text-input/stories/text-input-default.story.d.ts.map +1 -1
  320. package/lib/types/text-input/stories/text-input-disabled.story.d.ts.map +1 -1
  321. package/lib/types/text-input/stories/text-input-email.story.d.ts.map +1 -1
  322. package/lib/types/text-input/stories/text-input-error.story.d.ts.map +1 -1
  323. package/lib/types/text-input/stories/text-input-full.story.d.ts.map +1 -1
  324. package/lib/types/text-input/stories/text-input-information-icon.story.d.ts.map +1 -1
  325. package/lib/types/text-input/stories/text-input-loading-spinner.story.d.ts.map +1 -1
  326. package/lib/types/text-input/stories/text-input-loading.story.d.ts.map +1 -1
  327. package/lib/types/text-input/stories/text-input-number.story.d.ts.map +1 -1
  328. package/lib/types/text-input/stories/text-input-optional.story.d.ts.map +1 -1
  329. package/lib/types/text-input/stories/text-input-password.story.d.ts.map +1 -1
  330. package/lib/types/text-input/stories/text-input-readonly.story.d.ts.map +1 -1
  331. package/lib/types/text-input/stories/text-input-required.story.d.ts.map +1 -1
  332. package/lib/types/text-input/stories/text-input-sizes.story.d.ts.map +1 -1
  333. package/lib/types/text-input/stories/text-input-with-icons.story.d.ts.map +1 -1
  334. package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
  335. package/lib/types/time-picker/stories/index.d.ts +2 -0
  336. package/lib/types/time-picker/stories/index.d.ts.map +1 -1
  337. package/lib/types/time-picker/stories/time-picker-default.story.d.ts.map +1 -1
  338. package/lib/types/time-picker/stories/time-picker-error.story.d.ts +24 -0
  339. package/lib/types/time-picker/stories/time-picker-error.story.d.ts.map +1 -0
  340. package/lib/types/time-picker/stories/time-picker-in-dialog.story.d.ts.map +1 -1
  341. package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
  342. package/lib/types/timezone-picker/stories/index.d.ts +2 -0
  343. package/lib/types/timezone-picker/stories/index.d.ts.map +1 -1
  344. package/lib/types/timezone-picker/stories/timezone-picker-both-mode.story.d.ts.map +1 -1
  345. package/lib/types/timezone-picker/stories/timezone-picker-default.story.d.ts.map +1 -1
  346. package/lib/types/timezone-picker/stories/timezone-picker-disabled.story.d.ts.map +1 -1
  347. package/lib/types/timezone-picker/stories/timezone-picker-dst-aware.story.d.ts.map +1 -1
  348. package/lib/types/timezone-picker/stories/timezone-picker-error.story.d.ts +24 -0
  349. package/lib/types/timezone-picker/stories/timezone-picker-error.story.d.ts.map +1 -0
  350. package/lib/types/timezone-picker/stories/timezone-picker-fluid.story.d.ts.map +1 -1
  351. package/lib/types/timezone-picker/stories/timezone-picker-in-dialog.story.d.ts.map +1 -1
  352. package/lib/types/timezone-picker/stories/timezone-picker-sizes.story.d.ts.map +1 -1
  353. package/lib/types/timezone-picker/stories/timezone-picker-utc-only.story.d.ts.map +1 -1
  354. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/select/types.tsx"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type ReactNode } from 'react';\nimport { type GroupBase, type Props } from 'react-select';\nimport { type AsyncProps } from 'react-select/async';\nimport { type CreatableProps } from 'react-select/creatable';\n\nexport type SelectCommonProps = {\n /** Error message, if it exists the select will be in error state */\n errorText?: string | ReactNode;\n /** Help text of the select component */\n helpText?: string | ReactNode;\n /** Size of the component */\n size?: 'small' | 'medium' | 'large';\n /** Whether the select component is fluid */\n isFluid?: boolean;\n /** Whether the select component is clean. If true, the select component will have a transparent background, no border and be hug the width of the content. */\n isClean?: boolean;\n /** Whether the select component is disabled */\n isDisabled?: boolean;\n /** Additional class name */\n className?: string;\n /** Additional style */\n style?: React.CSSProperties;\n} & (\n | {\n /** Label of the select component. If not provided, please provide an ariaLabel. */\n label?: undefined;\n /** Aria label of the select component */\n ariaLabel: string;\n }\n | {\n label: React.ReactNode;\n ariaLabel?: string;\n }\n);\n\ntype ReactSelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'select';\n /** Props of the select component, based of React Select props */\n selectProps: Props<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectAsyncProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'async';\n /** Props of the select component, based of React Select props */\n selectProps: AsyncProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectCreatableProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'creatable';\n /** Props of the select component, based of React Select props */\n selectProps: CreatableProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\n/**\n * We will provide a wrapper to the three distinct select components\n * the library provides:\n * 1. Select (the most simple component)\n * 2. Creatable (for creating new values in our options)\n * 3. Async for fetching while typing, useful for cases that we avoid storing things\n * in browser\n */\nexport type SelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> =\n | ReactSelectProps<OptionType, IsMulti, GroupType>\n | ReactSelectCreatableProps<OptionType, IsMulti, GroupType>\n | ReactSelectAsyncProps<OptionType, IsMulti, GroupType>;\n\nexport type SelectOverrideCustomProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = Pick<\n SelectProps<OptionType, IsMulti, GroupType>,\n 'size' | 'errorText' | 'isClean'\n>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/select/types.tsx"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type ReactNode } from 'react';\nimport { type GroupBase, type Props } from 'react-select';\nimport { type AsyncProps } from 'react-select/async';\nimport { type CreatableProps } from 'react-select/creatable';\n\nexport type SelectCommonProps = {\n /** Error message, if it exists the select will be in error state */\n errorText?: string | ReactNode;\n /** Help text of the select component */\n helpText?: string | ReactNode;\n /** Size of the component */\n size?: 'small' | 'medium' | 'large';\n /** Whether the select component is fluid */\n isFluid?: boolean;\n /** Whether the select component is clean. If true, the select component will have a transparent background, no border and be hug the width of the content. */\n isClean?: boolean;\n /** Whether the select component is disabled */\n isDisabled?: boolean;\n /** Additional class name */\n className?: string;\n /** Additional style */\n style?: React.CSSProperties;\n} & (\n | {\n /** Label of the select component. If not provided, please provide an ariaLabel. */\n label?: undefined;\n /** Aria label of the select component */\n ariaLabel: string;\n }\n | {\n label: React.ReactNode;\n ariaLabel?: string;\n }\n);\n\ntype ReactSelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'select';\n /** Props of the select component, based of React Select props */\n selectProps: Props<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectAsyncProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'async';\n /** Props of the select component, based of React Select props */\n selectProps: AsyncProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectCreatableProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'creatable';\n /** Props of the select component, based of React Select props */\n selectProps: CreatableProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\n/**\n * We will provide a wrapper to the three distinct select components\n * the library provides:\n * 1. Select (the most simple component)\n * 2. Creatable (for creating new values in our options)\n * 3. Async for fetching while typing, useful for cases that we avoid storing things\n * in browser\n */\nexport type SelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> =\n | ReactSelectProps<OptionType, IsMulti, GroupType>\n | ReactSelectCreatableProps<OptionType, IsMulti, GroupType>\n | ReactSelectAsyncProps<OptionType, IsMulti, GroupType>;\n\nexport type SelectOverrideCustomProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = Pick<\n SelectProps<OptionType, IsMulti, GroupType>,\n 'size' | 'errorText' | 'helpText' | 'isClean'\n> & {\n errorTextId?: string;\n helpTextId?: string;\n};\n"]}
@@ -37,11 +37,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
37
37
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
38
38
  */
39
39
  const classnames_1 = __importDefault(require("classnames"));
40
+ const ButtonSpinner_1 = require("../_common/ButtonSpinner");
40
41
  const icons_1 = require("../icons");
41
- const loading_spinner_1 = require("../loading-spinner");
42
42
  const tooltip_1 = require("../tooltip");
43
43
  const SelectIconButton = (_a) => {
44
- var { children, size = 'medium', isDisabled = false, isLoading = false, isOpen = false, className, description, tooltipProps, onClick, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "size", "isDisabled", "isLoading", "isOpen", "className", "description", "tooltipProps", "onClick", "style", "htmlAttributes", "ref"]);
44
+ var { children, size = 'medium', isDisabled = false, isLoading = false, isOpen = false, className, description, tooltipProps, onClick, style, htmlAttributes, ref, loadingMessage = 'Loading' } = _a, restProps = __rest(_a, ["children", "size", "isDisabled", "isLoading", "isOpen", "className", "description", "tooltipProps", "onClick", "style", "htmlAttributes", "ref", "loadingMessage"]);
45
45
  const classes = (0, classnames_1.default)('ndl-select-icon-btn', className, {
46
46
  'ndl-active': isOpen,
47
47
  'ndl-disabled': isDisabled,
@@ -51,14 +51,25 @@ const SelectIconButton = (_a) => {
51
51
  'ndl-small': size === 'small',
52
52
  });
53
53
  const isInteractable = !isDisabled && !isLoading;
54
+ const handleClick = (e) => {
55
+ // If the button is disabled or loading, we don't want to call the onClick handler. The loading is only aria-disabled, so we need this.
56
+ if (!isInteractable) {
57
+ e.preventDefault();
58
+ e.stopPropagation();
59
+ return;
60
+ }
61
+ if (onClick) {
62
+ onClick(e);
63
+ }
64
+ };
54
65
  return ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, Object.assign({ hoverDelay: {
55
66
  close: 0,
56
67
  open: 500,
57
- } }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { type: "simple",
68
+ }, type: "simple",
58
69
  // We disable the tooltip if the button is disabled or open, so it doesn't interfere with a menu open
59
- isDisabled: description === null || isDisabled || isOpen === true, children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsxs)("button", Object.assign({ type: "button", ref: ref, className: classes, style: style, disabled: !isInteractable, "aria-disabled": !isInteractable, "aria-label": description !== null && description !== void 0 ? description : undefined, "aria-expanded": isOpen, onClick: onClick }, restProps, htmlAttributes, { children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-select-icon-btn-inner", children: isLoading ? ((0, jsx_runtime_1.jsx)(loading_spinner_1.LoadingSpinner, { size: "small" })) : ((0, jsx_runtime_1.jsx)("div", { className: "ndl-icon", children: children })) }), (0, jsx_runtime_1.jsx)(icons_1.ChevronDownIconOutline, { className: (0, classnames_1.default)('ndl-select-icon-btn-icon', {
70
+ isDisabled: description === null || isDisabled || isOpen === true, shouldCloseOnReferenceClick: true }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsxs)("button", Object.assign({ type: "button", ref: ref, className: classes, style: style, disabled: isDisabled, "aria-disabled": !isInteractable, "aria-label": description !== null && description !== void 0 ? description : undefined, "aria-expanded": isOpen, onClick: handleClick }, restProps, htmlAttributes, { children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-select-icon-btn-inner", children: (0, jsx_runtime_1.jsx)("div", { className: "ndl-icon", children: children }) }), (0, jsx_runtime_1.jsx)(icons_1.ChevronDownIconOutline, { className: (0, classnames_1.default)('ndl-select-icon-btn-icon', {
60
71
  'ndl-select-icon-btn-icon-open': isOpen === true,
61
- }) })] })) })), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: description }))] })));
72
+ }) }), isLoading && ((0, jsx_runtime_1.jsx)(ButtonSpinner_1.ButtonSpinner, { loadingMessage: loadingMessage, size: size }))] })) })), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: description }))] })));
62
73
  };
63
74
  exports.SelectIconButton = SelectIconButton;
64
75
  //# sourceMappingURL=SelectIconButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectIconButton.js","sourceRoot":"","sources":["../../../src/select-icon-button/SelectIconButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAIpC,oCAAkD;AAClD,wDAAoD;AACpD,wCAAqC;AA0B9B,MAAM,gBAAgB,GAAG,CAAC,EAcc,EAAE,EAAE;QAdlB,EAC/B,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,OAE0C,EAD1C,SAAS,cAbmB,kJAchC,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,EAAE;QAC3D,YAAY,EAAE,MAAM;QACpB,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,aAAa,EAAE,SAAS;QACxB,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC;IAEjD,OAAO,CACL,wBAAC,iBAAO,kBACN,UAAU,EAAE;YACV,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,GAAG;SACV,IACG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,IACtB,IAAI,EAAC,QAAQ;QACb,qGAAqG;QACrG,UAAU,EAAE,WAAW,KAAK,IAAI,IAAI,UAAU,IAAI,MAAM,KAAK,IAAI,aAEjE,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,IAAE,gBAAgB,kBAC1D,kDACE,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,cAAc,mBACV,CAAC,cAAc,gBAClB,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,SAAS,mBACrB,MAAM,EACrB,OAAO,EAAE,OAAO,IACZ,SAAS,EACT,cAAc,eAElB,gCAAK,SAAS,EAAC,2BAA2B,YACvC,SAAS,CAAC,CAAC,CAAC,CACX,uBAAC,gCAAc,IAAC,IAAI,EAAC,OAAO,GAAG,CAChC,CAAC,CAAC,CAAC,CACF,gCAAK,SAAS,EAAC,UAAU,YAAE,QAAQ,GAAO,CAC3C,GACG,EAEN,uBAAC,8BAAsB,IACrB,SAAS,EAAE,IAAA,oBAAU,EAAC,0BAA0B,EAAE;gCAChD,+BAA+B,EAAE,MAAM,KAAK,IAAI;6BACjD,CAAC,GACF,KACK,IACO,EAClB,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACvC,WAAW,IACI,KACV,CACX,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,gBAAgB,oBAuE3B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { ChevronDownIconOutline } from '../icons';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Tooltip } from '../tooltip';\n\ntype SelectIconButtonProps = {\n /** Content displayed in the button */\n children?: React.ReactNode;\n /** Size of button */\n size?: 'small' | 'medium' | 'large';\n /** If the button is doing something Async, it will display a loading spinner */\n isLoading?: boolean;\n /** Whether the button is in disabled state */\n isDisabled?: boolean;\n /** If the button is opened */\n isOpen: boolean;\n /** Callback function to be called when the button is clicked */\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /**\n * A string that will be shown as a tooltip when hovering over the button. It also acts as an aria-label.\n * {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label}\n */\n description: string | null;\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: TooltipObjectProps;\n};\n\nexport const SelectIconButton = ({\n children,\n size = 'medium',\n isDisabled = false,\n isLoading = false,\n isOpen = false,\n className,\n description,\n tooltipProps,\n onClick,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'button', SelectIconButtonProps>) => {\n const classes = classNames('ndl-select-icon-btn', className, {\n 'ndl-active': isOpen,\n 'ndl-disabled': isDisabled,\n 'ndl-large': size === 'large',\n 'ndl-loading': isLoading,\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const isInteractable = !isDisabled && !isLoading;\n\n return (\n <Tooltip\n hoverDelay={{\n close: 0,\n open: 500,\n }}\n {...tooltipProps?.root}\n type=\"simple\"\n // We disable the tooltip if the button is disabled or open, so it doesn't interfere with a menu open\n isDisabled={description === null || isDisabled || isOpen === true}\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <button\n type=\"button\"\n ref={ref}\n className={classes}\n style={style}\n disabled={!isInteractable}\n aria-disabled={!isInteractable}\n aria-label={description ?? undefined}\n aria-expanded={isOpen}\n onClick={onClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-select-icon-btn-inner\">\n {isLoading ? (\n <LoadingSpinner size=\"small\" />\n ) : (\n <div className=\"ndl-icon\">{children}</div>\n )}\n </div>\n\n <ChevronDownIconOutline\n className={classNames('ndl-select-icon-btn-icon', {\n 'ndl-select-icon-btn-icon-open': isOpen === true,\n })}\n />\n </button>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {description}\n </Tooltip.Content>\n </Tooltip>\n );\n};\n"]}
1
+ {"version":3,"file":"SelectIconButton.js","sourceRoot":"","sources":["../../../src/select-icon-button/SelectIconButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAGpC,4DAAyD;AAEzD,oCAAkD;AAClD,wCAAqC;AA6B9B,MAAM,gBAAgB,GAAG,CAAC,EAec,EAAE,EAAE;QAflB,EAC/B,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,EACH,cAAc,GAAG,SAAS,OAEmB,EAD1C,SAAS,cAdmB,oKAehC,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,EAAE;QAC3D,YAAY,EAAE,MAAM;QACpB,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,aAAa,EAAE,SAAS;QACxB,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,K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EACD,SAAS,IAAI,CACZ,uBAAC,6BAAa,IAAC,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,GAAI,CAC9D,KACM,IACO,EAClB,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACvC,WAAW,IACI,KACV,CACX,CAAC;AACJ,CAAC,CAAC;AApFW,QAAA,gBAAgB,oBAoF3B","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 { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { ChevronDownIconOutline } from '../icons';\nimport { Tooltip } from '../tooltip';\n\ntype SelectIconButtonProps = {\n /** Content displayed in the button */\n children?: React.ReactNode;\n /** Size of button */\n size?: 'small' | 'medium' | 'large';\n /** If the button is doing something Async, it will display a loading spinner */\n isLoading?: boolean;\n /** Whether the button is in disabled state */\n isDisabled?: boolean;\n /** If the button is opened */\n isOpen: boolean;\n /** Callback function to be called when the button is clicked */\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /**\n * A string that will be shown as a tooltip when hovering over the button. It also acts as an aria-label.\n * {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label}\n */\n description: string | null;\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: TooltipObjectProps;\n\n /** Accessible message for screen readers when the button is in a loading state */\n loadingMessage?: string;\n};\n\nexport const SelectIconButton = ({\n children,\n size = 'medium',\n isDisabled = false,\n isLoading = false,\n isOpen = false,\n className,\n description,\n tooltipProps,\n onClick,\n style,\n htmlAttributes,\n ref,\n loadingMessage = 'Loading',\n ...restProps\n}: CommonProps<'button', SelectIconButtonProps>) => {\n const classes = classNames('ndl-select-icon-btn', className, {\n 'ndl-active': isOpen,\n 'ndl-disabled': isDisabled,\n 'ndl-large': size === 'large',\n 'ndl-loading': isLoading,\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const isInteractable = !isDisabled && !isLoading;\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // If the button is disabled or loading, we don't want to call the onClick handler. The loading is only aria-disabled, so we need this.\n if (!isInteractable) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n if (onClick) {\n onClick(e);\n }\n };\n\n return (\n <Tooltip\n hoverDelay={{\n close: 0,\n open: 500,\n }}\n type=\"simple\"\n // We disable the tooltip if the button is disabled or open, so it doesn't interfere with a menu open\n isDisabled={description === null || isDisabled || isOpen === true}\n shouldCloseOnReferenceClick\n {...tooltipProps?.root}\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <button\n type=\"button\"\n ref={ref}\n className={classes}\n style={style}\n disabled={isDisabled}\n aria-disabled={!isInteractable}\n aria-label={description ?? undefined}\n aria-expanded={isOpen}\n onClick={handleClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-select-icon-btn-inner\">\n <div className=\"ndl-icon\">{children}</div>\n </div>\n <ChevronDownIconOutline\n className={classNames('ndl-select-icon-btn-icon', {\n 'ndl-select-icon-btn-icon-open': isOpen === true,\n })}\n />\n {isLoading && (\n <ButtonSpinner loadingMessage={loadingMessage} size={size} />\n )}\n </button>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {description}\n </Tooltip.Content>\n </Tooltip>\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.SelectIconButton, { description: "Select", size: "small", isDisabled: true, isOpen: false, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Disabled" })] }), (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.SelectIconButton, { description: "Select", size: "small", isOpen: true, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Active" })] }), (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.SelectIconButton, { description: "Select", size: "small", isLoading: true, isOpen: false, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Loading" })] })] }));
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.SelectIconButton, { description: "Select", size: "small", isDisabled: true, isOpen: false, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Disabled" })] }), (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.SelectIconButton, { description: "Select", size: "small", isOpen: true, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Active" })] }), (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.SelectIconButton, { description: "Select", size: "small", isLoading: true, loadingMessage: "Loading", isOpen: false, children: (0, jsx_runtime_1.jsx)(icons_1.SelectIcon, {}) }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: " Loading" })] })] }));
29
29
  };
30
30
  exports.default = Component;
31
31
  //# sourceMappingURL=select-icon-button-states.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-icon-button-states.story.js","sourceRoot":"","sources":["../../../../src/select-icon-button/stories/select-icon-button-states.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgE;AAChE,kDAAoD;AAEpD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IACf,WAAW,EAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,EACZ,UAAU,QACV,MAAM,EAAE,KAAK,YAEb,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,0BAAuB,IAC9C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,IAAI,YAC9D,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,wBAAqB,IAC5C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IACf,WAAW,EAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,EACZ,SAAS,QACT,MAAM,EAAE,KAAK,YAEb,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,yBAAsB,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 { SelectIconButton, Typography } from '@neo4j-ndl/react';\nimport { SelectIcon } 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 <SelectIconButton\n description=\"Select\"\n size=\"small\"\n isDisabled\n isOpen={false}\n >\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Disabled</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <SelectIconButton description=\"Select\" size=\"small\" isOpen={true}>\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Active</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <SelectIconButton\n description=\"Select\"\n size=\"small\"\n isLoading\n isOpen={false}\n >\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Loading</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"select-icon-button-states.story.js","sourceRoot":"","sources":["../../../../src/select-icon-button/stories/select-icon-button-states.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgE;AAChE,kDAAoD;AAEpD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IACf,WAAW,EAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,EACZ,UAAU,QACV,MAAM,EAAE,KAAK,YAEb,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,0BAAuB,IAC9C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IAAC,WAAW,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,IAAI,YAC9D,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,wBAAqB,IAC5C,EACN,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,wBAAgB,IACf,WAAW,EAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,EACZ,SAAS,QACT,cAAc,EAAC,SAAS,EACxB,MAAM,EAAE,KAAK,YAEb,uBAAC,kBAAU,KAAG,GACG,EACnB,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,yBAAsB,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 { SelectIconButton, Typography } from '@neo4j-ndl/react';\nimport { SelectIcon } 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 <SelectIconButton\n description=\"Select\"\n size=\"small\"\n isDisabled\n isOpen={false}\n >\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Disabled</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <SelectIconButton description=\"Select\" size=\"small\" isOpen={true}>\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Active</Typography>\n </div>\n <div className=\"n-flex n-flex-row n-gap-token-16 n-items-center\">\n <SelectIconButton\n description=\"Select\"\n size=\"small\"\n isLoading\n loadingMessage=\"Loading\"\n isOpen={false}\n >\n <SelectIcon />\n </SelectIconButton>\n <Typography variant=\"label\"> Loading</Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -91,7 +91,7 @@ const TextArea = (_a) => {
91
91
  }
92
92
  return ariaDescribedby.join(' ');
93
93
  }, [helpText, errorText, helpTextId, errorTextId]);
94
- return ((0, jsx_runtime_1.jsxs)("div", { className: containerWrappingClasses, children: [(0, jsx_runtime_1.jsxs)("label", { className: labelWrappingClasses, children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-text-area-wrapper", children: (0, jsx_runtime_1.jsx)("textarea", Object.assign({ disabled: isDisabled, ref: ref, "aria-label": ariaLabel, readOnly: isReadOnly, value: value, placeholder: placeholder, style: style, "aria-describedby": combinedAriaDescribedby }, restProps, htmlAttributes)) }), !hasEmptyLabelValue && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-text-area-wrapper", children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-text-area-label-text", children: label }), Boolean(moreInformationText) && ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, Object.assign({ type: "simple" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { children: (0, jsx_runtime_1.jsx)("div", { className: informationIconClasses, "data-testid": "ndl-information-icon", children: (0, jsx_runtime_1.jsx)(icons_1.InformationCircleIconOutline, {}) }) })), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: moreInformationText }))] }))), isOptional && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-text-area-optional", children: "Optional" }))] }))] }), helpText && !errorText && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-text-area-msg", "aria-live": "polite", id: helpTextId, children: helpText })), errorText && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-text-area-msg", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-error-icon", children: (0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, {}) }), (0, jsx_runtime_1.jsx)("div", { className: "ndl-error-text", id: errorTextId, "aria-live": "polite", children: errorText })] }))] }));
94
+ return ((0, jsx_runtime_1.jsxs)("div", { className: containerWrappingClasses, children: [(0, jsx_runtime_1.jsxs)("label", { className: labelWrappingClasses, children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-text-area-wrapper", children: (0, jsx_runtime_1.jsx)("textarea", Object.assign({ disabled: isDisabled, ref: ref, "aria-label": ariaLabel, "aria-invalid": Boolean(errorText), readOnly: isReadOnly, value: value, placeholder: placeholder, style: style, "aria-describedby": combinedAriaDescribedby }, restProps, htmlAttributes)) }), !hasEmptyLabelValue && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-text-area-wrapper", children: [(0, jsx_runtime_1.jsx)("span", { className: "ndl-text-area-label-text", children: label }), Boolean(moreInformationText) && ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, Object.assign({ type: "simple" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { children: (0, jsx_runtime_1.jsx)("div", { className: informationIconClasses, "data-testid": "ndl-information-icon", children: (0, jsx_runtime_1.jsx)(icons_1.InformationCircleIconOutline, {}) }) })), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: moreInformationText }))] }))), isOptional && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-text-area-optional", children: "Optional" }))] }))] }), helpText && !errorText && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-text-area-msg", "aria-live": "polite", id: helpTextId, children: helpText })), errorText && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-text-area-msg", children: [(0, jsx_runtime_1.jsx)("div", { className: "ndl-error-icon", children: (0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, {}) }), (0, jsx_runtime_1.jsx)("div", { className: "ndl-error-text", id: errorTextId, "aria-live": "polite", children: errorText })] }))] }));
95
95
  };
96
96
  exports.TextArea = TextArea;
97
97
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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B,GACE,EACL,CAAC,kBAAkB,IAAI,CACtB,iCAAK,SAAS,EAAC,uBAAuB,aACpC,iCAAM,SAAS,EAAC,0BAA0B,YAAE,KAAK,GAAQ,EACxD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAC/B,wBAAC,iBAAO,kBAAC,IAAI,EAAC,QAAQ,IAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAC3C,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACxC,gCACE,SAAS,EAAE,sBAAsB,iBACrB,sBAAsB,YAElC,uBAAC,oCAA4B,KAAG,GAC5B,IACU,EAClB,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACvC,mBAAmB,IACJ,KACV,CACX,EACA,UAAU,IAAI,CACb,iCAAM,SAAS,EAAC,wBAAwB,yBAAgB,CACzD,IACG,CACP,IACK,EACP,QAAQ,IAAI,CAAC,SAAS,IAAI,CACzB,gCAAK,SAAS,EAAC,mBAAmB,eAAW,QAAQ,EAAC,EAAE,EAAE,UAAU,YACjE,QAAQ,GACL,CACP,EACA,SAAS,IAAI,CACZ,iCAAK,SAAS,EAAC,mBAAmB,aAChC,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,kCAA0B,KAAG,GAC1B,EACN,gCAAK,SAAS,EAAC,gBAAgB,EAAC,EAAE,EAAE,WAAW,eAAY,QAAQ,YAChE,SAAS,GACN,IACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AArIW,QAAA,QAAQ,YAqInB","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 { type ReactNode, useId, useMemo } from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport {\n type CommonProps,\n type HtmlAttributes,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n} from '../icons';\nimport { Tooltip } from '../tooltip';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype TextAreaProps = {\n /** The label displayed above the textarea */\n label?: ReactNode;\n\n /** Whether the textarea should take the full available width */\n isFluid?: boolean;\n\n /** Assistive text displayed below the textarea */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Size of the textarea */\n size?: 'small' | 'medium' | 'large';\n\n // TODO v5: use isRequired and showRequiredOrOptionalLabel like in TextInput\n /** Whether to display the Optional label next to the field label */\n isOptional?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether the textarea is disabled */\n isDisabled?: boolean;\n\n /** Additional HTML attributes passed to the textarea element */\n htmlAttributes?: HtmlAttributes<'textarea'>;\n\n /** Aria label for accessibility when no visible label is provided */\n ariaLabel?: string;\n\n /** Additional class names */\n className?: string;\n\n /** Additional styles applied to the root element */\n style?: React.CSSProperties;\n\n /** Whether the textarea is read-only */\n isReadOnly?: boolean;\n\n /** The current value of the textarea */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n\n /** Placeholder text displayed when the textarea is empty */\n placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder'];\n};\n\n/**\n *\n *\n * TextArea Component\n *\n *\n */\n\nexport const TextArea = ({\n label,\n isFluid = false,\n errorText,\n helpText,\n isOptional = false,\n moreInformationText,\n size = 'medium',\n ariaLabel,\n tooltipProps,\n isDisabled = false,\n className,\n isReadOnly = false,\n style,\n value,\n placeholder,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'textarea', TextAreaProps>) => {\n const helpTextId = useId();\n const errorTextId = useId();\n const containerWrappingClasses = classNames(\n `ndl-text-area ndl-type-text`,\n className,\n {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': errorText,\n 'ndl-has-trailing-icon': errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n },\n );\n\n const hasEmptyLabelValue = !label || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-area-label', {\n 'ndl-fluid': isFluid,\n 'ndl-text-area-no-label': hasEmptyLabelValue,\n });\n\n const isCustomLabel = label && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextArea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n <div className=\"ndl-text-area-wrapper\">\n <textarea\n disabled={isDisabled}\n ref={ref}\n aria-label={ariaLabel}\n readOnly={isReadOnly}\n value={value}\n placeholder={placeholder}\n style={style}\n aria-describedby={combinedAriaDescribedby}\n {...restProps}\n {...htmlAttributes}\n />\n </div>\n {!hasEmptyLabelValue && (\n <div className=\"ndl-text-area-wrapper\">\n <span className=\"ndl-text-area-label-text\">{label}</span>\n {Boolean(moreInformationText) && (\n <Tooltip type=\"simple\" {...tooltipProps?.root}>\n <Tooltip.Trigger {...tooltipProps?.trigger}>\n <div\n className={informationIconClasses}\n data-testid=\"ndl-information-icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {isOptional && (\n <span className=\"ndl-text-area-optional\">Optional</span>\n )}\n </div>\n )}\n </label>\n {helpText && !errorText && (\n <div className=\"ndl-text-area-msg\" aria-live=\"polite\" id={helpTextId}>\n {helpText}\n </div>\n )}\n {errorText && (\n <div className=\"ndl-text-area-msg\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <div className=\"ndl-error-text\" id={errorTextId} aria-live=\"polite\">\n {errorText}\n </div>\n </div>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,iCAAuD;AAEvD,kDAA8E;AAM9E,4CAAwD;AACxD,oCAGkB;AAClB,wCAAqC;AA6DrC;;;;;;GAMG;AAEI,MAAM,QAAQ,GAAG,CAAC,EAmBgB,EAAE,EAA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,wBAAC,iBAAO,kBAAC,IAAI,EAAC,QAAQ,IAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAC3C,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACxC,gCACE,SAAS,EAAE,sBAAsB,iBACrB,sBAAsB,YAElC,uBAAC,oCAA4B,KAAG,GAC5B,IACU,EAClB,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACvC,mBAAmB,IACJ,KACV,CACX,EACA,UAAU,IAAI,CACb,iCAAM,SAAS,EAAC,wBAAwB,yBAAgB,CACzD,IACG,CACP,IACK,EACP,QAAQ,IAAI,CAAC,SAAS,IAAI,CACzB,gCAAK,SAAS,EAAC,mBAAmB,eAAW,QAAQ,EAAC,EAAE,EAAE,UAAU,YACjE,QAAQ,GACL,CACP,EACA,SAAS,IAAI,CACZ,iCAAK,SAAS,EAAC,mBAAmB,aAChC,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,kCAA0B,KAAG,GAC1B,EACN,gCAAK,SAAS,EAAC,gBAAgB,EAAC,EAAE,EAAE,WAAW,eAAY,QAAQ,YAChE,SAAS,GACN,IACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAtIW,QAAA,QAAQ,YAsInB","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 { type ReactNode, useId, useMemo } from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport {\n type CommonProps,\n type HtmlAttributes,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n} from '../icons';\nimport { Tooltip } from '../tooltip';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype TextAreaProps = {\n /** The label displayed above the textarea */\n label?: ReactNode;\n\n /** Whether the textarea should take the full available width */\n isFluid?: boolean;\n\n /** Assistive text displayed below the textarea */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Size of the textarea */\n size?: 'small' | 'medium' | 'large';\n\n // TODO v5: use isRequired and showRequiredOrOptionalLabel like in TextInput\n /** Whether to display the Optional label next to the field label */\n isOptional?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether the textarea is disabled */\n isDisabled?: boolean;\n\n /** Additional HTML attributes passed to the textarea element */\n htmlAttributes?: HtmlAttributes<'textarea'>;\n\n /** Aria label for accessibility when no visible label is provided */\n ariaLabel?: string;\n\n /** Additional class names */\n className?: string;\n\n /** Additional styles applied to the root element */\n style?: React.CSSProperties;\n\n /** Whether the textarea is read-only */\n isReadOnly?: boolean;\n\n /** The current value of the textarea */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n\n /** Placeholder text displayed when the textarea is empty */\n placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder'];\n};\n\n/**\n *\n *\n * TextArea Component\n *\n *\n */\n\nexport const TextArea = ({\n label,\n isFluid = false,\n errorText,\n helpText,\n isOptional = false,\n moreInformationText,\n size = 'medium',\n ariaLabel,\n tooltipProps,\n isDisabled = false,\n className,\n isReadOnly = false,\n style,\n value,\n placeholder,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'textarea', TextAreaProps>) => {\n const helpTextId = useId();\n const errorTextId = useId();\n const containerWrappingClasses = classNames(\n `ndl-text-area ndl-type-text`,\n className,\n {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': errorText,\n 'ndl-has-trailing-icon': errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n },\n );\n\n const hasEmptyLabelValue = !label || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-area-label', {\n 'ndl-fluid': isFluid,\n 'ndl-text-area-no-label': hasEmptyLabelValue,\n });\n\n const isCustomLabel = label && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextArea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n <div className=\"ndl-text-area-wrapper\">\n <textarea\n disabled={isDisabled}\n ref={ref}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n readOnly={isReadOnly}\n value={value}\n placeholder={placeholder}\n style={style}\n aria-describedby={combinedAriaDescribedby}\n {...restProps}\n {...htmlAttributes}\n />\n </div>\n {!hasEmptyLabelValue && (\n <div className=\"ndl-text-area-wrapper\">\n <span className=\"ndl-text-area-label-text\">{label}</span>\n {Boolean(moreInformationText) && (\n <Tooltip type=\"simple\" {...tooltipProps?.root}>\n <Tooltip.Trigger {...tooltipProps?.trigger}>\n <div\n className={informationIconClasses}\n data-testid=\"ndl-information-icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {isOptional && (\n <span className=\"ndl-text-area-optional\">Optional</span>\n )}\n </div>\n )}\n </label>\n {helpText && !errorText && (\n <div className=\"ndl-text-area-msg\" aria-live=\"polite\" id={helpTextId}>\n {helpText}\n </div>\n )}\n {errorText && (\n <div className=\"ndl-text-area-msg\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <div className=\"ndl-error-text\" id={errorTextId} aria-live=\"polite\">\n {errorText}\n </div>\n </div>\n )}\n </div>\n );\n};\n"]}
@@ -122,7 +122,7 @@ const TextInput = (_a) => {
122
122
  ? 'ndl-medium-spinner'
123
123
  : 'ndl-small-spinner' })) : (leadingElement) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('ndl-input-container', {
124
124
  'ndl-clearable': isClearable,
125
- }), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref, readOnly: isReadOnly, disabled: isDisabled, required: isRequired, value: internalState, placeholder: placeholder, type: "text", onChange: internalOnChange, "aria-describedby": combinedAriaDescribedby }, combinedHtmlInputAttributes, { onKeyDown: handleInputKeyDown }, restProps)), shouldRenderHint && ((0, jsx_runtime_1.jsxs)("span", { id: hintId, className: "ndl-text-input-hint", "aria-hidden": true, children: [isLoading && 'Loading ', isClearable && 'Press Escape to clear input.'] })), isClearable && Boolean(internalState) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-element-clear ndl-element", children: (0, jsx_runtime_1.jsx)("button", { tabIndex: -1, "aria-hidden": true, type: "button", title: "Clear input (Esc)", onClick: () => {
125
+ }), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref, readOnly: isReadOnly, disabled: isDisabled, required: isRequired, value: internalState, placeholder: placeholder, type: "text", onChange: internalOnChange, "aria-describedby": combinedAriaDescribedby, "aria-invalid": Boolean(errorText) }, combinedHtmlInputAttributes, { onKeyDown: handleInputKeyDown }, restProps)), shouldRenderHint && ((0, jsx_runtime_1.jsxs)("span", { id: hintId, className: "ndl-text-input-hint", "aria-hidden": true, children: [isLoading && 'Loading ', isClearable && 'Press Escape to clear input.'] })), isClearable && Boolean(internalState) && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-element-clear ndl-element", children: (0, jsx_runtime_1.jsx)("button", { tabIndex: -1, "aria-hidden": true, type: "button", title: "Clear input (Esc)", onClick: () => {
126
126
  internalOnChange === null || internalOnChange === void 0 ? void 0 : internalOnChange({
127
127
  target: { value: '' },
128
128
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AACpC,iCAMe;AAEf,kDAA8E;AAE9E,oFAA8E;AAC9E,4CAAwD;AACxD,oCAIkB;AAClB,wDAAoD;AACpD,0CAAuC;AACvC,wCAAqC;AACrC,8CAA2C;AAoE3C;;;;;;GAMG;AAEI,MAAM,SAAS,GAAG,CAAC,EA0Ba,EAAE,EAAE;QA1BjB,EACxB,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,cAAc,EACd,eAAe,EACf,2BAA2B,GAAG,KAAK,EACnC,mBAA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CAClC,uBAAC,mBAAQ,IACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,SAAS,EAAE,iBAAiB,YAE5B,uBAAC,uBAAU,IACT,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,SAAS,EAAC,kBAAkB,EAC5B,cAAc,EAAE;wBACd,WAAW,EAAE,QAAQ;wBACrB,EAAE,EAAE,UAAU;qBACf,YAEA,QAAQ,GACE,GACJ,CACZ,EACA,OAAO,CAAC,SAAS,CAAC,IAAI;YACrB,0GAA0G;YAC1G,kGAAkG;YAClG,uBAAC,mBAAQ,kBACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,KAAK,EAAC,aAAa,IACf,aAAa,IACjB,SAAS,EAAE,iBAAiB,YAE5B,iCAAK,SAAS,EAAC,kBAAkB,aAC/B,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,kCAA0B,KAAG,GAC1B,EACN,uBAAC,uBAAU,IACT,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,cAAc,EAAE;gCACd,WAAW,EAAE,QAAQ;gCACrB,EAAE,EAAE,WAAW;6BAChB,YAEA,SAAS,GACC,IACT,IACG,CACZ,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AApSW,QAAA,SAAS,aAoSpB","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';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n XMarkIconOutline,\n} from '../icons';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\n\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [internalState, internalOnChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const helpTextId = useId();\n const errorTextId = useId();\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-form-item-label', {\n 'ndl-fluid': isFluid,\n 'ndl-form-item-no-label': hasEmptyLabelValue,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n const shouldRenderHint = isClearable || isLoading;\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isClearable && event.key === 'Escape' && Boolean(internalState)) {\n event.preventDefault();\n event.stopPropagation();\n internalOnChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [hintId];\n\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [hintId, helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-label-text-wrapper\">\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-label-text\"\n >\n {label}\n </Typography>\n {Boolean(moreInformationText) && (\n <Tooltip {...tooltipProps?.root} type=\"simple\">\n <Tooltip.Trigger\n {...tooltipProps?.trigger}\n className={informationIconClasses}\n hasButtonWrapper\n >\n <div\n tabIndex={0}\n role=\"button\"\n aria-label=\"Information icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {showRequiredOrOptionalLabel && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-form-item-optional\"\n >\n {isRequired === true ? 'Required' : 'Optional'}\n </Typography>\n )}\n </div>\n </Skeleton>\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={internalState}\n placeholder={placeholder}\n type=\"text\"\n onChange={internalOnChange}\n aria-describedby={combinedAriaDescribedby}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {isClearable && 'Press Escape to clear input.'}\n </span>\n )}\n {isClearable && Boolean(internalState) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n internalOnChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline className=\"n-size-4\" />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n {Boolean(helpText) && !errorText && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n isLoading={isSkeletonLoading}\n >\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-form-message\"\n htmlAttributes={{\n 'aria-live': 'polite',\n id: helpTextId,\n }}\n >\n {helpText}\n </Typography>\n </Skeleton>\n )}\n {Boolean(errorText) && (\n // TODO v4: We might want to have a min width for the container for the messages to help skeleton loading.\n // Currently the message fills 100% of the width while the rest of the text input has a set width.\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n width=\"fit-content\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-form-message\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <Typography\n className=\"ndl-error-text\"\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n htmlAttributes={{\n 'aria-live': 'polite',\n id: errorTextId,\n }}\n >\n {errorText}\n </Typography>\n </div>\n </Skeleton>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AACpC,iCAMe;AAEf,kDAA8E;AAE9E,oFAA8E;AAC9E,4CAAwD;AACxD,oCAIkB;AAClB,wDAAoD;AACpD,0CAAuC;AACvC,wCAAqC;AACrC,8CAA2C;AAoE3C;;;;;;GAMG;AAEI,MAAM,SAAS,GAAG,CAAC,EA0Ba,EAAE,E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ACtB,CAAC,CAAC,mBAAmB,GAEzB,CACH,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,GACG,CACP,IACG,IACG,IACL,EACP,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,CAClC,uBAAC,mBAAQ,IACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,SAAS,EAAE,iBAAiB,YAE5B,uBAAC,uBAAU,IACT,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,SAAS,EAAC,kBAAkB,EAC5B,cAAc,EAAE;wBACd,WAAW,EAAE,QAAQ;wBACrB,EAAE,EAAE,UAAU;qBACf,YAEA,QAAQ,GACE,GACJ,CACZ,EACA,OAAO,CAAC,SAAS,CAAC,IAAI;YACrB,0GAA0G;YAC1G,kGAAkG;YAClG,uBAAC,mBAAQ,kBACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,KAAK,EAAC,aAAa,IACf,aAAa,IACjB,SAAS,EAAE,iBAAiB,YAE5B,iCAAK,SAAS,EAAC,kBAAkB,aAC/B,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,kCAA0B,KAAG,GAC1B,EACN,uBAAC,uBAAU,IACT,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,cAAc,EAAE;gCACd,WAAW,EAAE,QAAQ;gCACrB,EAAE,EAAE,WAAW;6BAChB,YAEA,SAAS,GACC,IACT,IACG,CACZ,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AArSW,QAAA,SAAS,aAqSpB","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';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n XMarkIconOutline,\n} from '../icons';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\n\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [internalState, internalOnChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const helpTextId = useId();\n const errorTextId = useId();\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-form-item-label', {\n 'ndl-fluid': isFluid,\n 'ndl-form-item-no-label': hasEmptyLabelValue,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n const shouldRenderHint = isClearable || isLoading;\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isClearable && event.key === 'Escape' && Boolean(internalState)) {\n event.preventDefault();\n event.stopPropagation();\n internalOnChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [hintId];\n\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [hintId, helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-label-text-wrapper\">\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-label-text\"\n >\n {label}\n </Typography>\n {Boolean(moreInformationText) && (\n <Tooltip {...tooltipProps?.root} type=\"simple\">\n <Tooltip.Trigger\n {...tooltipProps?.trigger}\n className={informationIconClasses}\n hasButtonWrapper\n >\n <div\n tabIndex={0}\n role=\"button\"\n aria-label=\"Information icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {showRequiredOrOptionalLabel && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-form-item-optional\"\n >\n {isRequired === true ? 'Required' : 'Optional'}\n </Typography>\n )}\n </div>\n </Skeleton>\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={internalState}\n placeholder={placeholder}\n type=\"text\"\n onChange={internalOnChange}\n aria-describedby={combinedAriaDescribedby}\n aria-invalid={Boolean(errorText)}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {isClearable && 'Press Escape to clear input.'}\n </span>\n )}\n {isClearable && Boolean(internalState) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n internalOnChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline className=\"n-size-4\" />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n {Boolean(helpText) && !errorText && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n isLoading={isSkeletonLoading}\n >\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-form-message\"\n htmlAttributes={{\n 'aria-live': 'polite',\n id: helpTextId,\n }}\n >\n {helpText}\n </Typography>\n </Skeleton>\n )}\n {Boolean(errorText) && (\n // TODO v4: We might want to have a min width for the container for the messages to help skeleton loading.\n // Currently the message fills 100% of the width while the rest of the text input has a set width.\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n width=\"fit-content\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-form-message\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <Typography\n className=\"ndl-error-text\"\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n htmlAttributes={{\n 'aria-live': 'polite',\n id: errorTextId,\n }}\n >\n {errorText}\n </Typography>\n </div>\n </Skeleton>\n )}\n </div>\n );\n};\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Clearable", isClearable: true, placeholder: "Type something" }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Clearable", isClearable: true, placeholder: "Type something", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-clearable.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-clearable.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-clearable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IAAC,KAAK,EAAC,WAAW,EAAC,WAAW,QAAC,WAAW,EAAC,gBAAgB,GAAG,CACzE,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput label=\"Clearable\" isClearable placeholder=\"Type something\" />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-clearable.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-clearable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,WAAW,EACjB,WAAW,QACX,WAAW,EAAC,gBAAgB,EAC5B,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Clearable\"\n isClearable\n placeholder=\"Type something\"\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", helpText: "Help text" });
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", helpText: "Help text", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-default.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-default.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,uBAAC,iBAAS,IAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAC,WAAW,GAAG,CAAC;AAC1D,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return <TextInput label=\"Label\" helpText=\"Help text\" />;\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-default.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,WAAW,EACpB,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n helpText=\"Help text\"\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", isDisabled: true, helpText: "Help text", value: "Value" }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", isDisabled: true, helpText: "Help text", value: "Value", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-disabled.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-disabled.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-disabled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IAAC,KAAK,EAAC,OAAO,EAAC,UAAU,QAAC,QAAQ,EAAC,WAAW,EAAC,KAAK,EAAC,OAAO,GAAG,CAC1E,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput label=\"Label\" isDisabled helpText=\"Help text\" value=\"Value\" />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-disabled.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-disabled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,UAAU,QACV,QAAQ,EAAC,WAAW,EACpB,KAAK,EAAC,OAAO,EACb,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n isDisabled\n helpText=\"Help text\"\n value=\"Value\"\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -25,6 +25,7 @@ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
27
  return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Email Address", isRequired: true, placeholder: "user@example.com", htmlAttributes: {
28
+ id: 'text-input',
28
29
  type: 'email',
29
30
  } }));
30
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-email.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-email.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,eAAe,EACrB,UAAU,QACV,WAAW,EAAC,kBAAkB,EAC9B,cAAc,EAAE;YACd,IAAI,EAAE,OAAO;SACd,GACD,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Email Address\"\n isRequired\n placeholder=\"user@example.com\"\n htmlAttributes={{\n type: 'email',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-email.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-email.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,eAAe,EACrB,UAAU,QACV,WAAW,EAAC,kBAAkB,EAC9B,cAAc,EAAE;YACd,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,OAAO;SACd,GACD,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Email Address\"\n isRequired\n placeholder=\"user@example.com\"\n htmlAttributes={{\n id: 'text-input',\n type: 'email',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", errorText: "Error text" });
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", errorText: "Error text", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-error.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-error.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-error.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,uBAAC,iBAAS,IAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,GAAG,CAAC;AAC5D,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return <TextInput label=\"Label\" errorText=\"Error text\" />;\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-error.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-error.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,SAAS,EAAC,YAAY,EACtB,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n errorText=\"Error text\"\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -32,7 +32,7 @@ const Component = () => {
32
32
  }, isRequired: false, showRequiredOrOptionalLabel: true, isDisabled: false, isReadOnly: false, isFluid: false, isSkeletonLoading: false, skeletonProps: {
33
33
  onBackground: 'weak',
34
34
  shape: 'rectangular',
35
- } }));
35
+ }, htmlAttributes: { id: 'text-input' } }));
36
36
  };
37
37
  exports.default = Component;
38
38
  //# sourceMappingURL=text-input-full.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-full.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-full.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA8D;AAC9D,kDAA2E;AAC3E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,WAAW,EACpB,WAAW,EAAC,aAAa,EACzB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,cAAc,EAAE,uBAAC,uBAAe,KAAG,EACnC,eAAe,EACb,uBAAC,uBAAe,IACd,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAC/B,WAAW,EAAC,YAAY,YAExB,uBAAC,wBAAgB,KAAG,GACJ,EAEpB,IAAI,EAAC,QAAQ,EACb,mBAAmB,EAAC,uBAAuB,EAC3C,YAAY,EAAE;YACZ,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SAC3B,EACD,UAAU,EAAE,KAAK,EACjB,2BAA2B,EAAE,IAAI,EACjC,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,EACd,iBAAiB,EAAE,KAAK,EACxB,aAAa,EAAE;YACb,YAAY,EAAE,MAAM;YACpB,KAAK,EAAE,aAAa;SACrB,GACD,CACH,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, TextInput } from '@neo4j-ndl/react';\nimport { UserIconOutline, XMarkIconOutline } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [textValue, setTextValue] = useState('');\n\n return (\n <TextInput\n label=\"Label\"\n helpText=\"Help text\"\n placeholder=\"Placeholder\"\n value={textValue}\n onChange={(e) => setTextValue(e.target.value)}\n leadingElement={<UserIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => setTextValue('')}\n description=\"clear text\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n size=\"medium\"\n moreInformationText=\"Information icon text\"\n tooltipProps={{\n root: { placement: 'top' },\n }}\n isRequired={false}\n showRequiredOrOptionalLabel={true}\n isDisabled={false}\n isReadOnly={false}\n isFluid={false}\n isSkeletonLoading={false}\n skeletonProps={{\n onBackground: 'weak',\n shape: 'rectangular',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-full.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-full.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA8D;AAC9D,kDAA2E;AAC3E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,WAAW,EACpB,WAAW,EAAC,aAAa,EACzB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,cAAc,EAAE,uBAAC,uBAAe,KAAG,EACnC,eAAe,EACb,uBAAC,uBAAe,IACd,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAC/B,WAAW,EAAC,YAAY,YAExB,uBAAC,wBAAgB,KAAG,GACJ,EAEpB,IAAI,EAAC,QAAQ,EACb,mBAAmB,EAAC,uBAAuB,EAC3C,YAAY,EAAE;YACZ,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SAC3B,EACD,UAAU,EAAE,KAAK,EACjB,2BAA2B,EAAE,IAAI,EACjC,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,EACd,iBAAiB,EAAE,KAAK,EACxB,aAAa,EAAE;YACb,YAAY,EAAE,MAAM;YACpB,KAAK,EAAE,aAAa;SACrB,EACD,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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, TextInput } from '@neo4j-ndl/react';\nimport { UserIconOutline, XMarkIconOutline } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [textValue, setTextValue] = useState('');\n\n return (\n <TextInput\n label=\"Label\"\n helpText=\"Help text\"\n placeholder=\"Placeholder\"\n value={textValue}\n onChange={(e) => setTextValue(e.target.value)}\n leadingElement={<UserIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => setTextValue('')}\n description=\"clear text\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n size=\"medium\"\n moreInformationText=\"Information icon text\"\n tooltipProps={{\n root: { placement: 'top' },\n }}\n isRequired={false}\n showRequiredOrOptionalLabel={true}\n isDisabled={false}\n isReadOnly={false}\n isFluid={false}\n isSkeletonLoading={false}\n skeletonProps={{\n onBackground: 'weak',\n shape: 'rectangular',\n }}\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", moreInformationText: "Information icon text" }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", moreInformationText: "Information icon text", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-information-icon.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-information-icon.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-information-icon.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IAAC,KAAK,EAAC,OAAO,EAAC,mBAAmB,EAAC,uBAAuB,GAAG,CACxE,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput label=\"Label\" moreInformationText=\"Information icon text\" />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-information-icon.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-information-icon.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,mBAAmB,EAAC,uBAAuB,EAC3C,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n moreInformationText=\"Information icon text\"\n htmlAttributes={{ id: 'text-input' }}\n />\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.jsx)(react_1.TextInput, { label: "Default loading", isLoading: true, placeholder: "Placeholder" }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With leading element", isLoading: true, leadingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder" }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With trailing element", isLoading: true, trailingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder" }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With leading and trailing element", isLoading: true, leadingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), trailingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder" })] }));
28
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Default loading", isLoading: true, placeholder: "Placeholder", htmlAttributes: { id: 'text-input-loading' } }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With leading element", isLoading: true, leadingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder", htmlAttributes: { id: 'text-input-loading-leading' } }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With trailing element", isLoading: true, trailingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder", htmlAttributes: { id: 'text-input-loading-trailing' } }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With leading and trailing element", isLoading: true, leadingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), trailingElement: (0, jsx_runtime_1.jsx)(icons_1.CalendarDaysIconOutline, {}), placeholder: "Placeholder", htmlAttributes: { id: 'text-input-loading-both' } })] }));
29
29
  };
30
30
  exports.default = Component;
31
31
  //# sourceMappingURL=text-input-loading-spinner.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-loading-spinner.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-loading-spinner.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAC7C,kDAAiE;AAEjE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,iBAAS,IAAC,KAAK,EAAC,iBAAiB,EAAC,SAAS,QAAC,WAAW,EAAC,aAAa,GAAG,EACzE,uBAAC,iBAAS,IACR,KAAK,EAAC,sBAAsB,EAC5B,SAAS,QACT,cAAc,EAAE,uBAAC,+BAAuB,KAAG,EAC3C,WAAW,EAAC,aAAa,GACzB,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,uBAAuB,EAC7B,SAAS,QACT,eAAe,EAAE,uBAAC,+BAAuB,KAAG,EAC5C,WAAW,EAAC,aAAa,GACzB,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,mCAAmC,EACzC,SAAS,QACT,cAAc,EAAE,uBAAC,+BAAuB,KAAG,EAC3C,eAAe,EAAE,uBAAC,+BAAuB,KAAG,EAC5C,WAAW,EAAC,aAAa,GACzB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { TextInput } from '@neo4j-ndl/react';\nimport { CalendarDaysIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <TextInput label=\"Default loading\" isLoading placeholder=\"Placeholder\" />\n <TextInput\n label=\"With leading element\"\n isLoading\n leadingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n />\n <TextInput\n label=\"With trailing element\"\n isLoading\n trailingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n />\n <TextInput\n label=\"With leading and trailing element\"\n isLoading\n leadingElement={<CalendarDaysIconOutline />}\n trailingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-loading-spinner.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-loading-spinner.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAC7C,kDAAiE;AAEjE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,iBAAS,IACR,KAAK,EAAC,iBAAiB,EACvB,SAAS,QACT,WAAW,EAAC,aAAa,EACzB,cAAc,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,GAC5C,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,sBAAsB,EAC5B,SAAS,QACT,cAAc,EAAE,uBAAC,+BAAuB,KAAG,EAC3C,WAAW,EAAC,aAAa,EACzB,cAAc,EAAE,EAAE,EAAE,EAAE,4BAA4B,EAAE,GACpD,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,uBAAuB,EAC7B,SAAS,QACT,eAAe,EAAE,uBAAC,+BAAuB,KAAG,EAC5C,WAAW,EAAC,aAAa,EACzB,cAAc,EAAE,EAAE,EAAE,EAAE,6BAA6B,EAAE,GACrD,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,mCAAmC,EACzC,SAAS,QACT,cAAc,EAAE,uBAAC,+BAAuB,KAAG,EAC3C,eAAe,EAAE,uBAAC,+BAAuB,KAAG,EAC5C,WAAW,EAAC,aAAa,EACzB,cAAc,EAAE,EAAE,EAAE,EAAE,yBAAyB,EAAE,GACjD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { TextInput } from '@neo4j-ndl/react';\nimport { CalendarDaysIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <TextInput\n label=\"Default loading\"\n isLoading\n placeholder=\"Placeholder\"\n htmlAttributes={{ id: 'text-input-loading' }}\n />\n <TextInput\n label=\"With leading element\"\n isLoading\n leadingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n htmlAttributes={{ id: 'text-input-loading-leading' }}\n />\n <TextInput\n label=\"With trailing element\"\n isLoading\n trailingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n htmlAttributes={{ id: 'text-input-loading-trailing' }}\n />\n <TextInput\n label=\"With leading and trailing element\"\n isLoading\n leadingElement={<CalendarDaysIconOutline />}\n trailingElement={<CalendarDaysIconOutline />}\n placeholder=\"Placeholder\"\n htmlAttributes={{ id: 'text-input-loading-both' }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -27,7 +27,7 @@ const Component = () => {
27
27
  return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", helpText: "Help text", isSkeletonLoading: true, skeletonProps: {
28
28
  onBackground: 'weak',
29
29
  shape: 'rectangular',
30
- } }));
30
+ }, htmlAttributes: { id: 'text-input' } }));
31
31
  };
32
32
  exports.default = Component;
33
33
  //# sourceMappingURL=text-input-loading.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-loading.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-loading.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,WAAW,EACpB,iBAAiB,EAAE,IAAI,EACvB,aAAa,EAAE;YACb,YAAY,EAAE,MAAM;YACpB,KAAK,EAAE,aAAa;SACrB,GACD,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n helpText=\"Help text\"\n isSkeletonLoading={true}\n skeletonProps={{\n onBackground: 'weak',\n shape: 'rectangular',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-loading.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-loading.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,WAAW,EACpB,iBAAiB,EAAE,IAAI,EACvB,aAAa,EAAE;YACb,YAAY,EAAE,MAAM;YACpB,KAAK,EAAE,aAAa;SACrB,EACD,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GACpC,CACH,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 { TextInput } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextInput\n label=\"Label\"\n helpText=\"Help text\"\n isSkeletonLoading={true}\n skeletonProps={{\n onBackground: 'weak',\n shape: 'rectangular',\n }}\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -25,6 +25,7 @@ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
27
  return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Age", htmlAttributes: {
28
+ id: 'text-input',
28
29
  max: '100',
29
30
  min: '0',
30
31
  type: 'number',