@neo4j-ndl/react 4.9.18 → 4.9.20

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":"text-input-number.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-number.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,KAAK,EACX,cAAc,EAAE;YACd,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,QAAQ;SACf,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=\"Age\"\n htmlAttributes={{\n max: '100',\n min: '0',\n type: 'number',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-number.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-number.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,KAAK,EACX,cAAc,EAAE;YACd,EAAE,EAAE,YAAY;YAChB,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,QAAQ;SACf,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=\"Age\"\n htmlAttributes={{\n id: 'text-input',\n max: '100',\n min: '0',\n type: 'number',\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", helpText: "Help text", showRequiredOrOptionalLabel: true }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", helpText: "Help text", showRequiredOrOptionalLabel: true, htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-optional.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-optional.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-optional.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,QAAQ,EAAC,WAAW,EAAC,2BAA2B,SAAG,CAC7E,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\" helpText=\"Help text\" showRequiredOrOptionalLabel />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-optional.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-optional.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,2BAA2B,QAC3B,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 showRequiredOrOptionalLabel\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -28,6 +28,7 @@ const react_2 = require("react");
28
28
  const Component = () => {
29
29
  const [isPasswordVisible, setIsPasswordVisible] = (0, react_2.useState)(false);
30
30
  return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Password", trailingElement: (0, jsx_runtime_1.jsx)(react_1.CleanIconButton, { onClick: () => setIsPasswordVisible(!isPasswordVisible), description: "toggle password visibility", children: isPasswordVisible ? (0, jsx_runtime_1.jsx)(icons_1.EyeIconOutline, {}) : (0, jsx_runtime_1.jsx)(icons_1.EyeSlashIconOutline, {}) }), placeholder: "Enter password", htmlAttributes: {
31
+ id: 'text-input',
31
32
  type: isPasswordVisible ? 'text' : 'password',
32
33
  } }));
33
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-password.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-password.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA8D;AAC9D,kDAA6E;AAC7E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAElE,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,UAAU,EAChB,eAAe,EACb,uBAAC,uBAAe,IACd,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC,iBAAiB,CAAC,EACvD,WAAW,EAAC,4BAA4B,YAEvC,iBAAiB,CAAC,CAAC,CAAC,uBAAC,sBAAc,KAAG,CAAC,CAAC,CAAC,uBAAC,2BAAmB,KAAG,GACjD,EAEpB,WAAW,EAAC,gBAAgB,EAC5B,cAAc,EAAE;YACd,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU;SAC9C,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 { EyeIconOutline, EyeSlashIconOutline } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n\n return (\n <TextInput\n label=\"Password\"\n trailingElement={\n <CleanIconButton\n onClick={() => setIsPasswordVisible(!isPasswordVisible)}\n description=\"toggle password visibility\"\n >\n {isPasswordVisible ? <EyeIconOutline /> : <EyeSlashIconOutline />}\n </CleanIconButton>\n }\n placeholder=\"Enter password\"\n htmlAttributes={{\n type: isPasswordVisible ? 'text' : 'password',\n }}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-password.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-password.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA8D;AAC9D,kDAA6E;AAC7E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAElE,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,UAAU,EAChB,eAAe,EACb,uBAAC,uBAAe,IACd,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC,iBAAiB,CAAC,EACvD,WAAW,EAAC,4BAA4B,YAEvC,iBAAiB,CAAC,CAAC,CAAC,uBAAC,sBAAc,KAAG,CAAC,CAAC,CAAC,uBAAC,2BAAmB,KAAG,GACjD,EAEpB,WAAW,EAAC,gBAAgB,EAC5B,cAAc,EAAE;YACd,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU;SAC9C,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 { EyeIconOutline, EyeSlashIconOutline } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n\n return (\n <TextInput\n label=\"Password\"\n trailingElement={\n <CleanIconButton\n onClick={() => setIsPasswordVisible(!isPasswordVisible)}\n description=\"toggle password visibility\"\n >\n {isPasswordVisible ? <EyeIconOutline /> : <EyeSlashIconOutline />}\n </CleanIconButton>\n }\n placeholder=\"Enter password\"\n htmlAttributes={{\n id: 'text-input',\n type: isPasswordVisible ? 'text' : 'password',\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", isReadOnly: true, helpText: "Help text", value: "Value" }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", isReadOnly: true, helpText: "Help text", value: "Value", htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-readonly.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-readonly.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-readonly.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\" isReadOnly helpText=\"Help text\" value=\"Value\" />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-readonly.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-readonly.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 isReadOnly\n helpText=\"Help text\"\n value=\"Value\"\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", isRequired: true, helpText: "Help text", showRequiredOrOptionalLabel: true }));
27
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Label", isRequired: true, helpText: "Help text", showRequiredOrOptionalLabel: true, htmlAttributes: { id: 'text-input' } }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-required.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-required.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-required.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,2BAA2B,SAC3B,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 isRequired\n helpText=\"Help text\"\n showRequiredOrOptionalLabel\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-required.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-required.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,2BAA2B,QAC3B,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 isRequired\n helpText=\"Help text\"\n showRequiredOrOptionalLabel\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.jsxs)("div", { className: "n-flex n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Small Input", size: "small" }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Medium Input", size: "medium" }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Large Input", size: "large" })] }));
27
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Small Input", size: "small", htmlAttributes: { id: 'text-input-small' } }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Medium Input", size: "medium", htmlAttributes: { id: 'text-input-medium' } }), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Large Input", size: "large", htmlAttributes: { id: 'text-input-large' } })] }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=text-input-sizes.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-sizes.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,uBAAuB,aACpC,uBAAC,iBAAS,IAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,OAAO,GAAG,EAC9C,uBAAC,iBAAS,IAAC,KAAK,EAAC,cAAc,EAAC,IAAI,EAAC,QAAQ,GAAG,EAChD,uBAAC,iBAAS,IAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,OAAO,GAAG,IAC1C,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';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-gap-token-16\">\n <TextInput label=\"Small Input\" size=\"small\" />\n <TextInput label=\"Medium Input\" size=\"medium\" />\n <TextInput label=\"Large Input\" size=\"large\" />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-sizes.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,uBAAuB,aACpC,uBAAC,iBAAS,IACR,KAAK,EAAC,aAAa,EACnB,IAAI,EAAC,OAAO,EACZ,cAAc,EAAE,EAAE,EAAE,EAAE,kBAAkB,EAAE,GAC1C,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,QAAQ,EACb,cAAc,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAC3C,EACF,uBAAC,iBAAS,IACR,KAAK,EAAC,aAAa,EACnB,IAAI,EAAC,OAAO,EACZ,cAAc,EAAE,EAAE,EAAE,EAAE,kBAAkB,EAAE,GAC1C,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';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-gap-token-16\">\n <TextInput\n label=\"Small Input\"\n size=\"small\"\n htmlAttributes={{ id: 'text-input-small' }}\n />\n <TextInput\n label=\"Medium Input\"\n size=\"medium\"\n htmlAttributes={{ id: 'text-input-medium' }}\n />\n <TextInput\n label=\"Large Input\"\n size=\"large\"\n htmlAttributes={{ id: 'text-input-large' }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -27,7 +27,7 @@ const icons_1 = require("@neo4j-ndl/react/icons");
27
27
  const react_2 = require("react");
