@neo4j-ndl/react 4.18.13 → 4.19.0

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 (234) hide show
  1. package/lib/LICENSES.txt +54 -0
  2. package/lib/NOTICE.txt +8 -0
  3. package/lib/cjs/_common/use-semi-controlled-state.js +6 -1
  4. package/lib/cjs/_common/use-semi-controlled-state.js.map +1 -1
  5. package/lib/cjs/combobox/Combobox.js +1031 -0
  6. package/lib/cjs/combobox/Combobox.js.map +1 -0
  7. package/lib/cjs/combobox/combobox-types.js +23 -0
  8. package/lib/cjs/combobox/combobox-types.js.map +1 -0
  9. package/lib/cjs/combobox/combobox-utils.js +129 -0
  10. package/lib/cjs/combobox/combobox-utils.js.map +1 -0
  11. package/lib/cjs/combobox/index.js +26 -0
  12. package/lib/cjs/combobox/index.js.map +1 -0
  13. package/lib/cjs/combobox/stories/combobox-action-on-select.story.js +82 -0
  14. package/lib/cjs/combobox/stories/combobox-action-on-select.story.js.map +1 -0
  15. package/lib/cjs/combobox/stories/combobox-actions.story.js +78 -0
  16. package/lib/cjs/combobox/stories/combobox-actions.story.js.map +1 -0
  17. package/lib/cjs/combobox/stories/combobox-async.story.js +75 -0
  18. package/lib/cjs/combobox/stories/combobox-async.story.js.map +1 -0
  19. package/lib/cjs/combobox/stories/combobox-clean.story.js +38 -0
  20. package/lib/cjs/combobox/stories/combobox-clean.story.js.map +1 -0
  21. package/lib/cjs/combobox/stories/combobox-creatable.story.js +41 -0
  22. package/lib/cjs/combobox/stories/combobox-creatable.story.js.map +1 -0
  23. package/lib/cjs/combobox/stories/combobox-custom-multi.story.js +45 -0
  24. package/lib/cjs/combobox/stories/combobox-custom-multi.story.js.map +1 -0
  25. package/lib/cjs/combobox/stories/combobox-custom-single.story.js +44 -0
  26. package/lib/cjs/combobox/stories/combobox-custom-single.story.js.map +1 -0
  27. package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js +60 -0
  28. package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
  29. package/lib/cjs/combobox/stories/combobox-default.story.js +42 -0
  30. package/lib/cjs/combobox/stories/combobox-default.story.js.map +1 -0
  31. package/lib/cjs/combobox/stories/combobox-descriptions.story.js +45 -0
  32. package/lib/cjs/combobox/stories/combobox-descriptions.story.js.map +1 -0
  33. package/lib/cjs/combobox/stories/combobox-disabled.story.js +34 -0
  34. package/lib/cjs/combobox/stories/combobox-disabled.story.js.map +1 -0
  35. package/lib/cjs/combobox/stories/combobox-fluid.story.js +34 -0
  36. package/lib/cjs/combobox/stories/combobox-fluid.story.js.map +1 -0
  37. package/lib/cjs/combobox/stories/combobox-groups.story.js +49 -0
  38. package/lib/cjs/combobox/stories/combobox-groups.story.js.map +1 -0
  39. package/lib/cjs/combobox/stories/combobox-hidden-label.story.js +33 -0
  40. package/lib/cjs/combobox/stories/combobox-hidden-label.story.js.map +1 -0
  41. package/lib/cjs/combobox/stories/combobox-icons.story.js +46 -0
  42. package/lib/cjs/combobox/stories/combobox-icons.story.js.map +1 -0
  43. package/lib/cjs/combobox/stories/combobox-in-dialog.story.js +40 -0
  44. package/lib/cjs/combobox/stories/combobox-in-dialog.story.js.map +1 -0
  45. package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js +40 -0
  46. package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
  47. package/lib/cjs/combobox/stories/combobox-in-popover.story.js +36 -0
  48. package/lib/cjs/combobox/stories/combobox-in-popover.story.js.map +1 -0
  49. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js +36 -0
  50. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js.map +1 -0
  51. package/lib/cjs/combobox/stories/combobox-max-rows.story.js +42 -0
  52. package/lib/cjs/combobox/stories/combobox-max-rows.story.js.map +1 -0
  53. package/lib/cjs/combobox/stories/combobox-multi.story.js +45 -0
  54. package/lib/cjs/combobox/stories/combobox-multi.story.js.map +1 -0
  55. package/lib/cjs/combobox/stories/combobox-native-form.story.js +49 -0
  56. package/lib/cjs/combobox/stories/combobox-native-form.story.js.map +1 -0
  57. package/lib/cjs/combobox/stories/combobox-select-only.story.js +38 -0
  58. package/lib/cjs/combobox/stories/combobox-select-only.story.js.map +1 -0
  59. package/lib/cjs/combobox/stories/combobox-sizes.story.js +33 -0
  60. package/lib/cjs/combobox/stories/combobox-sizes.story.js.map +1 -0
  61. package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js +42 -0
  62. package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
  63. package/lib/cjs/combobox/stories/combobox-validation.story.js +33 -0
  64. package/lib/cjs/combobox/stories/combobox-validation.story.js.map +1 -0
  65. package/lib/cjs/combobox/stories/index.js +133 -0
  66. package/lib/cjs/combobox/stories/index.js.map +1 -0
  67. package/lib/cjs/combobox/use-combobox-multi-value-overflow.js +173 -0
  68. package/lib/cjs/combobox/use-combobox-multi-value-overflow.js.map +1 -0
  69. package/lib/cjs/combobox/use-combobox-popover.js +80 -0
  70. package/lib/cjs/combobox/use-combobox-popover.js.map +1 -0
  71. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  72. package/lib/cjs/dismissible-tag/DismissibleTag.js +1 -1
  73. package/lib/cjs/dismissible-tag/DismissibleTag.js.map +1 -1
  74. package/lib/cjs/index.js +1 -0
  75. package/lib/cjs/index.js.map +1 -1
  76. package/lib/cjs/select/Select.js +3 -0
  77. package/lib/cjs/select/Select.js.map +1 -1
  78. package/lib/cjs/text-area/TextArea.js.map +1 -1
  79. package/lib/cjs/text-input/TextInput.js.map +1 -1
  80. package/lib/esm/_common/use-semi-controlled-state.js +6 -1
  81. package/lib/esm/_common/use-semi-controlled-state.js.map +1 -1
  82. package/lib/esm/combobox/Combobox.js +1024 -0
  83. package/lib/esm/combobox/Combobox.js.map +1 -0
  84. package/lib/esm/combobox/combobox-types.js +22 -0
  85. package/lib/esm/combobox/combobox-types.js.map +1 -0
  86. package/lib/esm/combobox/combobox-utils.js +112 -0
  87. package/lib/esm/combobox/combobox-utils.js.map +1 -0
  88. package/lib/esm/combobox/index.js +22 -0
  89. package/lib/esm/combobox/index.js.map +1 -0
  90. package/lib/esm/combobox/stories/combobox-action-on-select.story.js +80 -0
  91. package/lib/esm/combobox/stories/combobox-action-on-select.story.js.map +1 -0
  92. package/lib/esm/combobox/stories/combobox-actions.story.js +76 -0
  93. package/lib/esm/combobox/stories/combobox-actions.story.js.map +1 -0
  94. package/lib/esm/combobox/stories/combobox-async.story.js +73 -0
  95. package/lib/esm/combobox/stories/combobox-async.story.js.map +1 -0
  96. package/lib/esm/combobox/stories/combobox-clean.story.js +36 -0
  97. package/lib/esm/combobox/stories/combobox-clean.story.js.map +1 -0
  98. package/lib/esm/combobox/stories/combobox-creatable.story.js +39 -0
  99. package/lib/esm/combobox/stories/combobox-creatable.story.js.map +1 -0
  100. package/lib/esm/combobox/stories/combobox-custom-multi.story.js +43 -0
  101. package/lib/esm/combobox/stories/combobox-custom-multi.story.js.map +1 -0
  102. package/lib/esm/combobox/stories/combobox-custom-single.story.js +42 -0
  103. package/lib/esm/combobox/stories/combobox-custom-single.story.js.map +1 -0
  104. package/lib/esm/combobox/stories/combobox-custom-trigger.story.js +58 -0
  105. package/lib/esm/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
  106. package/lib/esm/combobox/stories/combobox-default.story.js +40 -0
  107. package/lib/esm/combobox/stories/combobox-default.story.js.map +1 -0
  108. package/lib/esm/combobox/stories/combobox-descriptions.story.js +43 -0
  109. package/lib/esm/combobox/stories/combobox-descriptions.story.js.map +1 -0
  110. package/lib/esm/combobox/stories/combobox-disabled.story.js +32 -0
  111. package/lib/esm/combobox/stories/combobox-disabled.story.js.map +1 -0
  112. package/lib/esm/combobox/stories/combobox-fluid.story.js +32 -0
  113. package/lib/esm/combobox/stories/combobox-fluid.story.js.map +1 -0
  114. package/lib/esm/combobox/stories/combobox-groups.story.js +47 -0
  115. package/lib/esm/combobox/stories/combobox-groups.story.js.map +1 -0
  116. package/lib/esm/combobox/stories/combobox-hidden-label.story.js +31 -0
  117. package/lib/esm/combobox/stories/combobox-hidden-label.story.js.map +1 -0
  118. package/lib/esm/combobox/stories/combobox-icons.story.js +44 -0
  119. package/lib/esm/combobox/stories/combobox-icons.story.js.map +1 -0
  120. package/lib/esm/combobox/stories/combobox-in-dialog.story.js +38 -0
  121. package/lib/esm/combobox/stories/combobox-in-dialog.story.js.map +1 -0
  122. package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js +38 -0
  123. package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
  124. package/lib/esm/combobox/stories/combobox-in-popover.story.js +34 -0
  125. package/lib/esm/combobox/stories/combobox-in-popover.story.js.map +1 -0
  126. package/lib/esm/combobox/stories/combobox-large-data-set.story.js +34 -0
  127. package/lib/esm/combobox/stories/combobox-large-data-set.story.js.map +1 -0
  128. package/lib/esm/combobox/stories/combobox-max-rows.story.js +40 -0
  129. package/lib/esm/combobox/stories/combobox-max-rows.story.js.map +1 -0
  130. package/lib/esm/combobox/stories/combobox-multi.story.js +43 -0
  131. package/lib/esm/combobox/stories/combobox-multi.story.js.map +1 -0
  132. package/lib/esm/combobox/stories/combobox-native-form.story.js +47 -0
  133. package/lib/esm/combobox/stories/combobox-native-form.story.js.map +1 -0
  134. package/lib/esm/combobox/stories/combobox-select-only.story.js +36 -0
  135. package/lib/esm/combobox/stories/combobox-select-only.story.js.map +1 -0
  136. package/lib/esm/combobox/stories/combobox-sizes.story.js +31 -0
  137. package/lib/esm/combobox/stories/combobox-sizes.story.js.map +1 -0
  138. package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js +40 -0
  139. package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
  140. package/lib/esm/combobox/stories/combobox-validation.story.js +31 -0
  141. package/lib/esm/combobox/stories/combobox-validation.story.js.map +1 -0
  142. package/lib/esm/combobox/stories/index.js +100 -0
  143. package/lib/esm/combobox/stories/index.js.map +1 -0
  144. package/lib/esm/combobox/use-combobox-multi-value-overflow.js +166 -0
  145. package/lib/esm/combobox/use-combobox-multi-value-overflow.js.map +1 -0
  146. package/lib/esm/combobox/use-combobox-popover.js +77 -0
  147. package/lib/esm/combobox/use-combobox-popover.js.map +1 -0
  148. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  149. package/lib/esm/dismissible-tag/DismissibleTag.js +1 -1
  150. package/lib/esm/dismissible-tag/DismissibleTag.js.map +1 -1
  151. package/lib/esm/index.js +1 -0
  152. package/lib/esm/index.js.map +1 -1
  153. package/lib/esm/select/Select.js +3 -0
  154. package/lib/esm/select/Select.js.map +1 -1
  155. package/lib/esm/text-area/TextArea.js.map +1 -1
  156. package/lib/esm/text-input/TextInput.js.map +1 -1
  157. package/lib/types/_common/use-semi-controlled-state.d.ts +5 -1
  158. package/lib/types/_common/use-semi-controlled-state.d.ts.map +1 -1
  159. package/lib/types/combobox/Combobox.d.ts +24 -0
  160. package/lib/types/combobox/Combobox.d.ts.map +1 -0
  161. package/lib/types/combobox/combobox-types.d.ts +419 -0
  162. package/lib/types/combobox/combobox-types.d.ts.map +1 -0
  163. package/lib/types/combobox/combobox-utils.d.ts +81 -0
  164. package/lib/types/combobox/combobox-utils.d.ts.map +1 -0
  165. package/lib/types/combobox/index.d.ts +23 -0
  166. package/lib/types/combobox/index.d.ts.map +1 -0
  167. package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts +24 -0
  168. package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts.map +1 -0
  169. package/lib/types/combobox/stories/combobox-actions.story.d.ts +24 -0
  170. package/lib/types/combobox/stories/combobox-actions.story.d.ts.map +1 -0
  171. package/lib/types/combobox/stories/combobox-async.story.d.ts +24 -0
  172. package/lib/types/combobox/stories/combobox-async.story.d.ts.map +1 -0
  173. package/lib/types/combobox/stories/combobox-clean.story.d.ts +24 -0
  174. package/lib/types/combobox/stories/combobox-clean.story.d.ts.map +1 -0
  175. package/lib/types/combobox/stories/combobox-creatable.story.d.ts +24 -0
  176. package/lib/types/combobox/stories/combobox-creatable.story.d.ts.map +1 -0
  177. package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts +24 -0
  178. package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts.map +1 -0
  179. package/lib/types/combobox/stories/combobox-custom-single.story.d.ts +24 -0
  180. package/lib/types/combobox/stories/combobox-custom-single.story.d.ts.map +1 -0
  181. package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts +24 -0
  182. package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts.map +1 -0
  183. package/lib/types/combobox/stories/combobox-default.story.d.ts +24 -0
  184. package/lib/types/combobox/stories/combobox-default.story.d.ts.map +1 -0
  185. package/lib/types/combobox/stories/combobox-descriptions.story.d.ts +24 -0
  186. package/lib/types/combobox/stories/combobox-descriptions.story.d.ts.map +1 -0
  187. package/lib/types/combobox/stories/combobox-disabled.story.d.ts +24 -0
  188. package/lib/types/combobox/stories/combobox-disabled.story.d.ts.map +1 -0
  189. package/lib/types/combobox/stories/combobox-fluid.story.d.ts +24 -0
  190. package/lib/types/combobox/stories/combobox-fluid.story.d.ts.map +1 -0
  191. package/lib/types/combobox/stories/combobox-groups.story.d.ts +24 -0
  192. package/lib/types/combobox/stories/combobox-groups.story.d.ts.map +1 -0
  193. package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts +24 -0
  194. package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts.map +1 -0
  195. package/lib/types/combobox/stories/combobox-icons.story.d.ts +24 -0
  196. package/lib/types/combobox/stories/combobox-icons.story.d.ts.map +1 -0
  197. package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts +24 -0
  198. package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts.map +1 -0
  199. package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts +24 -0
  200. package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts.map +1 -0
  201. package/lib/types/combobox/stories/combobox-in-popover.story.d.ts +24 -0
  202. package/lib/types/combobox/stories/combobox-in-popover.story.d.ts.map +1 -0
  203. package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts +24 -0
  204. package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts.map +1 -0
  205. package/lib/types/combobox/stories/combobox-max-rows.story.d.ts +24 -0
  206. package/lib/types/combobox/stories/combobox-max-rows.story.d.ts.map +1 -0
  207. package/lib/types/combobox/stories/combobox-multi.story.d.ts +24 -0
  208. package/lib/types/combobox/stories/combobox-multi.story.d.ts.map +1 -0
  209. package/lib/types/combobox/stories/combobox-native-form.story.d.ts +24 -0
  210. package/lib/types/combobox/stories/combobox-native-form.story.d.ts.map +1 -0
  211. package/lib/types/combobox/stories/combobox-select-only.story.d.ts +24 -0
  212. package/lib/types/combobox/stories/combobox-select-only.story.d.ts.map +1 -0
  213. package/lib/types/combobox/stories/combobox-sizes.story.d.ts +24 -0
  214. package/lib/types/combobox/stories/combobox-sizes.story.d.ts.map +1 -0
  215. package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts +24 -0
  216. package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts.map +1 -0
  217. package/lib/types/combobox/stories/combobox-validation.story.d.ts +24 -0
  218. package/lib/types/combobox/stories/combobox-validation.story.d.ts.map +1 -0
  219. package/lib/types/combobox/stories/index.d.ts +73 -0
  220. package/lib/types/combobox/stories/index.d.ts.map +1 -0
  221. package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts +76 -0
  222. package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts.map +1 -0
  223. package/lib/types/combobox/use-combobox-popover.d.ts +66 -0
  224. package/lib/types/combobox/use-combobox-popover.d.ts.map +1 -0
  225. package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
  226. package/lib/types/dismissible-tag/DismissibleTag.d.ts.map +1 -1
  227. package/lib/types/index.d.ts +1 -0
  228. package/lib/types/index.d.ts.map +1 -1
  229. package/lib/types/select/Select.d.ts +3 -0
  230. package/lib/types/select/Select.d.ts.map +1 -1
  231. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  232. package/package.json +10 -4
  233. package/skills/ndl-react/SKILL.md +20 -0
  234. package/skills/ndl-react/components/combobox.md +1487 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-select-only.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-select-only.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA4C;AAE5C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG;QACd,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;KACvD,CAAC;IAEF,yEAAyE;IACzE,wDAAwD;IACxD,OAAO,uBAAC,gBAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AAC9E,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 { Combobox } from '@neo4j-ndl/react';\n\nconst Component = () => {\n const options = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n { isDisabled: true, label: 'Cypher', value: 'cypher' },\n ];\n\n // A list this short has nothing to filter, so the search input is turned\n // off and the combobox follows the select-only pattern.\n return <Combobox label=\"Products\" isSearchable={false} options={options} />;\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,33 @@
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 options = [
27
+ { label: 'Neo4j', value: 'neo4j' },
28
+ { label: 'Aura', value: 'aura' },
29
+ { label: 'Bloom', value: 'bloom' },
30
+ ];
31
+ const Component = () => ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-flex-col n-gap-token-16", children: ['small', 'medium', 'large'].map((size) => ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "n-capitalize", children: size }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-wrap n-items-start n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.Combobox, { label: `${size} single-select`, defaultValue: options[0], options: options, size: size }), (0, jsx_runtime_1.jsx)(react_1.Combobox, { label: `${size} multi-select`, defaultValue: options.slice(0, 2), isMulti: true, options: options, size: size })] })] }, size))) }));
32
+ exports.default = Component;
33
+ //# sourceMappingURL=combobox-sizes.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-sizes.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA4C;AAE5C,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CACtB,gCAAK,SAAS,EAAC,kCAAkC,YAC7C,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrD,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,8BAAG,SAAS,EAAC,cAAc,YAAE,IAAI,GAAK,EACtC,iCAAK,SAAS,EAAC,iDAAiD,aAC9D,uBAAC,gBAAQ,IACP,KAAK,EAAE,GAAG,IAAI,gBAAgB,EAC9B,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,EACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACV,EACF,uBAAC,gBAAQ,IACP,KAAK,EAAE,GAAG,IAAI,eAAe,EAC7B,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACjC,OAAO,QACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACV,IACE,KAhB8C,IAAI,CAiBpD,CACP,CAAC,GACE,CACP,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 { Combobox } from '@neo4j-ndl/react';\n\nconst options = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n];\n\nconst Component = () => (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n {(['small', 'medium', 'large'] as const).map((size) => (\n <div className=\"n-flex n-flex-col n-gap-token-4\" key={size}>\n <p className=\"n-capitalize\">{size}</p>\n <div className=\"n-flex n-flex-wrap n-items-start n-gap-token-16\">\n <Combobox\n label={`${size} single-select`}\n defaultValue={options[0]}\n options={options}\n size={size}\n />\n <Combobox\n label={`${size} multi-select`}\n defaultValue={options.slice(0, 2)}\n isMulti\n options={options}\n size={size}\n />\n </div>\n </div>\n ))}\n </div>\n);\n\nexport default Component;\n"]}
@@ -0,0 +1,42 @@
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 options = [
29
+ { label: 'Neo4j', value: 'neo4j' },
30
+ { label: 'Aura', value: 'aura' },
31
+ { label: 'Bloom', value: 'bloom' },
32
+ { label: 'Data Importer', value: 'data-importer' },
33
+ { label: 'GraphQL Library', value: 'graphql-library' },
34
+ { label: 'Cypher', value: 'cypher' },
35
+ { label: 'Operations Manager', value: 'operations-manager' },
36
+ { label: 'Graph Data Science', value: 'graph-data-science' },
37
+ ];
38
+ const [value, setValue] = (0, react_2.useState)(options);
39
+ return ((0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Products", isClearable: true, isMulti: true, maxRows: null, options: options, value: value, onChange: (nextValue) => setValue(nextValue), helpText: "Set maxRows to null to let the control grow with the selection." }));
40
+ };
41
+ exports.default = Component;
42
+ //# sourceMappingURL=combobox-unlimited-rows.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-unlimited-rows.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-unlimited-rows.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA4C;AAC5C,iCAAiC;AAOjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAa;QACxB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;QAClD,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;QACtD,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;QACpC,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,EAAE;QAC5D,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,EAAE;KAC7D,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,CAAC;IAE5C,OAAO,CACL,uBAAC,gBAAQ,IACP,KAAK,EAAC,UAAU,EAChB,WAAW,QACX,OAAO,QACP,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC5C,QAAQ,EAAC,iEAAiE,GAC1E,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 { Combobox } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype Option = {\n label: string;\n value: string;\n};\n\nconst Component = () => {\n const options: Option[] = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n { label: 'Data Importer', value: 'data-importer' },\n { label: 'GraphQL Library', value: 'graphql-library' },\n { label: 'Cypher', value: 'cypher' },\n { label: 'Operations Manager', value: 'operations-manager' },\n { label: 'Graph Data Science', value: 'graph-data-science' },\n ];\n const [value, setValue] = useState(options);\n\n return (\n <Combobox\n label=\"Products\"\n isClearable\n isMulti\n maxRows={null}\n options={options}\n value={value}\n onChange={(nextValue) => setValue(nextValue)}\n helpText=\"Set maxRows to null to let the control grow with the selection.\"\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,33 @@
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 options = [
27
+ { label: 'Neo4j', value: 'neo4j' },
28
+ { label: 'Aura', value: 'aura' },
29
+ { label: 'Bloom', value: 'bloom' },
30
+ ];
31
+ const Component = () => ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Product", helpText: "Pick the product the ticket is about.", isRequired: true, hasRequiredIndicator: true, options: options }), (0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Product", errorText: "Select a product to continue.", isRequired: true, hasRequiredIndicator: true, options: options }), (0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Environment", helpText: "Leave empty to include every environment.", hasRequiredIndicator: true, options: options })] }));
32
+ exports.default = Component;
33
+ //# sourceMappingURL=combobox-validation.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-validation.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-validation.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA4C;AAE5C,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CACtB,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,gBAAQ,IACP,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,uCAAuC,EAChD,UAAU,QACV,oBAAoB,QACpB,OAAO,EAAE,OAAO,GAChB,EACF,uBAAC,gBAAQ,IACP,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,+BAA+B,EACzC,UAAU,QACV,oBAAoB,QACpB,OAAO,EAAE,OAAO,GAChB,EACF,uBAAC,gBAAQ,IACP,KAAK,EAAC,aAAa,EACnB,QAAQ,EAAC,2CAA2C,EACpD,oBAAoB,QACpB,OAAO,EAAE,OAAO,GAChB,IACE,CACP,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 { Combobox } from '@neo4j-ndl/react';\n\nconst options = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n];\n\nconst Component = () => (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <Combobox\n label=\"Product\"\n helpText=\"Pick the product the ticket is about.\"\n isRequired\n hasRequiredIndicator\n options={options}\n />\n <Combobox\n label=\"Product\"\n errorText=\"Select a product to continue.\"\n isRequired\n hasRequiredIndicator\n options={options}\n />\n <Combobox\n label=\"Environment\"\n helpText=\"Leave empty to include every environment.\"\n hasRequiredIndicator\n options={options}\n />\n </div>\n);\n\nexport default Component;\n"]}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ComboboxCustomMultiSource = exports.ComboboxCustomTriggerSource = exports.ComboboxUnlimitedRowsSource = exports.ComboboxSizesSource = exports.ComboboxSelectOnlySource = exports.ComboboxNativeFormSource = exports.ComboboxMultiSource = exports.ComboboxMaxRowsSource = exports.ComboboxLargeDataSetSource = exports.ComboboxInPopoverDialogSource = exports.ComboboxInPopoverSource = exports.ComboboxInDialogSource = exports.ComboboxIconsSource = exports.ComboboxHiddenLabelSource = exports.ComboboxGroupsSource = exports.ComboboxFluidSource = exports.ComboboxDisabledSource = exports.ComboboxDescriptionsSource = exports.ComboboxDefaultSource = exports.ComboboxCreatableSource = exports.ComboboxActionOnSelectSource = exports.ComboboxCleanSource = exports.ComboboxAsyncSource = exports.ComboboxActionsSource = exports.ComboboxValidation = exports.ComboboxUnlimitedRows = exports.ComboboxSizes = exports.ComboboxSelectOnly = exports.ComboboxNativeForm = exports.ComboboxMulti = exports.ComboboxMaxRows = exports.ComboboxLargeDataSet = exports.ComboboxInPopoverDialog = exports.ComboboxInPopover = exports.ComboboxInDialog = exports.ComboboxIcons = exports.ComboboxHiddenLabel = exports.ComboboxGroups = exports.ComboboxFluid = exports.ComboboxDisabled = exports.ComboboxDescriptions = exports.ComboboxDefault = exports.ComboboxCustomTrigger = exports.ComboboxCustomSingle = exports.ComboboxCustomMulti = exports.ComboboxCreatable = exports.ComboboxActionOnSelect = exports.ComboboxClean = exports.ComboboxAsync = exports.ComboboxActions = void 0;
27
+ exports.ComboboxValidationSource = exports.ComboboxCustomSingleSource = void 0;
28
+ var combobox_actions_story_1 = require("./combobox-actions.story");
29
+ Object.defineProperty(exports, "ComboboxActions", { enumerable: true, get: function () { return __importDefault(combobox_actions_story_1).default; } });
30
+ var combobox_async_story_1 = require("./combobox-async.story");
31
+ Object.defineProperty(exports, "ComboboxAsync", { enumerable: true, get: function () { return __importDefault(combobox_async_story_1).default; } });
32
+ var combobox_clean_story_1 = require("./combobox-clean.story");
33
+ Object.defineProperty(exports, "ComboboxClean", { enumerable: true, get: function () { return __importDefault(combobox_clean_story_1).default; } });
34
+ var combobox_action_on_select_story_1 = require("./combobox-action-on-select.story");
35
+ Object.defineProperty(exports, "ComboboxActionOnSelect", { enumerable: true, get: function () { return __importDefault(combobox_action_on_select_story_1).default; } });
36
+ var combobox_creatable_story_1 = require("./combobox-creatable.story");
37
+ Object.defineProperty(exports, "ComboboxCreatable", { enumerable: true, get: function () { return __importDefault(combobox_creatable_story_1).default; } });
38
+ var combobox_custom_multi_story_1 = require("./combobox-custom-multi.story");
39
+ Object.defineProperty(exports, "ComboboxCustomMulti", { enumerable: true, get: function () { return __importDefault(combobox_custom_multi_story_1).default; } });
40
+ var combobox_custom_single_story_1 = require("./combobox-custom-single.story");
41
+ Object.defineProperty(exports, "ComboboxCustomSingle", { enumerable: true, get: function () { return __importDefault(combobox_custom_single_story_1).default; } });
42
+ var combobox_custom_trigger_story_1 = require("./combobox-custom-trigger.story");
43
+ Object.defineProperty(exports, "ComboboxCustomTrigger", { enumerable: true, get: function () { return __importDefault(combobox_custom_trigger_story_1).default; } });
44
+ var combobox_default_story_1 = require("./combobox-default.story");
45
+ Object.defineProperty(exports, "ComboboxDefault", { enumerable: true, get: function () { return __importDefault(combobox_default_story_1).default; } });
46
+ var combobox_descriptions_story_1 = require("./combobox-descriptions.story");
47
+ Object.defineProperty(exports, "ComboboxDescriptions", { enumerable: true, get: function () { return __importDefault(combobox_descriptions_story_1).default; } });
48
+ var combobox_disabled_story_1 = require("./combobox-disabled.story");
49
+ Object.defineProperty(exports, "ComboboxDisabled", { enumerable: true, get: function () { return __importDefault(combobox_disabled_story_1).default; } });
50
+ var combobox_fluid_story_1 = require("./combobox-fluid.story");
51
+ Object.defineProperty(exports, "ComboboxFluid", { enumerable: true, get: function () { return __importDefault(combobox_fluid_story_1).default; } });
52
+ var combobox_groups_story_1 = require("./combobox-groups.story");
53
+ Object.defineProperty(exports, "ComboboxGroups", { enumerable: true, get: function () { return __importDefault(combobox_groups_story_1).default; } });
54
+ var combobox_hidden_label_story_1 = require("./combobox-hidden-label.story");
55
+ Object.defineProperty(exports, "ComboboxHiddenLabel", { enumerable: true, get: function () { return __importDefault(combobox_hidden_label_story_1).default; } });
56
+ var combobox_icons_story_1 = require("./combobox-icons.story");
57
+ Object.defineProperty(exports, "ComboboxIcons", { enumerable: true, get: function () { return __importDefault(combobox_icons_story_1).default; } });
58
+ var combobox_in_dialog_story_1 = require("./combobox-in-dialog.story");
59
+ Object.defineProperty(exports, "ComboboxInDialog", { enumerable: true, get: function () { return __importDefault(combobox_in_dialog_story_1).default; } });
60
+ var combobox_in_popover_story_1 = require("./combobox-in-popover.story");
61
+ Object.defineProperty(exports, "ComboboxInPopover", { enumerable: true, get: function () { return __importDefault(combobox_in_popover_story_1).default; } });
62
+ var combobox_in_popover_dialog_story_1 = require("./combobox-in-popover-dialog.story");
63
+ Object.defineProperty(exports, "ComboboxInPopoverDialog", { enumerable: true, get: function () { return __importDefault(combobox_in_popover_dialog_story_1).default; } });
64
+ var combobox_large_data_set_story_1 = require("./combobox-large-data-set.story");
65
+ Object.defineProperty(exports, "ComboboxLargeDataSet", { enumerable: true, get: function () { return __importDefault(combobox_large_data_set_story_1).default; } });
66
+ var combobox_max_rows_story_1 = require("./combobox-max-rows.story");
67
+ Object.defineProperty(exports, "ComboboxMaxRows", { enumerable: true, get: function () { return __importDefault(combobox_max_rows_story_1).default; } });
68
+ var combobox_multi_story_1 = require("./combobox-multi.story");
69
+ Object.defineProperty(exports, "ComboboxMulti", { enumerable: true, get: function () { return __importDefault(combobox_multi_story_1).default; } });
70
+ var combobox_native_form_story_1 = require("./combobox-native-form.story");
71
+ Object.defineProperty(exports, "ComboboxNativeForm", { enumerable: true, get: function () { return __importDefault(combobox_native_form_story_1).default; } });
72
+ var combobox_select_only_story_1 = require("./combobox-select-only.story");
73
+ Object.defineProperty(exports, "ComboboxSelectOnly", { enumerable: true, get: function () { return __importDefault(combobox_select_only_story_1).default; } });
74
+ var combobox_sizes_story_1 = require("./combobox-sizes.story");
75
+ Object.defineProperty(exports, "ComboboxSizes", { enumerable: true, get: function () { return __importDefault(combobox_sizes_story_1).default; } });
76
+ var combobox_unlimited_rows_story_1 = require("./combobox-unlimited-rows.story");
77
+ Object.defineProperty(exports, "ComboboxUnlimitedRows", { enumerable: true, get: function () { return __importDefault(combobox_unlimited_rows_story_1).default; } });
78
+ var combobox_validation_story_1 = require("./combobox-validation.story");
79
+ Object.defineProperty(exports, "ComboboxValidation", { enumerable: true, get: function () { return __importDefault(combobox_validation_story_1).default; } });
80
+ const export_stories_utils_1 = require("../../_common/export-stories-utils");
81
+ const combobox_action_on_select_story_tsx_raw_1 = __importDefault(require("./combobox-action-on-select.story.tsx?raw"));
82
+ const combobox_actions_story_tsx_raw_1 = __importDefault(require("./combobox-actions.story.tsx?raw"));
83
+ const combobox_async_story_tsx_raw_1 = __importDefault(require("./combobox-async.story.tsx?raw"));
84
+ const combobox_clean_story_tsx_raw_1 = __importDefault(require("./combobox-clean.story.tsx?raw"));
85
+ const combobox_creatable_story_tsx_raw_1 = __importDefault(require("./combobox-creatable.story.tsx?raw"));
86
+ const combobox_custom_multi_story_tsx_raw_1 = __importDefault(require("./combobox-custom-multi.story.tsx?raw"));
87
+ const combobox_custom_single_story_tsx_raw_1 = __importDefault(require("./combobox-custom-single.story.tsx?raw"));
88
+ const combobox_custom_trigger_story_tsx_raw_1 = __importDefault(require("./combobox-custom-trigger.story.tsx?raw"));
89
+ const combobox_default_story_tsx_raw_1 = __importDefault(require("./combobox-default.story.tsx?raw"));
90
+ const combobox_descriptions_story_tsx_raw_1 = __importDefault(require("./combobox-descriptions.story.tsx?raw"));
91
+ const combobox_disabled_story_tsx_raw_1 = __importDefault(require("./combobox-disabled.story.tsx?raw"));
92
+ const combobox_fluid_story_tsx_raw_1 = __importDefault(require("./combobox-fluid.story.tsx?raw"));
93
+ const combobox_groups_story_tsx_raw_1 = __importDefault(require("./combobox-groups.story.tsx?raw"));
94
+ const combobox_hidden_label_story_tsx_raw_1 = __importDefault(require("./combobox-hidden-label.story.tsx?raw"));
95
+ const combobox_icons_story_tsx_raw_1 = __importDefault(require("./combobox-icons.story.tsx?raw"));
96
+ const combobox_in_dialog_story_tsx_raw_1 = __importDefault(require("./combobox-in-dialog.story.tsx?raw"));
97
+ const combobox_in_popover_story_tsx_raw_1 = __importDefault(require("./combobox-in-popover.story.tsx?raw"));
98
+ const combobox_in_popover_dialog_story_tsx_raw_1 = __importDefault(require("./combobox-in-popover-dialog.story.tsx?raw"));
99
+ const combobox_large_data_set_story_tsx_raw_1 = __importDefault(require("./combobox-large-data-set.story.tsx?raw"));
100
+ const combobox_max_rows_story_tsx_raw_1 = __importDefault(require("./combobox-max-rows.story.tsx?raw"));
101
+ const combobox_multi_story_tsx_raw_1 = __importDefault(require("./combobox-multi.story.tsx?raw"));
102
+ const combobox_native_form_story_tsx_raw_1 = __importDefault(require("./combobox-native-form.story.tsx?raw"));
103
+ const combobox_select_only_story_tsx_raw_1 = __importDefault(require("./combobox-select-only.story.tsx?raw"));
104
+ const combobox_sizes_story_tsx_raw_1 = __importDefault(require("./combobox-sizes.story.tsx?raw"));
105
+ const combobox_unlimited_rows_story_tsx_raw_1 = __importDefault(require("./combobox-unlimited-rows.story.tsx?raw"));
106
+ const combobox_validation_story_tsx_raw_1 = __importDefault(require("./combobox-validation.story.tsx?raw"));
107
+ exports.ComboboxActionsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_actions_story_tsx_raw_1.default);
108
+ exports.ComboboxAsyncSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_async_story_tsx_raw_1.default);
109
+ exports.ComboboxCleanSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_clean_story_tsx_raw_1.default);
110
+ exports.ComboboxActionOnSelectSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_action_on_select_story_tsx_raw_1.default);
111
+ exports.ComboboxCreatableSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_creatable_story_tsx_raw_1.default);
112
+ exports.ComboboxDefaultSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_default_story_tsx_raw_1.default);
113
+ exports.ComboboxDescriptionsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_descriptions_story_tsx_raw_1.default);
114
+ exports.ComboboxDisabledSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_disabled_story_tsx_raw_1.default);
115
+ exports.ComboboxFluidSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_fluid_story_tsx_raw_1.default);
116
+ exports.ComboboxGroupsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_groups_story_tsx_raw_1.default);
117
+ exports.ComboboxHiddenLabelSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_hidden_label_story_tsx_raw_1.default);
118
+ exports.ComboboxIconsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_icons_story_tsx_raw_1.default);
119
+ exports.ComboboxInDialogSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_in_dialog_story_tsx_raw_1.default);
120
+ exports.ComboboxInPopoverSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_in_popover_story_tsx_raw_1.default);
121
+ exports.ComboboxInPopoverDialogSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_in_popover_dialog_story_tsx_raw_1.default);
122
+ exports.ComboboxLargeDataSetSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_large_data_set_story_tsx_raw_1.default);
123
+ exports.ComboboxMaxRowsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_max_rows_story_tsx_raw_1.default);
124
+ exports.ComboboxMultiSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_multi_story_tsx_raw_1.default);
125
+ exports.ComboboxNativeFormSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_native_form_story_tsx_raw_1.default);
126
+ exports.ComboboxSelectOnlySource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_select_only_story_tsx_raw_1.default);
127
+ exports.ComboboxSizesSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_sizes_story_tsx_raw_1.default);
128
+ exports.ComboboxUnlimitedRowsSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_unlimited_rows_story_tsx_raw_1.default);
129
+ exports.ComboboxCustomTriggerSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_custom_trigger_story_tsx_raw_1.default);
130
+ exports.ComboboxCustomMultiSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_custom_multi_story_tsx_raw_1.default);
131
+ exports.ComboboxCustomSingleSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_custom_single_story_tsx_raw_1.default);
132
+ exports.ComboboxValidationSource = (0, export_stories_utils_1.removeLicenseHeader)(combobox_validation_story_tsx_raw_1.default);
133
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/combobox/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;AAEH,mEAAsE;AAA7D,0IAAA,OAAO,OAAmB;AACnC,+DAAkE;AAAzD,sIAAA,OAAO,OAAiB;AACjC,+DAAkE;AAAzD,sIAAA,OAAO,OAAiB;AACjC,qFAAsF;AAA7E,0JAAA,OAAO,OAA0B;AAC1C,uEAA0E;AAAjE,8IAAA,OAAO,OAAqB;AACrC,6EAA+E;AAAtE,mJAAA,OAAO,OAAuB;AACvC,+EAAiF;AAAxE,qJAAA,OAAO,OAA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CAAmB,EACzD,4CAA2B,CAC5B,CAAC;AAEW,QAAA,wBAAwB,GAAG,IAAA,0CAAmB,EACzD,4CAA2B,CAC5B,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,0CAAmB,EAAC,sCAAsB,CAAC,CAAC;AAElE,QAAA,2BAA2B,GAAG,IAAA,0CAAmB,EAC5D,+CAA8B,CAC/B,CAAC;AAEW,QAAA,2BAA2B,GAAG,IAAA,0CAAmB,EAC5D,+CAA8B,CAC/B,CAAC;AAEW,QAAA,yBAAyB,GAAG,IAAA,0CAAmB,EAC1D,6CAA4B,CAC7B,CAAC;AAEW,QAAA,0BAA0B,GAAG,IAAA,0CAAmB,EAC3D,8CAA6B,CAC9B,CAAC;AAEW,QAAA,wBAAwB,GAAG,IAAA,0CAAmB,EACzD,2CAA2B,CAC5B,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 ComboboxActions } from './combobox-actions.story';\nexport { default as ComboboxAsync } from './combobox-async.story';\nexport { default as ComboboxClean } from './combobox-clean.story';\nexport { default as ComboboxActionOnSelect } from './combobox-action-on-select.story';\nexport { default as ComboboxCreatable } from './combobox-creatable.story';\nexport { default as ComboboxCustomMulti } from './combobox-custom-multi.story';\nexport { default as ComboboxCustomSingle } from './combobox-custom-single.story';\nexport { default as ComboboxCustomTrigger } from './combobox-custom-trigger.story';\nexport { default as ComboboxDefault } from './combobox-default.story';\nexport { default as ComboboxDescriptions } from './combobox-descriptions.story';\nexport { default as ComboboxDisabled } from './combobox-disabled.story';\nexport { default as ComboboxFluid } from './combobox-fluid.story';\nexport { default as ComboboxGroups } from './combobox-groups.story';\nexport { default as ComboboxHiddenLabel } from './combobox-hidden-label.story';\nexport { default as ComboboxIcons } from './combobox-icons.story';\nexport { default as ComboboxInDialog } from './combobox-in-dialog.story';\nexport { default as ComboboxInPopover } from './combobox-in-popover.story';\nexport { default as ComboboxInPopoverDialog } from './combobox-in-popover-dialog.story';\nexport { default as ComboboxLargeDataSet } from './combobox-large-data-set.story';\nexport { default as ComboboxMaxRows } from './combobox-max-rows.story';\nexport { default as ComboboxMulti } from './combobox-multi.story';\nexport { default as ComboboxNativeForm } from './combobox-native-form.story';\nexport { default as ComboboxSelectOnly } from './combobox-select-only.story';\nexport { default as ComboboxSizes } from './combobox-sizes.story';\nexport { default as ComboboxUnlimitedRows } from './combobox-unlimited-rows.story';\nexport { default as ComboboxValidation } from './combobox-validation.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport ComboboxActionOnSelectSourceRaw from './combobox-action-on-select.story.tsx?raw';\nimport ComboboxActionsSourceRaw from './combobox-actions.story.tsx?raw';\nimport ComboboxAsyncSourceRaw from './combobox-async.story.tsx?raw';\nimport ComboboxCleanSourceRaw from './combobox-clean.story.tsx?raw';\nimport ComboboxCreatableSourceRaw from './combobox-creatable.story.tsx?raw';\nimport ComboboxCustomMultiSourceRaw from './combobox-custom-multi.story.tsx?raw';\nimport ComboboxCustomSingleSourceRaw from './combobox-custom-single.story.tsx?raw';\nimport ComboboxCustomTriggerSourceRaw from './combobox-custom-trigger.story.tsx?raw';\nimport ComboboxDefaultSourceRaw from './combobox-default.story.tsx?raw';\nimport ComboboxDescriptionsSourceRaw from './combobox-descriptions.story.tsx?raw';\nimport ComboboxDisabledSourceRaw from './combobox-disabled.story.tsx?raw';\nimport ComboboxFluidSourceRaw from './combobox-fluid.story.tsx?raw';\nimport ComboboxGroupsSourceRaw from './combobox-groups.story.tsx?raw';\nimport ComboboxHiddenLabelSourceRaw from './combobox-hidden-label.story.tsx?raw';\nimport ComboboxIconsSourceRaw from './combobox-icons.story.tsx?raw';\nimport ComboboxInDialogSourceRaw from './combobox-in-dialog.story.tsx?raw';\nimport ComboboxInPopoverSourceRaw from './combobox-in-popover.story.tsx?raw';\nimport ComboboxInPopoverDialogSourceRaw from './combobox-in-popover-dialog.story.tsx?raw';\nimport ComboboxLargeDataSetSourceRaw from './combobox-large-data-set.story.tsx?raw';\nimport ComboboxMaxRowsSourceRaw from './combobox-max-rows.story.tsx?raw';\nimport ComboboxMultiSourceRaw from './combobox-multi.story.tsx?raw';\nimport ComboboxNativeFormSourceRaw from './combobox-native-form.story.tsx?raw';\nimport ComboboxSelectOnlySourceRaw from './combobox-select-only.story.tsx?raw';\nimport ComboboxSizesSourceRaw from './combobox-sizes.story.tsx?raw';\nimport ComboboxUnlimitedRowsSourceRaw from './combobox-unlimited-rows.story.tsx?raw';\nimport ComboboxValidationSourceRaw from './combobox-validation.story.tsx?raw';\n\nexport const ComboboxActionsSource = removeLicenseHeader(\n ComboboxActionsSourceRaw,\n);\n\nexport const ComboboxAsyncSource = removeLicenseHeader(ComboboxAsyncSourceRaw);\n\nexport const ComboboxCleanSource = removeLicenseHeader(ComboboxCleanSourceRaw);\n\nexport const ComboboxActionOnSelectSource = removeLicenseHeader(\n ComboboxActionOnSelectSourceRaw,\n);\n\nexport const ComboboxCreatableSource = removeLicenseHeader(\n ComboboxCreatableSourceRaw,\n);\n\nexport const ComboboxDefaultSource = removeLicenseHeader(\n ComboboxDefaultSourceRaw,\n);\n\nexport const ComboboxDescriptionsSource = removeLicenseHeader(\n ComboboxDescriptionsSourceRaw,\n);\n\nexport const ComboboxDisabledSource = removeLicenseHeader(\n ComboboxDisabledSourceRaw,\n);\n\nexport const ComboboxFluidSource = removeLicenseHeader(ComboboxFluidSourceRaw);\n\nexport const ComboboxGroupsSource = removeLicenseHeader(\n ComboboxGroupsSourceRaw,\n);\n\nexport const ComboboxHiddenLabelSource = removeLicenseHeader(\n ComboboxHiddenLabelSourceRaw,\n);\n\nexport const ComboboxIconsSource = removeLicenseHeader(ComboboxIconsSourceRaw);\n\nexport const ComboboxInDialogSource = removeLicenseHeader(\n ComboboxInDialogSourceRaw,\n);\n\nexport const ComboboxInPopoverSource = removeLicenseHeader(\n ComboboxInPopoverSourceRaw,\n);\n\nexport const ComboboxInPopoverDialogSource = removeLicenseHeader(\n ComboboxInPopoverDialogSourceRaw,\n);\n\nexport const ComboboxLargeDataSetSource = removeLicenseHeader(\n ComboboxLargeDataSetSourceRaw,\n);\n\nexport const ComboboxMaxRowsSource = removeLicenseHeader(\n ComboboxMaxRowsSourceRaw,\n);\n\nexport const ComboboxMultiSource = removeLicenseHeader(ComboboxMultiSourceRaw);\n\nexport const ComboboxNativeFormSource = removeLicenseHeader(\n ComboboxNativeFormSourceRaw,\n);\n\nexport const ComboboxSelectOnlySource = removeLicenseHeader(\n ComboboxSelectOnlySourceRaw,\n);\n\nexport const ComboboxSizesSource = removeLicenseHeader(ComboboxSizesSourceRaw);\n\nexport const ComboboxUnlimitedRowsSource = removeLicenseHeader(\n ComboboxUnlimitedRowsSourceRaw,\n);\n\nexport const ComboboxCustomTriggerSource = removeLicenseHeader(\n ComboboxCustomTriggerSourceRaw,\n);\n\nexport const ComboboxCustomMultiSource = removeLicenseHeader(\n ComboboxCustomMultiSourceRaw,\n);\n\nexport const ComboboxCustomSingleSource = removeLicenseHeader(\n ComboboxCustomSingleSourceRaw,\n);\n\nexport const ComboboxValidationSource = removeLicenseHeader(\n ComboboxValidationSourceRaw,\n);\n"]}
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.useComboboxMultiValueOverflow = exports.computeVisibleTagCount = exports.getOverflowCounterMeasureTexts = exports.formatOverflowCount = void 0;
24
+ const react_1 = require("react");
25
+ /**
26
+ * The text of the overflow counter tag. Whole thousands round to a `K` suffix
27
+ * - `1500` becomes `2K` - so the counter keeps a bounded width no matter how
28
+ * large the selection grows.
29
+ */
30
+ const formatOverflowCount = (count) => count < 1000 ? `${count}` : `${Math.round(count / 1000)}K`;
31
+ exports.formatOverflowCount = formatOverflowCount;
32
+ /**
33
+ * Every text the counter could show at its widest for a selection of `total`
34
+ * options. K formatting makes the width non-monotonic - "+999" is wider than
35
+ * "+1K" - so the reserve has to measure both the widest sub-thousand text and
36
+ * the full count rather than the full count alone.
37
+ */
38
+ const getOverflowCounterMeasureTexts = (total) => Array.from(new Set([
39
+ (0, exports.formatOverflowCount)(Math.min(total, 999)),
40
+ (0, exports.formatOverflowCount)(total),
41
+ ]));
42
+ exports.getOverflowCounterMeasureTexts = getOverflowCounterMeasureTexts;
43
+ /**
44
+ * How many tags fit within `maxRows` rows of the value container, mirroring
45
+ * the greedy line breaking of `flex-wrap`. When they all fit, the count is the
46
+ * number of tags and no counter is needed; otherwise the result leaves room
47
+ * for the counter tag on the last permitted row.
48
+ */
49
+ const computeVisibleTagCount = ({ tagWidths, counterWidth, containerWidth, gap, maxRows, }) => {
50
+ // An unmeasurable container - hidden, or not laid out yet - must not
51
+ // collapse the whole selection into a counter.
52
+ if (containerWidth <= 0) {
53
+ return tagWidths.length;
54
+ }
55
+ const rowLimit = Math.max(1, Math.floor(maxRows));
56
+ const boundedCounterWidth = Math.min(counterWidth, containerWidth);
57
+ // With more than one tag a counter may be needed, so the stylesheet caps
58
+ // every tag at the container width minus room for the counter, and the
59
+ // simulation must clamp with the same cap to match the rendered widths.
60
+ // Extremely narrow containers where the cap would leave no room for a tag
61
+ // fall back to capping at the container width alone.
62
+ const counterReservedCap = containerWidth - gap - boundedCounterWidth;
63
+ const tagCap = tagWidths.length > 1 && counterReservedCap > 0
64
+ ? counterReservedCap
65
+ : containerWidth;
66
+ const widths = tagWidths.map((width) => Math.min(width, tagCap));
67
+ // Row and remaining row width after each prefix of tags, so every candidate
68
+ // cutoff can be checked without resimulating.
69
+ const placements = [];
70
+ let row = 1;
71
+ let rowWidth = 0;
72
+ widths.forEach((width, index) => {
73
+ if (index === 0) {
74
+ rowWidth = width;
75
+ }
76
+ else if (rowWidth + gap + width <= containerWidth) {
77
+ rowWidth += gap + width;
78
+ }
79
+ else {
80
+ row += 1;
81
+ rowWidth = width;
82
+ }
83
+ placements.push({ row, rowWidth });
84
+ });
85
+ if (row <= rowLimit) {
86
+ return widths.length;
87
+ }
88
+ for (let count = widths.length - 1; count >= 1; count -= 1) {
89
+ const placement = placements[count - 1];
90
+ const counterRow = placement.rowWidth + gap + boundedCounterWidth <= containerWidth
91
+ ? placement.row
92
+ : placement.row + 1;
93
+ if (counterRow <= rowLimit) {
94
+ return count;
95
+ }
96
+ }
97
+ // Not even one tag leaves room for the counter, so the counter stands alone.
98
+ return 0;
99
+ };
100
+ exports.computeVisibleTagCount = computeVisibleTagCount;
101
+ /**
102
+ * Caps the rows of selected tags in a multi select control. All tags stay
103
+ * rendered; the ones past `visibleCount` are taken out of the layout by the
104
+ * stylesheet but stay measurable, so the computation is stable across passes.
105
+ * Width comes from a `ResizeObserver` on the value container, and everything
106
+ * else from `measureKey`.
107
+ */
108
+ const useComboboxMultiValueOverflow = ({ maxRows, tagCount, measureKey, }) => {
109
+ const containerRef = (0, react_1.useRef)(null);
110
+ // null shows every tag, which is also the server-rendered state.
111
+ const [visibleCount, setVisibleCount] = (0, react_1.useState)(null);
112
+ const isLimited = maxRows !== undefined && tagCount > 0;
113
+ const measure = () => {
114
+ const container = containerRef.current;
115
+ if (maxRows === undefined || container === null) {
116
+ setVisibleCount(null);
117
+ return;
118
+ }
119
+ const tags = Array.from(container.querySelectorAll(':scope > .ndl-combobox-multi-value'));
120
+ // With K formatting the widest counter is not always the one for the full
121
+ // count - "+999" is wider than "+1K" - so every candidate is rendered as a
122
+ // measure tag and the widest one sets the reserve.
123
+ const counters = Array.from(container.querySelectorAll(':scope > .ndl-combobox-multi-value-measure'));
124
+ if (tags.length === 0 || counters.length === 0) {
125
+ setVisibleCount(null);
126
+ return;
127
+ }
128
+ const counterWidth = Math.max(...counters.map((counter) => counter.getBoundingClientRect().width));
129
+ const gap = Number.parseFloat(window.getComputedStyle(container).columnGap) || 0;
130
+ // The stylesheet caps every tag at the container width minus this reserve,
131
+ // so a tag too wide to sit next to the counter shrinks instead of
132
+ // collapsing. Set before the tag rects are read, so the forced layout
133
+ // below applies it and the widths reflect the cap. Rounded up plus one
134
+ // pixel of slack, so subpixel layout quantization can never make a capped
135
+ // tag plus the counter overflow the row.
136
+ container.style.setProperty('--ndl-combobox-counter-reserve', `${Math.ceil(gap + counterWidth) + 1}px`);
137
+ // Fractional widths, so rounding never claims room the browser would wrap.
138
+ const nextVisibleCount = (0, exports.computeVisibleTagCount)({
139
+ containerWidth: container.getBoundingClientRect().width,
140
+ counterWidth,
141
+ gap,
142
+ maxRows,
143
+ tagWidths: tags.map((tag) => tag.getBoundingClientRect().width),
144
+ });
145
+ setVisibleCount(nextVisibleCount >= tags.length ? null : nextVisibleCount);
146
+ };
147
+ const measureRef = (0, react_1.useRef)(measure);
148
+ (0, react_1.useLayoutEffect)(() => {
149
+ measureRef.current = measure;
150
+ measure();
151
+ // measure() reads the DOM, so it depends on everything the key encodes
152
+ // rather than on reactive values of its own.
153
+ // eslint-disable-next-line react-hooks/exhaustive-deps
154
+ }, [isLimited, maxRows, tagCount, measureKey]);
155
+ (0, react_1.useLayoutEffect)(() => {
156
+ const container = containerRef.current;
157
+ if (!isLimited || container === null) {
158
+ return;
159
+ }
160
+ // Hiding tags only changes the container height, and the recomputation is
161
+ // idempotent, so the observer settles after a single extra pass.
162
+ const observer = new ResizeObserver(() => {
163
+ measureRef.current();
164
+ });
165
+ observer.observe(container);
166
+ return () => {
167
+ observer.disconnect();
168
+ };
169
+ }, [isLimited]);
170
+ return { containerRef, visibleCount };
171
+ };
172
+ exports.useComboboxMultiValueOverflow = useComboboxMultiValueOverflow;
173
+ //# sourceMappingURL=use-combobox-multi-value-overflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-combobox-multi-value-overflow.js","sourceRoot":"","sources":["../../../src/combobox/use-combobox-multi-value-overflow.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iCAA0D;AAE1D;;;;GAIG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE,CAC3D,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC;AADhD,QAAA,mBAAmB,uBAC6B;AAE7D;;;;;GAKG;AACI,MAAM,8BAA8B,GAAG,CAAC,KAAa,EAAY,EAAE,CACxE,KAAK,CAAC,IAAI,CACR,IAAI,GAAG,CAAC;IACN,IAAA,2BAAmB,EAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,IAAA,2BAAmB,EAAC,KAAK,CAAC;CAC3B,CAAC,CACH,CAAC;AANS,QAAA,8BAA8B,kCAMvC;AAeJ;;;;;GAKG;AACI,MAAM,sBAAsB,GAAG,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,cAAc,EACd,GAAG,EACH,OAA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KAAK,CAAC;SAChE,CAAC,CAAC;QAEH,eAAe,CAAC,gBAAgB,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7E,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,OAAO,CAAC,CAAC;IAEnC,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;QAC7B,OAAO,EAAE,CAAC;QACV,uEAAuE;QACvE,6CAA6C;QAC7C,uDAAuD;IACzD,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE/C,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC;QAEvC,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrC,OAAO;QACT,CAAC;QAED,0EAA0E;QAC1E,iEAAiE;QACjE,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE;YACvC,UAAU,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5B,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC,CAAC;AAhGW,QAAA,6BAA6B,iCAgGxC","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 { useLayoutEffect, useRef, useState } from 'react';\n\n/**\n * The text of the overflow counter tag. Whole thousands round to a `K` suffix\n * - `1500` becomes `2K` - so the counter keeps a bounded width no matter how\n * large the selection grows.\n */\nexport const formatOverflowCount = (count: number): string =>\n count < 1000 ? `${count}` : `${Math.round(count / 1000)}K`;\n\n/**\n * Every text the counter could show at its widest for a selection of `total`\n * options. K formatting makes the width non-monotonic - \"+999\" is wider than\n * \"+1K\" - so the reserve has to measure both the widest sub-thousand text and\n * the full count rather than the full count alone.\n */\nexport const getOverflowCounterMeasureTexts = (total: number): string[] =>\n Array.from(\n new Set([\n formatOverflowCount(Math.min(total, 999)),\n formatOverflowCount(total),\n ]),\n );\n\ntype ComboboxOverflowMeasurements = {\n /** Widths of every selected tag, in selection order. */\n tagWidths: number[];\n /** Width of the widest counter tag the current selection could need. */\n counterWidth: number;\n /** Content width of the wrapping value container. */\n containerWidth: number;\n /** Column gap between tags. */\n gap: number;\n /** Maximum number of rows the tags may wrap into. */\n maxRows: number;\n};\n\n/**\n * How many tags fit within `maxRows` rows of the value container, mirroring\n * the greedy line breaking of `flex-wrap`. When they all fit, the count is the\n * number of tags and no counter is needed; otherwise the result leaves room\n * for the counter tag on the last permitted row.\n */\nexport const computeVisibleTagCount = ({\n tagWidths,\n counterWidth,\n containerWidth,\n gap,\n maxRows,\n}: ComboboxOverflowMeasurements): number => {\n // An unmeasurable container - hidden, or not laid out yet - must not\n // collapse the whole selection into a counter.\n if (containerWidth <= 0) {\n return tagWidths.length;\n }\n\n const rowLimit = Math.max(1, Math.floor(maxRows));\n const boundedCounterWidth = Math.min(counterWidth, containerWidth);\n // With more than one tag a counter may be needed, so the stylesheet caps\n // every tag at the container width minus room for the counter, and the\n // simulation must clamp with the same cap to match the rendered widths.\n // Extremely narrow containers where the cap would leave no room for a tag\n // fall back to capping at the container width alone.\n const counterReservedCap = containerWidth - gap - boundedCounterWidth;\n const tagCap =\n tagWidths.length > 1 && counterReservedCap > 0\n ? counterReservedCap\n : containerWidth;\n const widths = tagWidths.map((width) => Math.min(width, tagCap));\n // Row and remaining row width after each prefix of tags, so every candidate\n // cutoff can be checked without resimulating.\n const placements: { row: number; rowWidth: number }[] = [];\n let row = 1;\n let rowWidth = 0;\n\n widths.forEach((width, index) => {\n if (index === 0) {\n rowWidth = width;\n } else if (rowWidth + gap + width <= containerWidth) {\n rowWidth += gap + width;\n } else {\n row += 1;\n rowWidth = width;\n }\n\n placements.push({ row, rowWidth });\n });\n\n if (row <= rowLimit) {\n return widths.length;\n }\n\n for (let count = widths.length - 1; count >= 1; count -= 1) {\n const placement = placements[count - 1];\n const counterRow =\n placement.rowWidth + gap + boundedCounterWidth <= containerWidth\n ? placement.row\n : placement.row + 1;\n\n if (counterRow <= rowLimit) {\n return count;\n }\n }\n\n // Not even one tag leaves room for the counter, so the counter stands alone.\n return 0;\n};\n\ntype UseComboboxMultiValueOverflowOptions = {\n /** Undefined leaves the selection unbounded and skips all measuring. */\n maxRows: number | undefined;\n /** Number of selected options rendered as tags. */\n tagCount: number;\n /**\n * Anything that changes tag widths without changing the container size, such\n * as the selection itself or the control size, so those changes re-measure.\n */\n measureKey: string;\n};\n\n/**\n * Caps the rows of selected tags in a multi select control. All tags stay\n * rendered; the ones past `visibleCount` are taken out of the layout by the\n * stylesheet but stay measurable, so the computation is stable across passes.\n * Width comes from a `ResizeObserver` on the value container, and everything\n * else from `measureKey`.\n */\nexport const useComboboxMultiValueOverflow = ({\n maxRows,\n tagCount,\n measureKey,\n}: UseComboboxMultiValueOverflowOptions) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n // null shows every tag, which is also the server-rendered state.\n const [visibleCount, setVisibleCount] = useState<number | null>(null);\n const isLimited = maxRows !== undefined && tagCount > 0;\n\n const measure = () => {\n const container = containerRef.current;\n\n if (maxRows === undefined || container === null) {\n setVisibleCount(null);\n return;\n }\n\n const tags = Array.from(\n container.querySelectorAll<HTMLElement>(\n ':scope > .ndl-combobox-multi-value',\n ),\n );\n // With K formatting the widest counter is not always the one for the full\n // count - \"+999\" is wider than \"+1K\" - so every candidate is rendered as a\n // measure tag and the widest one sets the reserve.\n const counters = Array.from(\n container.querySelectorAll<HTMLElement>(\n ':scope > .ndl-combobox-multi-value-measure',\n ),\n );\n\n if (tags.length === 0 || counters.length === 0) {\n setVisibleCount(null);\n return;\n }\n\n const counterWidth = Math.max(\n ...counters.map((counter) => counter.getBoundingClientRect().width),\n );\n const gap =\n Number.parseFloat(window.getComputedStyle(container).columnGap) || 0;\n\n // The stylesheet caps every tag at the container width minus this reserve,\n // so a tag too wide to sit next to the counter shrinks instead of\n // collapsing. Set before the tag rects are read, so the forced layout\n // below applies it and the widths reflect the cap. Rounded up plus one\n // pixel of slack, so subpixel layout quantization can never make a capped\n // tag plus the counter overflow the row.\n container.style.setProperty(\n '--ndl-combobox-counter-reserve',\n `${Math.ceil(gap + counterWidth) + 1}px`,\n );\n\n // Fractional widths, so rounding never claims room the browser would wrap.\n const nextVisibleCount = computeVisibleTagCount({\n containerWidth: container.getBoundingClientRect().width,\n counterWidth,\n gap,\n maxRows,\n tagWidths: tags.map((tag) => tag.getBoundingClientRect().width),\n });\n\n setVisibleCount(nextVisibleCount >= tags.length ? null : nextVisibleCount);\n };\n\n const measureRef = useRef(measure);\n\n useLayoutEffect(() => {\n measureRef.current = measure;\n measure();\n // measure() reads the DOM, so it depends on everything the key encodes\n // rather than on reactive values of its own.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLimited, maxRows, tagCount, measureKey]);\n\n useLayoutEffect(() => {\n const container = containerRef.current;\n\n if (!isLimited || container === null) {\n return;\n }\n\n // Hiding tags only changes the container height, and the recomputation is\n // idempotent, so the observer settles after a single extra pass.\n const observer = new ResizeObserver(() => {\n measureRef.current();\n });\n\n observer.observe(container);\n return () => {\n observer.disconnect();\n };\n }, [isLimited]);\n\n return { containerRef, visibleCount };\n};\n"]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useComboboxPopover = useComboboxPopover;
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
+ const react_1 = require("@floating-ui/react");
25
+ const dialog_context_1 = require("../dialog/dialog-context");
26
+ /**
27
+ * Anchors the combobox panel to the control. Deliberately does not use
28
+ * `useRole`, since the ARIA lives on the trigger button rather than on the
29
+ * reference element, and the composition differs between the searchable and
30
+ * select-only patterns.
31
+ */
32
+ function useComboboxPopover({ isOpen, onOpenChange, isDisabled, isPortaled: isPortaledProp, floatingStrategy, }) {
33
+ const isInsideDialog = (0, dialog_context_1.useIsInsideDialog)();
34
+ const isPortaled = isPortaledProp !== null && isPortaledProp !== void 0 ? isPortaledProp : !isInsideDialog;
35
+ // Inside a Dialog the panel is fixed and not portaled. A transformed
36
+ // ancestor can make Floating UI under-measure available space, so use the
37
+ // viewport as the boundary instead.
38
+ const floatingBoundary = isInsideDialog ? [] : 'clippingAncestors';
39
+ const { refs, floatingStyles, context } = (0, react_1.useFloating)({
40
+ middleware: [
41
+ (0, react_1.offset)(4),
42
+ (0, react_1.flip)({ fallbackPlacements: ['top-start'], padding: 5 }),
43
+ (0, react_1.shift)({ boundary: floatingBoundary, padding: 5 }),
44
+ (0, react_1.size)({
45
+ apply({ availableHeight, elements, rects }) {
46
+ // The reference width is a floor the stylesheet combines with its own,
47
+ // so a narrow trigger still gets a readable panel.
48
+ elements.floating.style.setProperty('--ndl-combobox-reference-width', `${rects.reference.width}px`);
49
+ Object.assign(elements.floating.style, {
50
+ maxHeight: `${availableHeight}px`,
51
+ });
52
+ },
53
+ boundary: floatingBoundary,
54
+ padding: 5,
55
+ }),
56
+ ],
57
+ onOpenChange: (open) => {
58
+ onOpenChange(open);
59
+ },
60
+ open: !isDisabled && isOpen,
61
+ placement: 'bottom-start',
62
+ strategy: floatingStrategy !== null && floatingStrategy !== void 0 ? floatingStrategy : (isInsideDialog ? 'fixed' : 'absolute'),
63
+ whileElementsMounted: react_1.autoUpdate,
64
+ });
65
+ const click = (0, react_1.useClick)(context, { enabled: !isDisabled });
66
+ const dismiss = (0, react_1.useDismiss)(context);
67
+ const { getReferenceProps, getFloatingProps } = (0, react_1.useInteractions)([
68
+ click,
69
+ dismiss,
70
+ ]);
71
+ return {
72
+ context,
73
+ floatingStyles,
74
+ getFloatingProps,
75
+ getReferenceProps,
76
+ isPortaled,
77
+ refs,
78
+ };
79
+ }
80
+ //# sourceMappingURL=use-combobox-popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-combobox-popover.js","sourceRoot":"","sources":["../../../src/combobox/use-combobox-popover.ts"],"names":[],"mappings":";;AAiDA,gDA2DC;AA5GD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAW4B;AAE5B,6DAA6D;AAU7D;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,YAAY,EACZ,UAAU,EACV,UAAU,EAAE,cAAc,EAC1B,gBAAgB,GACU;IAC1B,MAAM,cAAc,GAAG,IAAA,kCAAiB,GAAE,CAAC;IAC3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O,CAAC,CAAC,CAAC,UAAU,CAAC;QACrE,oBAAoB,EAAE,kBAAU;KACjC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC;QAC9D,KAAK;QACL,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,cAAc;QACd,gBAAgB;QAChB,iBAAiB;QACjB,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n type Boundary,\n flip,\n offset,\n shift,\n size as sizeMiddleware,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n} from '@floating-ui/react';\n\nimport { useIsInsideDialog } from '../dialog/dialog-context';\n\ntype UseComboboxPopoverOptions = {\n isOpen: boolean;\n onOpenChange: (isOpen: boolean) => void;\n isDisabled: boolean;\n isPortaled?: boolean;\n floatingStrategy?: 'absolute' | 'fixed';\n};\n\n/**\n * Anchors the combobox panel to the control. Deliberately does not use\n * `useRole`, since the ARIA lives on the trigger button rather than on the\n * reference element, and the composition differs between the searchable and\n * select-only patterns.\n */\nexport function useComboboxPopover({\n isOpen,\n onOpenChange,\n isDisabled,\n isPortaled: isPortaledProp,\n floatingStrategy,\n}: UseComboboxPopoverOptions) {\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n // Inside a Dialog the panel is fixed and not portaled. A transformed\n // ancestor can make Floating UI under-measure available space, so use the\n // viewport as the boundary instead.\n const floatingBoundary: Boundary = isInsideDialog ? [] : 'clippingAncestors';\n\n const { refs, floatingStyles, context } = useFloating({\n middleware: [\n offset(4),\n flip({ fallbackPlacements: ['top-start'], padding: 5 }),\n shift({ boundary: floatingBoundary, padding: 5 }),\n sizeMiddleware({\n apply({ availableHeight, elements, rects }) {\n // The reference width is a floor the stylesheet combines with its own,\n // so a narrow trigger still gets a readable panel.\n elements.floating.style.setProperty(\n '--ndl-combobox-reference-width',\n `${rects.reference.width}px`,\n );\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n });\n },\n boundary: floatingBoundary,\n padding: 5,\n }),\n ],\n onOpenChange: (open) => {\n onOpenChange(open);\n },\n open: !isDisabled && isOpen,\n placement: 'bottom-start',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context, { enabled: !isDisabled });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([\n click,\n dismiss,\n ]);\n\n return {\n context,\n floatingStyles,\n getFloatingProps,\n getReferenceProps,\n isPortaled,\n refs,\n };\n}\n"]}