28
28
  const Component = () => {
29
29
  const [searchValue, setSearchValue] = (0, react_2.useState)('');
30
- return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With icons", leadingElement: (0, jsx_runtime_1.jsx)(icons_1.DatabasePlugIcon, {}), trailingElement: (0, jsx_runtime_1.jsx)(icons_1.DatabasePlusIcon, {}), value: searchValue, onChange: (e) => setSearchValue(e.target.value) }));
30
+ return ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "With icons", leadingElement: (0, jsx_runtime_1.jsx)(icons_1.DatabasePlugIcon, {}), trailingElement: (0, jsx_runtime_1.jsx)(icons_1.DatabasePlusIcon, {}), value: searchValue, onChange: (e) => setSearchValue(e.target.value), htmlAttributes: { id: 'text-input' } }));
31
31
  };
32
32
  exports.default = Component;
33
33
  //# sourceMappingURL=text-input-with-icons.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-with-icons.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-with-icons.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAC7C,kDAA4E;AAC5E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAEnD,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,YAAY,EAClB,cAAc,EAAE,uBAAC,wBAAgB,KAAG,EACpC,eAAe,EAAE,uBAAC,wBAAgB,KAAG,EACrC,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC/C,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';\nimport { DatabasePlugIcon, DatabasePlusIcon } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [searchValue, setSearchValue] = useState('');\n\n return (\n <TextInput\n label=\"With icons\"\n leadingElement={<DatabasePlugIcon />}\n trailingElement={<DatabasePlusIcon />}\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-input-with-icons.story.js","sourceRoot":"","sources":["../../../../src/text-input/stories/text-input-with-icons.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA6C;AAC7C,kDAA4E;AAC5E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAEnD,OAAO,CACL,uBAAC,iBAAS,IACR,KAAK,EAAC,YAAY,EAClB,cAAc,EAAE,uBAAC,wBAAgB,KAAG,EACpC,eAAe,EAAE,uBAAC,wBAAgB,KAAG,EACrC,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,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';\nimport { DatabasePlugIcon, DatabasePlusIcon } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [searchValue, setSearchValue] = useState('');\n\n return (\n <TextInput\n label=\"With icons\"\n leadingElement={<DatabasePlugIcon />}\n trailingElement={<DatabasePlusIcon />}\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n htmlAttributes={{ id: 'text-input' }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -59,13 +59,15 @@ const TimePicker = (_a) => {
59
59
  (0, react_2.useImperativeHandle)(ref, () => inputRef.current, []);
60
60
  const [lastAction, setLastAction] = (0, react_2.useState)('type');
61
61
  const [error, setError] = (0, react_2.useState)(undefined);
62
+ const errorTextId = (0, react_2.useId)();
62
63
  const timeOptions = (0, react_2.useMemo)(() => (0, generate_time_options_1.generateTimeOptions)(is24Hour, timeInterval), [is24Hour, timeInterval]);
63
64
  const { themeClassName } = (0, theme_1.useNeedleTheme)();
64
65
  const { isPopoverOpen, setIsPopoverOpen } = (0, time_picker_hooks_1.useTimePickerPopover)(false);
65
66
  const { focusedIndex, setFocusedIndex, handleArrowNavigation } = (0, time_picker_hooks_1.useKeyboardNavigation)(listRef, timeOptions.length);
67
+ const errorToShow = errorText !== undefined && errorText !== '' ? errorText : error;
66
68
  const classes = {
67
69
  'ndl-disabled': isDisabled,
68
- 'ndl-error': error !== undefined,
70
+ 'ndl-error': errorToShow !== undefined,
69
71
  'ndl-fluid': isFluid,
70
72
  'ndl-large': size === 'large',
71
73
  'ndl-medium': size === 'medium',
@@ -73,7 +75,6 @@ const TimePicker = (_a) => {
73
75
  'ndl-small': size === 'small',
74
76
  };
75
77
  const inputWidth = isFluid === true ? '100%' : is24Hour === true ? '6rem' : '9rem';
76
- const errorToShow = errorText !== undefined && errorText !== '' ? errorText : error;
77
78
  const isValidTime = (0, react_2.useCallback)((hours, minutes) => {
78
79
  if (hours > 23 || hours < 0) {
79
80
  return false;
@@ -242,7 +243,7 @@ const TimePicker = (_a) => {
242
243
  const mergedRef = (0, react_1.useMergeRefs)([refs.setReference, containerRef]);
243
244
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-time-picker', className, Object.assign({}, classes)), ref: mergedRef }, getReferenceProps(), { style: {
244
245
  width: isFluid === true ? '100%' : 'fit-content',
245
- }, children: [(0, jsx_runtime_1.jsxs)("label", { className: "ndl-time-picker-label", children: [label !== undefined && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-large' : 'body-medium', children: label })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-time-picker-input-wrapper", style: Object.assign({ width: inputWidth }, style), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ "aria-label": label, className: "ndl-time-picker-input", type: "text", ref: inputRef, value: inputValue, disabled: isDisabled, readOnly: isReadOnly, required: isRequired, onChange: newHandleInputChange, onKeyDown: handleKeyDown, onClick: () => {
246
+ }, children: [(0, jsx_runtime_1.jsxs)("label", { className: "ndl-time-picker-label", children: [label !== undefined && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-large' : 'body-medium', children: label })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-time-picker-input-wrapper", style: Object.assign({ width: inputWidth }, style), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ "aria-label": label, "aria-invalid": Boolean(errorToShow), "aria-describedby": errorToShow ? errorTextId : undefined, className: "ndl-time-picker-input", type: "text", ref: inputRef, value: inputValue, disabled: isDisabled, readOnly: isReadOnly, required: isRequired, onChange: newHandleInputChange, onKeyDown: handleKeyDown, onClick: () => {
246
247
  if (isReadOnly === true || isDisabled === true) {
247
248
  return;
248
249
  }
@@ -271,7 +272,7 @@ const TimePicker = (_a) => {
271
272
  setError(undefined);
272
273
  setInputValue(time.toString(is24Hour));
273
274
  }
274
- }, placeholder: format, maxLength: is24Hour ? 5 : 8 }, restProps, htmlAttributes)), (0, jsx_runtime_1.jsx)(icons_1.ClockIconOutline, { className: "ndl-icon-svg ndl-time-picker-icon" })] })] }), errorToShow !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-time-picker-error-wrapper", children: [(0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, { className: "ndl-time-picker-error-icon" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-medium' : 'body-small', className: "ndl-time-picker-error-text", children: errorToShow })] }))] })), context.open && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: -1, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: refs.setFloating, className: (0, classnames_1.default)(themeClassName, 'ndl-time-picker-popover', Object.assign({}, classes)), style: Object.assign(Object.assign(Object.assign({}, transitionStyles), floatingStyles), { width: isFluid === true
275
+ }, placeholder: format, maxLength: is24Hour ? 5 : 8 }, restProps, htmlAttributes)), (0, jsx_runtime_1.jsx)(icons_1.ClockIconOutline, { className: "ndl-icon-svg ndl-time-picker-icon" })] })] }), errorToShow !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-time-picker-error-wrapper", role: "status", children: [(0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, { className: "ndl-time-picker-error-icon" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-medium' : 'body-small', className: "ndl-time-picker-error-text", htmlAttributes: { id: errorTextId }, children: errorToShow })] }))] })), context.open && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: -1, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: refs.setFloating, className: (0, classnames_1.default)(themeClassName, 'ndl-time-picker-popover', Object.assign({}, classes)), style: Object.assign(Object.assign(Object.assign({}, transitionStyles), floatingStyles), { width: isFluid === true
275
276
  ? (_d = containerRef.current) === null || _d === void 0 ? void 0 : _d.clientWidth
276
277
  : undefined }) }, getFloatingProps(), { children: (0, jsx_runtime_1.jsx)("ul", { ref: listRef, tabIndex: -1, children: timeOptions.map((time, i) => ((0, jsx_runtime_1.jsx)("li", { role: "option", "aria-selected": (value === null || value === void 0 ? void 0 : value.toString(is24Hour)) === time ||
277
278
  (editedInput === null || editedInput === void 0 ? void 0 : editedInput.toString(is24Hour)) === time, value: time, onClick: (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAY4B;AAC5B,0CAAyC;AACzC,4DAAoC;AAEpC,iCAOe;AAGf,0DAAsD;AACtD,6DAA6D;AAC7D,oCAAwE;AACxE,oCAA0C;AAC1C,8CAA2C;AAC3C,mEAA8D;AAC9D,+CAA2C;AAC3C,2DAG6B;AAuCtB,MAAM,UAAU,GAAG,CAAsC,EAoBnB,EAAE,EAAE;;QApBe,EAC9D,MAAM,GAAG,OAAO,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,UAAU,EAAE,cAAc,EAC1B,GAAG,OAEwC,EADxC,SAAS,cAnBkD,8NAoB/D,CADa;IAEZ,MAA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AC,eAAe,EAAE,CAAC;wCACpB,aAAa,CAAC,IAAI,CAAC,CAAC;oCACtB,CAAC;gCACH,CAAC,YAEA,IAAI,IA7BA,CAAC,CA8BH,CACN,CAAC,GACC,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAjZW,QAAA,UAAU,cAiZrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ClockIconOutline, ExclamationCircleIconSolid } from '../icons';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport { generateTimeOptions } from './generate-time-options';\nimport { NeedleTime } from './needle-time';\nimport {\n useKeyboardNavigation,\n useTimePickerPopover,\n} from './time-picker-hooks';\n\nexport type TimeFormat = 'hh:mm' | 'hh:mm aa';\n\nexport type TimePickerProps = {\n /** The value of the time picker */\n value?: NeedleTime;\n /** The format of the time picker */\n format?: TimeFormat;\n /** Whether the time picker is fluid */\n isFluid?: boolean;\n /** Whether the time picker is read only */\n isReadOnly?: boolean;\n /** Whether the time picker is required */\n isRequired?: boolean;\n /** Whether the time picker is disabled */\n isDisabled?: boolean;\n /** The time interval of the time picker, in minutes */\n timeInterval?: number;\n /** The label of the time picker */\n label?: string;\n /** The size of the time picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the time picker value changes */\n onChange?: (time: NeedleTime) => void;\n /** Callback function triggered when the time picker encounters an error */\n onError?: (error: string, time: NeedleTime) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n};\n\nexport const TimePicker = <T extends React.ElementType = 'div'>({\n format = 'hh:mm',\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n timeInterval = 15,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TimePickerProps>) => {\n const [editedInput, setEditedInput] = useState<NeedleTime | undefined>(value);\n\n const is24Hour = format === 'hh:mm';\n const [inputValue, setInputValue] = useState<string>(\n value?.toString(is24Hour) ?? '',\n );\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [lastAction, setLastAction] = useState<'type' | 'arrow'>('type');\n const [error, setError] = useState<string | undefined>(undefined);\n\n const timeOptions = useMemo(\n () => generateTimeOptions(is24Hour, timeInterval),\n [is24Hour, timeInterval],\n );\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimePickerPopover(false);\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(listRef, timeOptions.length);\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': error !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth =\n isFluid === true ? '100%' : is24Hour === true ? '6rem' : '9rem';\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const isValidTime = useCallback((hours: number, minutes: number) => {\n if (hours > 23 || hours < 0) {\n return false;\n }\n\n if (minutes > 59 || minutes < 0) {\n return false;\n }\n\n return true;\n }, []);\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, NeedleTime.fromString(inputValue));\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setEditedInput(value);\n setInputValue(value?.toString(is24Hour) ?? '');\n }, [is24Hour, value]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n inputRef.current?.blur();\n const selectedIndex =\n timeOptions.indexOf(value?.toString(is24Hour) ?? '') ?? 0;\n setFocusedIndex(selectedIndex);\n }, 0);\n }\n }, [\n focusedIndex,\n is24Hour,\n isPopoverOpen,\n value,\n setFocusedIndex,\n timeOptions,\n ]);\n\n const handleOnClick = (timeText: string) => {\n if (onChange) {\n onChange(NeedleTime.fromString(timeText));\n }\n setError(undefined);\n setInputValue(timeText);\n setEditedInput(NeedleTime.fromString(timeText));\n setIsPopoverOpen(false);\n };\n const newHandleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n scrollToTime(e.target.value);\n setInputValue(e.target.value);\n setLastAction('type');\n\n const time = NeedleTime.fromString(e.target.value);\n if (!isValidTime(time.hour, time.minute)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n if (lastAction === 'type' && inputValue.length >= (is24Hour ? 5 : 6)) {\n const time = NeedleTime.fromString(inputValue);\n handleOnClick(time.toString(is24Hour));\n } else if (lastAction === 'type' && !inputValue.includes(':')) {\n const time = NeedleTime.fromString(inputValue);\n if (isValidTime(time.hour, time.minute)) {\n handleOnClick(time.toString(is24Hour));\n }\n setIsPopoverOpen(false);\n } else {\n handleOnClick(timeOptions[focusedIndex]);\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n setLastAction('arrow');\n handleArrowNavigation(e.key);\n }\n };\n\n const scrollToTime = (startOfTime: string) => {\n const parsedTime = startOfTime.toLowerCase().replace(/[^0-9amp]/g, '');\n let index = -1;\n\n // Handle AM/PM input\n const isPM = parsedTime.includes('p');\n const isAM = parsedTime.includes('a');\n const timeDigits = parsedTime.replace(/[amp]/g, '');\n\n if (timeDigits.length === 1) {\n // Single digit - assume it's an hour\n const hour = `0${timeDigits}`;\n const searchTime = is24Hour\n ? `${hour}:00`\n : `${hour}:00 ${isPM ? 'PM' : 'AM'}`;\n index = timeOptions.indexOf(searchTime);\n } else {\n // Find closest matching time\n const closestTime = timeOptions.find((time) => {\n const timeWithoutSpecialChars = time\n .toLowerCase()\n .replace(/[^0-9amp]/g, '');\n if (isPM || isAM) {\n // If AM/PM specified, match that specifically\n return timeWithoutSpecialChars.startsWith(parsedTime);\n } else {\n // Otherwise just match the numbers\n return timeWithoutSpecialChars\n .replace(/[amp]/g, '')\n .startsWith(timeDigits);\n }\n });\n index = closestTime !== undefined ? timeOptions.indexOf(closestTime) : -1;\n }\n\n if (index !== -1) {\n setFocusedIndex(index);\n }\n\n return index;\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-time-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-time-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-time-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n aria-label={label} // TODO: handle label natively\n className=\"ndl-time-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={newHandleInputChange}\n onKeyDown={handleKeyDown}\n onClick={() => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-time-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n if (inputValue.length < 4) {\n setError('Invalid time');\n return;\n }\n\n const time = NeedleTime.fromString(inputValue);\n\n if (time === undefined || time === null) {\n setError('Invalid time');\n return;\n }\n\n if (!isValidTime(time.hour, time.minute)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n setInputValue(time.toString(is24Hour));\n }\n }}\n placeholder={format}\n maxLength={is24Hour ? 5 : 8}\n {...restProps}\n {...htmlAttributes}\n />\n <ClockIconOutline className=\"ndl-icon-svg ndl-time-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-time-picker-error-wrapper\">\n <ExclamationCircleIconSolid className=\"ndl-time-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-time-picker-error-text\"\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(themeClassName, 'ndl-time-picker-popover', {\n ...classes,\n })}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} tabIndex={-1}>\n {timeOptions.map((time, i) => (\n <li\n key={i}\n role=\"option\"\n aria-selected={\n value?.toString(is24Hour) === time ||\n editedInput?.toString(is24Hour) === time\n }\n value={time}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(time);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-time-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(time);\n }\n }}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAY4B;AAC5B,0CAAyC;AACzC,4DAAoC;AAEpC,iCAQe;AAGf,0DAAsD;AACtD,6DAA6D;AAC7D,oCAAwE;AACxE,oCAA0C;AAC1C,8CAA2C;AAC3C,mEAA8D;AAC9D,+CAA2C;AAC3C,2DAG6B;AAuCtB,MAAM,UAAU,GAAG,CAAsC,EAoBnB,EAAE,EAAE;;QApBe,EAC9D,MAAM,GAAG,OAAO,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,UAAU,EAAE,cAAc,EAC1B,GAAG,OAEwC,EADxC,SAAS,cAnBkD,8NAoB/D,CADa;IAEZ,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAyB,KAAK,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAG,MAAM,KAAK,OAAO,CAAC;IACpC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAC1C,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAChC,CAAC;IACF,MAAM,OAAO,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAChD,IAAA,2BAAmB,EAAC,GAAG,EAAE,GAAG,EAAE,CA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Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ClockIconOutline, ExclamationCircleIconSolid } from '../icons';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport { generateTimeOptions } from './generate-time-options';\nimport { NeedleTime } from './needle-time';\nimport {\n useKeyboardNavigation,\n useTimePickerPopover,\n} from './time-picker-hooks';\n\nexport type TimeFormat = 'hh:mm' | 'hh:mm aa';\n\nexport type TimePickerProps = {\n /** The value of the time picker */\n value?: NeedleTime;\n /** The format of the time picker */\n format?: TimeFormat;\n /** Whether the time picker is fluid */\n isFluid?: boolean;\n /** Whether the time picker is read only */\n isReadOnly?: boolean;\n /** Whether the time picker is required */\n isRequired?: boolean;\n /** Whether the time picker is disabled */\n isDisabled?: boolean;\n /** The time interval of the time picker, in minutes */\n timeInterval?: number;\n /** The label of the time picker */\n label?: string;\n /** The size of the time picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the time picker value changes */\n onChange?: (time: NeedleTime) => void;\n /** Callback function triggered when the time picker encounters an error */\n onError?: (error: string, time: NeedleTime) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n};\n\nexport const TimePicker = <T extends React.ElementType = 'div'>({\n format = 'hh:mm',\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n timeInterval = 15,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TimePickerProps>) => {\n const [editedInput, setEditedInput] = useState<NeedleTime | undefined>(value);\n\n const is24Hour = format === 'hh:mm';\n const [inputValue, setInputValue] = useState<string>(\n value?.toString(is24Hour) ?? '',\n );\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [lastAction, setLastAction] = useState<'type' | 'arrow'>('type');\n const [error, setError] = useState<string | undefined>(undefined);\n const errorTextId = useId();\n\n const timeOptions = useMemo(\n () => generateTimeOptions(is24Hour, timeInterval),\n [is24Hour, timeInterval],\n );\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimePickerPopover(false);\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(listRef, timeOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth =\n isFluid === true ? '100%' : is24Hour === true ? '6rem' : '9rem';\n\n const isValidTime = useCallback((hours: number, minutes: number) => {\n if (hours > 23 || hours < 0) {\n return false;\n }\n\n if (minutes > 59 || minutes < 0) {\n return false;\n }\n\n return true;\n }, []);\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, NeedleTime.fromString(inputValue));\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setEditedInput(value);\n setInputValue(value?.toString(is24Hour) ?? '');\n }, [is24Hour, value]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n inputRef.current?.blur();\n const selectedIndex =\n timeOptions.indexOf(value?.toString(is24Hour) ?? '') ?? 0;\n setFocusedIndex(selectedIndex);\n }, 0);\n }\n }, [\n focusedIndex,\n is24Hour,\n isPopoverOpen,\n value,\n setFocusedIndex,\n timeOptions,\n ]);\n\n const handleOnClick = (timeText: string) => {\n if (onChange) {\n onChange(NeedleTime.fromString(timeText));\n }\n setError(undefined);\n setInputValue(timeText);\n setEditedInput(NeedleTime.fromString(timeText));\n setIsPopoverOpen(false);\n };\n const newHandleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n scrollToTime(e.target.value);\n setInputValue(e.target.value);\n setLastAction('type');\n\n const time = NeedleTime.fromString(e.target.value);\n if (!isValidTime(time.hour, time.minute)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n if (lastAction === 'type' && inputValue.length >= (is24Hour ? 5 : 6)) {\n const time = NeedleTime.fromString(inputValue);\n handleOnClick(time.toString(is24Hour));\n } else if (lastAction === 'type' && !inputValue.includes(':')) {\n const time = NeedleTime.fromString(inputValue);\n if (isValidTime(time.hour, time.minute)) {\n handleOnClick(time.toString(is24Hour));\n }\n setIsPopoverOpen(false);\n } else {\n handleOnClick(timeOptions[focusedIndex]);\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n setLastAction('arrow');\n handleArrowNavigation(e.key);\n }\n };\n\n const scrollToTime = (startOfTime: string) => {\n const parsedTime = startOfTime.toLowerCase().replace(/[^0-9amp]/g, '');\n let index = -1;\n\n // Handle AM/PM input\n const isPM = parsedTime.includes('p');\n const isAM = parsedTime.includes('a');\n const timeDigits = parsedTime.replace(/[amp]/g, '');\n\n if (timeDigits.length === 1) {\n // Single digit - assume it's an hour\n const hour = `0${timeDigits}`;\n const searchTime = is24Hour\n ? `${hour}:00`\n : `${hour}:00 ${isPM ? 'PM' : 'AM'}`;\n index = timeOptions.indexOf(searchTime);\n } else {\n // Find closest matching time\n const closestTime = timeOptions.find((time) => {\n const timeWithoutSpecialChars = time\n .toLowerCase()\n .replace(/[^0-9amp]/g, '');\n if (isPM || isAM) {\n // If AM/PM specified, match that specifically\n return timeWithoutSpecialChars.startsWith(parsedTime);\n } else {\n // Otherwise just match the numbers\n return timeWithoutSpecialChars\n .replace(/[amp]/g, '')\n .startsWith(timeDigits);\n }\n });\n index = closestTime !== undefined ? timeOptions.indexOf(closestTime) : -1;\n }\n\n if (index !== -1) {\n setFocusedIndex(index);\n }\n\n return index;\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-time-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-time-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-time-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n aria-label={label} // TODO: handle label natively\n aria-invalid={Boolean(errorToShow)}\n aria-describedby={errorToShow ? errorTextId : undefined}\n className=\"ndl-time-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={newHandleInputChange}\n onKeyDown={handleKeyDown}\n onClick={() => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-time-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n if (inputValue.length < 4) {\n setError('Invalid time');\n return;\n }\n\n const time = NeedleTime.fromString(inputValue);\n\n if (time === undefined || time === null) {\n setError('Invalid time');\n return;\n }\n\n if (!isValidTime(time.hour, time.minute)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n setInputValue(time.toString(is24Hour));\n }\n }}\n placeholder={format}\n maxLength={is24Hour ? 5 : 8}\n {...restProps}\n {...htmlAttributes}\n />\n <ClockIconOutline className=\"ndl-icon-svg ndl-time-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-time-picker-error-wrapper\" role=\"status\">\n <ExclamationCircleIconSolid className=\"ndl-time-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-time-picker-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(themeClassName, 'ndl-time-picker-popover', {\n ...classes,\n })}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} tabIndex={-1}>\n {timeOptions.map((time, i) => (\n <li\n key={i}\n role=\"option\"\n aria-selected={\n value?.toString(is24Hour) === time ||\n editedInput?.toString(is24Hour) === time\n }\n value={time}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(time);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-time-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(time);\n }\n }}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
@@ -23,14 +23,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.TimePickerInDialogSrc = exports.TimePickerDefaultSrc = exports.TimePickerInDialog = exports.TimePickerDefault = void 0;
26
+ exports.TimePickerInDialogSrc = exports.TimePickerErrorSrc = exports.TimePickerDefaultSrc = exports.TimePickerInDialog = exports.TimePickerError = exports.TimePickerDefault = void 0;
27
27
  var time_picker_default_story_1 = require("./time-picker-default.story");
28
28
  Object.defineProperty(exports, "TimePickerDefault", { enumerable: true, get: function () { return __importDefault(time_picker_default_story_1).default; } });
29
+ var time_picker_error_story_1 = require("./time-picker-error.story");
30
+ Object.defineProperty(exports, "TimePickerError", { enumerable: true, get: function () { return __importDefault(time_picker_error_story_1).default; } });
29
31
  var time_picker_in_dialog_story_1 = require("./time-picker-in-dialog.story");
30
32
  Object.defineProperty(exports, "TimePickerInDialog", { enumerable: true, get: function () { return __importDefault(time_picker_in_dialog_story_1).default; } });
31
33
  const export_stories_utils_1 = require("../../_common/export-stories-utils");
32
34
  const time_picker_default_story_tsx_raw_1 = __importDefault(require("./time-picker-default.story.tsx?raw"));
35
+ const time_picker_error_story_tsx_raw_1 = __importDefault(require("./time-picker-error.story.tsx?raw"));
33
36
  const time_picker_in_dialog_story_tsx_raw_1 = __importDefault(require("./time-picker-in-dialog.story.tsx?raw"));
34
37
  exports.TimePickerDefaultSrc = (0, export_stories_utils_1.removeLicenseHeader)(time_picker_default_story_tsx_raw_1.default);
38
+ exports.TimePickerErrorSrc = (0, export_stories_utils_1.removeLicenseHeader)(time_picker_error_story_tsx_raw_1.default);
35
39
  exports.TimePickerInDialogSrc = (0, export_stories_utils_1.removeLicenseHeader)(time_picker_in_dialog_story_tsx_raw_1.default);
36
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,yEAA2E;AAAlE,+IAAA,OAAO,OAAqB;AACrC,6EAA8E;AAArE,kJAAA,OAAO,OAAsB;AAEtC,6EAAyE;AACzE,4GAA0E;AAC1E,gHAA6E;AAEhE,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,2CAAuB,CACxB,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,6CAAwB,CACzB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as TimePickerDefault } from './time-picker-default.story';\nexport { default as TimePickerInDialog } from './time-picker-in-dialog.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport TimePickerDefaultSrcRaw from './time-picker-default.story.tsx?raw';\nimport TimePickerInDialogSrcRaw from './time-picker-in-dialog.story.tsx?raw';\n\nexport const TimePickerDefaultSrc = removeLicenseHeader(\n TimePickerDefaultSrcRaw,\n);\nexport const TimePickerInDialogSrc = removeLicenseHeader(\n TimePickerInDialogSrcRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,yEAA2E;AAAlE,+IAAA,OAAO,OAAqB;AACrC,qEAAuE;AAA9D,2IAAA,OAAO,OAAmB;AACnC,6EAA8E;AAArE,kJAAA,OAAO,OAAsB;AAEtC,6EAAyE;AACzE,4GAA0E;AAC1E,wGAAsE;AACtE,gHAA6E;AAEhE,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,2CAAuB,CACxB,CAAC;AACW,QAAA,kBAAkB,GAAG,IAAA,0CAAmB,EAAC,yCAAqB,CAAC,CAAC;AAChE,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,6CAAwB,CACzB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as TimePickerDefault } from './time-picker-default.story';\nexport { default as TimePickerError } from './time-picker-error.story';\nexport { default as TimePickerInDialog } from './time-picker-in-dialog.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport TimePickerDefaultSrcRaw from './time-picker-default.story.tsx?raw';\nimport TimePickerErrorSrcRaw from './time-picker-error.story.tsx?raw';\nimport TimePickerInDialogSrcRaw from './time-picker-in-dialog.story.tsx?raw';\n\nexport const TimePickerDefaultSrc = removeLicenseHeader(\n TimePickerDefaultSrcRaw,\n);\nexport const TimePickerErrorSrc = removeLicenseHeader(TimePickerErrorSrcRaw);\nexport const TimePickerInDialogSrc = removeLicenseHeader(\n TimePickerInDialogSrcRaw,\n);\n"]}
@@ -26,7 +26,7 @@ const react_1 = require("@neo4j-ndl/react");
26
26
  const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [selectedTime, setSelectedTime] = (0, react_2.useState)();
29
- return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px', padding: '20px' }, children: (0, jsx_runtime_1.jsx)(react_1.TimePicker, { label: "Select Time", value: selectedTime, onChange: (time) => setSelectedTime(time) }) }));
29
+ return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px', padding: '20px' }, children: (0, jsx_runtime_1.jsx)(react_1.TimePicker, { label: "Select Time", value: selectedTime, onChange: (time) => setSelectedTime(time), htmlAttributes: { id: 'time-picker-input' } }) }));
30
30
  };
31
31
  exports.default = Component;
32
32
  //# sourceMappingURL=time-picker-default.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time-picker-default.story.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/time-picker-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAc,CAAC;IAE/D,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAC9C,uBAAC,kBAAU,IACT,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GACzC,GACE,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 { type NeedleTime, TimePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedTime, setSelectedTime] = useState<NeedleTime>();\n\n return (\n <div style={{ height: '600px', padding: '20px' }}>\n <TimePicker\n label=\"Select Time\"\n value={selectedTime}\n onChange={(time) => setSelectedTime(time)}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"time-picker-default.story.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/time-picker-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAc,CAAC;IAE/D,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAC9C,uBAAC,kBAAU,IACT,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,cAAc,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAC3C,GACE,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 { type NeedleTime, TimePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedTime, setSelectedTime] = useState<NeedleTime>();\n\n return (\n <div style={{ height: '600px', padding: '20px' }}>\n <TimePicker\n label=\"Select Time\"\n value={selectedTime}\n onChange={(time) => setSelectedTime(time)}\n htmlAttributes={{ id: 'time-picker-input' }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const react_2 = require("react");
27
+ const Component = () => {
28
+ const [selectedTime, setSelectedTime] = (0, react_2.useState)();
29
+ return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px', padding: '20px' }, children: (0, jsx_runtime_1.jsx)(react_1.TimePicker, { label: "Select Time", value: selectedTime, onChange: (time) => setSelectedTime(time), errorText: "Please select a valid time", htmlAttributes: { id: 'time-picker-input' } }) }));
30
+ };
31
+ exports.default = Component;
32
+ //# sourceMappingURL=time-picker-error.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-picker-error.story.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/time-picker-error.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+D;AAC/D,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAc,CAAC;IAE/D,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAC9C,uBAAC,kBAAU,IACT,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,SAAS,EAAC,4BAA4B,EACtC,cAAc,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAC3C,GACE,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 { type NeedleTime, TimePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedTime, setSelectedTime] = useState<NeedleTime>();\n\n return (\n <div style={{ height: '600px', padding: '20px' }}>\n <TimePicker\n label=\"Select Time\"\n value={selectedTime}\n onChange={(time) => setSelectedTime(time)}\n errorText=\"Please select a valid time\"\n htmlAttributes={{ id: 'time-picker-input' }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -26,7 +26,7 @@ const react_1 = require("@neo4j-ndl/react");
26
26
  const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [selectedTime, setSelectedTime] = (0, react_2.useState)();
29
- return ((0, jsx_runtime_1.jsxs)(react_1.Dialog, { isOpen: true, "aria-label": "Dialog", children: [(0, jsx_runtime_1.jsx)(react_1.Dialog.Header, { children: "Using Time Picker inside a dialog" }), (0, jsx_runtime_1.jsx)(react_1.Dialog.Content, { children: (0, jsx_runtime_1.jsx)(react_1.TimePicker, { label: "Select Time", value: selectedTime, onChange: (time) => setSelectedTime(time) }) })] }));
29
+ return ((0, jsx_runtime_1.jsxs)(react_1.Dialog, { isOpen: true, "aria-label": "Dialog", children: [(0, jsx_runtime_1.jsx)(react_1.Dialog.Header, { children: "Using Time Picker inside a dialog" }), (0, jsx_runtime_1.jsx)(react_1.Dialog.Content, { children: (0, jsx_runtime_1.jsx)(react_1.TimePicker, { label: "Select Time", value: selectedTime, onChange: (time) => setSelectedTime(time), htmlAttributes: { id: 'time-picker-input' } }) })] }));
30
30
  };
31
31
  exports.default = Component;
32
32
  //# sourceMappingURL=time-picker-in-dialog.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time-picker-in-dialog.story.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/time-picker-in-dialog.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAuE;AACvE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAc,CAAC;IAE/D,OAAO,CACL,wBAAC,cAAM,IAAC,MAAM,EAAE,IAAI,gBAAa,QAAQ,aACvC,uBAAC,cAAM,CAAC,MAAM,oDAAkD,EAChE,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,kBAAU,IACT,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GACzC,GACa,IACV,CACV,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 { Dialog, type NeedleTime, TimePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedTime, setSelectedTime] = useState<NeedleTime>();\n\n return (\n <Dialog isOpen={true} aria-label=\"Dialog\">\n <Dialog.Header>Using Time Picker inside a dialog</Dialog.Header>\n <Dialog.Content>\n <TimePicker\n label=\"Select Time\"\n value={selectedTime}\n onChange={(time) => setSelectedTime(time)}\n />\n </Dialog.Content>\n </Dialog>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"time-picker-in-dialog.story.js","sourceRoot":"","sources":["../../../../src/time-picker/stories/time-picker-in-dialog.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAuE;AACvE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAc,CAAC;IAE/D,OAAO,CACL,wBAAC,cAAM,IAAC,MAAM,EAAE,IAAI,gBAAa,QAAQ,aACvC,uBAAC,cAAM,CAAC,MAAM,oDAAkD,EAChE,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,kBAAU,IACT,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,cAAc,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAC3C,GACa,IACV,CACV,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 { Dialog, type NeedleTime, TimePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedTime, setSelectedTime] = useState<NeedleTime>();\n\n return (\n <Dialog isOpen={true} aria-label=\"Dialog\">\n <Dialog.Header>Using Time Picker inside a dialog</Dialog.Header>\n <Dialog.Content>\n <TimePicker\n label=\"Select Time\"\n value={selectedTime}\n onChange={(time) => setSelectedTime(time)}\n htmlAttributes={{ id: 'time-picker-input' }}\n />\n </Dialog.Content>\n </Dialog>\n );\n};\n\nexport default Component;\n"]}
@@ -59,6 +59,7 @@ const TimeZonePicker = (_a) => {
59
59
  const inputRef = (0, react_2.useRef)(null);
60
60
  (0, react_2.useImperativeHandle)(ref, () => inputRef.current, []);
61
61
  const [error, setError] = (0, react_2.useState)(undefined);
62
+ const errorTextId = (0, react_2.useId)();
62
63
  const timezoneOptions = (0, react_2.useMemo)(() => {
63
64
  if (mode === 'utc') {
64
65
  return (0, generate_timezone_options_1.generateUTCTimeZoneOptions)(referenceDate);
@@ -105,9 +106,10 @@ const TimeZonePicker = (_a) => {
105
106
  return { cityOptions: city, utcOptions: utc };
106
107
  }, [filteredOptions, mode]);
107
108
  const { focusedIndex, setFocusedIndex, handleArrowNavigation } = (0, timezone_picker_hooks_1.useKeyboardNavigation)(filteredOptions.length);
109
+ const errorToShow = errorText !== undefined && errorText !== '' ? errorText : error;
108
110
  const classes = {
109
111
  'ndl-disabled': isDisabled,
110
- 'ndl-error': error !== undefined,
112
+ 'ndl-error': errorToShow !== undefined,
111
113
  'ndl-fluid': isFluid,
112
114
  'ndl-large': size === 'large',
113
115
  'ndl-medium': size === 'medium',
@@ -115,7 +117,6 @@ const TimeZonePicker = (_a) => {
115
117
  'ndl-small': size === 'small',
116
118
  };
117
119
  const inputWidth = isFluid === true ? '100%' : '16rem';
118
- const errorToShow = errorText !== undefined && errorText !== '' ? errorText : error;
119
120
  (0, react_2.useEffect)(() => {
120
121
  if (error !== undefined) {
121
122
  onError === null || onError === void 0 ? void 0 : onError(error, inputValue);
@@ -240,7 +241,7 @@ const TimeZonePicker = (_a) => {
240
241
  const mergedRef = (0, react_1.useMergeRefs)([refs.setReference, containerRef]);
241
242
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-timezone-picker', className, Object.assign({}, classes)), ref: mergedRef }, getReferenceProps(), { style: {
242
243
  width: isFluid === true ? '100%' : 'fit-content',
243
- }, children: [(0, jsx_runtime_1.jsxs)("label", { className: "ndl-timezone-picker-label", children: [label !== undefined && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-large' : 'body-medium', children: label })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-timezone-picker-input-wrapper", style: Object.assign({ width: inputWidth }, style), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ "aria-label": label, className: "ndl-timezone-picker-input", type: "text", ref: inputRef, value: inputValue, disabled: isDisabled, readOnly: isReadOnly, required: isRequired, onChange: handleInputChange, onKeyDown: handleKeyDown, onClick: (e) => {
244
+ }, children: [(0, jsx_runtime_1.jsxs)("label", { className: "ndl-timezone-picker-label", children: [label !== undefined && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-large' : 'body-medium', children: label })), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-timezone-picker-input-wrapper", style: Object.assign({ width: inputWidth }, style), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ "aria-label": label, "aria-invalid": Boolean(errorToShow), "aria-describedby": errorToShow ? errorTextId : undefined, className: "ndl-timezone-picker-input", type: "text", ref: inputRef, value: inputValue, disabled: isDisabled, readOnly: isReadOnly, required: isRequired, onChange: handleInputChange, onKeyDown: handleKeyDown, onClick: (e) => {
244
245
  if (isReadOnly === true || isDisabled === true) {
245
246
  return;
246
247
  }
@@ -284,7 +285,7 @@ const TimeZonePicker = (_a) => {
284
285
  ? 'Select timezone'
285
286
  : mode === 'utc'
286
287
  ? 'Select or type UTC offset (e.g., UTC+5:30)'
287
- : 'Select timezone or type UTC offset' }, htmlAttributes, restProps)), (0, jsx_runtime_1.jsx)(outline_1.ChevronDownIcon, { className: "ndl-icon-svg ndl-timezone-picker-icon" })] })] }), errorToShow !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-timezone-picker-error-wrapper", children: [(0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, { className: "ndl-timezone-picker-error-icon" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-medium' : 'body-small', className: "ndl-timezone-picker-error-text", children: errorToShow })] }))] })), context.open && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: -1, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: refs.setFloating, className: (0, classnames_1.default)(themeClassName, 'ndl-timezone-picker-popover', Object.assign({}, classes)), style: Object.assign(Object.assign(Object.assign({}, transitionStyles), floatingStyles), { width: isFluid === true
288
+ : 'Select timezone or type UTC offset' }, htmlAttributes, restProps)), (0, jsx_runtime_1.jsx)(outline_1.ChevronDownIcon, { className: "ndl-icon-svg ndl-timezone-picker-icon" })] })] }), errorToShow !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-timezone-picker-error-wrapper", role: "status", children: [(0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, { className: "ndl-timezone-picker-error-icon" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: size === 'large' ? 'body-medium' : 'body-small', className: "ndl-timezone-picker-error-text", htmlAttributes: { id: errorTextId }, children: errorToShow })] }))] })), context.open && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: -1, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: refs.setFloating, className: (0, classnames_1.default)(themeClassName, 'ndl-timezone-picker-popover', Object.assign({}, classes)), style: Object.assign(Object.assign(Object.assign({}, transitionStyles), floatingStyles), { width: isFluid === true
288
289
  ? (_c = containerRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth
289
290
  : undefined }) }, getFloatingProps(), { children: (0, jsx_runtime_1.jsx)("ul", { ref: listRef, tabIndex: -1, children: mode === 'both' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [utcOptions.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("li", { className: "ndl-timezone-picker-section-header", children: "UTC Offsets" }), utcOptions.map((option, i) => ((0, jsx_runtime_1.jsx)("li", { role: "option", "aria-selected": value === option.value, value: option.value, onClick: (e) => {
290
291
  e.stopPropagation();