@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,76 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ import { PlusIconOutline } from '@neo4j-ndl/react/icons';
25
+ const options = [
26
+ { label: 'Movie recommendations', value: 'movie-recommendations' },
27
+ { label: 'Fraud detection', value: 'fraud-detection' },
28
+ { label: 'Supply chain', value: 'supply-chain' },
29
+ { label: 'Customer 360', value: 'customer-360' },
30
+ { label: 'Knowledge graph', value: 'knowledge-graph' },
31
+ { label: 'Network topology', value: 'network-topology' },
32
+ { label: 'Identity resolution', value: 'identity-resolution' },
33
+ { label: 'Master data management', value: 'master-data-management' },
34
+ { label: 'Social network analysis', value: 'social-network-analysis' },
35
+ { label: 'Route optimization', value: 'route-optimization' },
36
+ { label: 'Recommendation engine', value: 'recommendation-engine' },
37
+ { label: 'Access control', value: 'access-control' },
38
+ { label: 'Data lineage', value: 'data-lineage' },
39
+ { label: 'Entity resolution', value: 'entity-resolution' },
40
+ { label: 'Bill of materials', value: 'bill-of-materials' },
41
+ { label: 'Impact analysis', value: 'impact-analysis' },
42
+ { label: 'Anti money laundering', value: 'anti-money-laundering' },
43
+ { label: 'Dependency mapping', value: 'dependency-mapping' },
44
+ { label: 'Patient journey', value: 'patient-journey' },
45
+ { label: 'Content personalization', value: 'content-personalization' },
46
+ { label: 'Risk assessment', value: 'risk-assessment' },
47
+ { label: 'Churn prediction', value: 'churn-prediction' },
48
+ { label: 'Inventory tracking', value: 'inventory-tracking' },
49
+ { label: 'Semantic search', value: 'semantic-search' },
50
+ { label: 'Digital twin', value: 'digital-twin' },
51
+ ];
52
+ const Component = () => {
53
+ return (_jsx("div", { className: "n-flex n-flex-col n-gap-token-4", children: _jsx(Combobox, { label: "Project", placeholder: "Select project", searchPlaceholder: "Search projects", options: options,
54
+ // An action never becomes part of the value. It runs, the panel closes,
55
+ // and the selection is left as it was, which is what makes it usable for
56
+ // leaving the combobox entirely.
57
+ actions: [
58
+ {
59
+ label: 'All projects',
60
+ onSelect: () => console.info('all projects'),
61
+ },
62
+ {
63
+ // A divider above the action separates it from the actions before
64
+ // it. The first action never needs one: it already sits below the
65
+ // divider that separates actions from options.
66
+ hasDivider: true,
67
+ label: 'Create project',
68
+ leadingVisual: _jsx(PlusIconOutline, {}),
69
+ // The search value comes along, so an unmatched query can prefill
70
+ // the flow the action leads to.
71
+ onSelect: ({ searchValue }) => console.info('create project with search value', searchValue),
72
+ },
73
+ ], helpText: "actions stay pinned below the scrolling options, and are exempt from searching" }) }));
74
+ };
75
+ export default Component;
76
+ //# sourceMappingURL=combobox-actions.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-actions.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-actions.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe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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 { PlusIconOutline } from '@neo4j-ndl/react/icons';\n\nconst options = [\n { label: 'Movie recommendations', value: 'movie-recommendations' },\n { label: 'Fraud detection', value: 'fraud-detection' },\n { label: 'Supply chain', value: 'supply-chain' },\n { label: 'Customer 360', value: 'customer-360' },\n { label: 'Knowledge graph', value: 'knowledge-graph' },\n { label: 'Network topology', value: 'network-topology' },\n { label: 'Identity resolution', value: 'identity-resolution' },\n { label: 'Master data management', value: 'master-data-management' },\n { label: 'Social network analysis', value: 'social-network-analysis' },\n { label: 'Route optimization', value: 'route-optimization' },\n { label: 'Recommendation engine', value: 'recommendation-engine' },\n { label: 'Access control', value: 'access-control' },\n { label: 'Data lineage', value: 'data-lineage' },\n { label: 'Entity resolution', value: 'entity-resolution' },\n { label: 'Bill of materials', value: 'bill-of-materials' },\n { label: 'Impact analysis', value: 'impact-analysis' },\n { label: 'Anti money laundering', value: 'anti-money-laundering' },\n { label: 'Dependency mapping', value: 'dependency-mapping' },\n { label: 'Patient journey', value: 'patient-journey' },\n { label: 'Content personalization', value: 'content-personalization' },\n { label: 'Risk assessment', value: 'risk-assessment' },\n { label: 'Churn prediction', value: 'churn-prediction' },\n { label: 'Inventory tracking', value: 'inventory-tracking' },\n { label: 'Semantic search', value: 'semantic-search' },\n { label: 'Digital twin', value: 'digital-twin' },\n];\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-4\">\n <Combobox\n label=\"Project\"\n placeholder=\"Select project\"\n searchPlaceholder=\"Search projects\"\n options={options}\n // An action never becomes part of the value. It runs, the panel closes,\n // and the selection is left as it was, which is what makes it usable for\n // leaving the combobox entirely.\n actions={[\n {\n label: 'All projects',\n onSelect: () => console.info('all projects'),\n },\n {\n // A divider above the action separates it from the actions before\n // it. The first action never needs one: it already sits below the\n // divider that separates actions from options.\n hasDivider: true,\n label: 'Create project',\n leadingVisual: <PlusIconOutline />,\n // The search value comes along, so an unmatched query can prefill\n // the flow the action leads to.\n onSelect: ({ searchValue }) =>\n console.info('create project with search value', searchValue),\n },\n ]}\n helpText=\"actions stay pinned below the scrolling options, and are exempt from searching\"\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox, Typography } from '@neo4j-ndl/react';
24
+ import { useEffect, useState } from 'react';
25
+ const catalog = [
26
+ { label: 'Neo4j', value: 'neo4j' },
27
+ { label: 'Aura', value: 'aura' },
28
+ { label: 'Bloom', value: 'bloom' },
29
+ { label: 'Browser', value: 'browser' },
30
+ { label: 'Cypher', value: 'cypher' },
31
+ { label: 'Data Importer', value: 'data-importer' },
32
+ { label: 'GraphQL', value: 'graphql' },
33
+ ];
34
+ const SEARCH_DELAY_MS = 600;
35
+ const Component = () => {
36
+ const [searchValue, setSearchValue] = useState('');
37
+ const [options, setOptions] = useState([]);
38
+ const [isLoading, setIsLoading] = useState(false);
39
+ const [hasOpened, setHasOpened] = useState(false);
40
+ useEffect(() => {
41
+ if (!hasOpened) {
42
+ return;
43
+ }
44
+ let isCancelled = false;
45
+ const query = searchValue.trim().toLowerCase();
46
+ setIsLoading(true);
47
+ setOptions([]);
48
+ const timeoutId = window.setTimeout(() => {
49
+ if (isCancelled) {
50
+ return;
51
+ }
52
+ setOptions(query === ''
53
+ ? catalog
54
+ : catalog.filter((option) => option.label.toLowerCase().includes(query)));
55
+ setIsLoading(false);
56
+ }, SEARCH_DELAY_MS);
57
+ return () => {
58
+ isCancelled = true;
59
+ window.clearTimeout(timeoutId);
60
+ };
61
+ }, [hasOpened, searchValue]);
62
+ return (_jsxs("div", { className: "n-flex n-flex-col n-gap-token-4", children: [_jsx(Combobox, { label: "Products",
63
+ // The consumer supplies already-filtered options, so internal
64
+ // filtering must be disabled.
65
+ filterOption: false, searchValue: searchValue, onSearchChange: setSearchValue, onOpenChange: (isOpen) => {
66
+ if (isOpen) {
67
+ setIsLoading(true);
68
+ setHasOpened(true);
69
+ }
70
+ }, options: options, isLoading: isLoading, searchPlaceholder: "Search products" }), _jsx(Typography, { variant: "body-small", className: "n-text-neutral-text-weak", children: "The consumer clears, fetches, and filters options after a short delay. The loading state is shown while each request is in flight." })] }));
71
+ };
72
+ export default Component;
73
+ //# sourceMappingURL=combobox-async.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-async.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-async.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;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) \"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, Typography } from '@neo4j-ndl/react';\nimport { useEffect, useState } from 'react';\n\nconst catalog = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n { label: 'Browser', value: 'browser' },\n { label: 'Cypher', value: 'cypher' },\n { label: 'Data Importer', value: 'data-importer' },\n { label: 'GraphQL', value: 'graphql' },\n];\n\nconst SEARCH_DELAY_MS = 600;\n\nconst Component = () => {\n const [searchValue, setSearchValue] = useState('');\n const [options, setOptions] = useState<typeof catalog>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [hasOpened, setHasOpened] = useState(false);\n\n useEffect(() => {\n if (!hasOpened) {\n return;\n }\n\n let isCancelled = false;\n const query = searchValue.trim().toLowerCase();\n\n setIsLoading(true);\n setOptions([]);\n\n const timeoutId = window.setTimeout(() => {\n if (isCancelled) {\n return;\n }\n\n setOptions(\n query === ''\n ? catalog\n : catalog.filter((option) =>\n option.label.toLowerCase().includes(query),\n ),\n );\n setIsLoading(false);\n }, SEARCH_DELAY_MS);\n\n return () => {\n isCancelled = true;\n window.clearTimeout(timeoutId);\n };\n }, [hasOpened, searchValue]);\n\n return (\n <div className=\"n-flex n-flex-col n-gap-token-4\">\n <Combobox\n label=\"Products\"\n // The consumer supplies already-filtered options, so internal\n // filtering must be disabled.\n filterOption={false}\n searchValue={searchValue}\n onSearchChange={setSearchValue}\n onOpenChange={(isOpen) => {\n if (isOpen) {\n setIsLoading(true);\n setHasOpened(true);\n }\n }}\n options={options}\n isLoading={isLoading}\n searchPlaceholder=\"Search products\"\n />\n <Typography variant=\"body-small\" className=\"n-text-neutral-text-weak\">\n The consumer clears, fetches, and filters options after a short delay.\n The loading state is shown while each request is in flight.\n </Typography>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ const Component = () => {
25
+ const options = [
26
+ { label: 'Neo4j', value: 'neo4j' },
27
+ { label: 'Aura', value: 'aura' },
28
+ { label: 'Bloom', value: 'bloom' },
29
+ { isDisabled: true, label: 'Unavailable', value: 'unavailable' },
30
+ ];
31
+ return (_jsx(Combobox, { label: "Product",
32
+ // A clean combobox sits inline, next to whatever already names it.
33
+ hasVisuallyHiddenLabel: true, isClean: true, options: options, defaultValue: options[0] }));
34
+ };
35
+ export default Component;
36
+ //# sourceMappingURL=combobox-clean.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-clean.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-clean.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;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,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;KACjE,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAC,SAAS;QACf,mEAAmE;QACnE,sBAAsB,QACtB,OAAO,QACP,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,GACxB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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: 'Unavailable', value: 'unavailable' },\n ];\n\n return (\n <Combobox\n label=\"Product\"\n // A clean combobox sits inline, next to whatever already names it.\n hasVisuallyHiddenLabel\n isClean\n options={options}\n defaultValue={options[0]}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ import { useState } from 'react';
25
+ const INITIAL_OPTIONS = [
26
+ { label: 'Recommendations', value: 'recommendations' },
27
+ { label: 'Fraud detection', value: 'fraud-detection' },
28
+ { label: 'Knowledge graph', value: 'knowledge-graph' },
29
+ ];
30
+ const Component = () => {
31
+ const [options, setOptions] = useState(INITIAL_OPTIONS);
32
+ const [value, setValue] = useState([]);
33
+ return (_jsx(Combobox, { label: "Use cases", placeholder: "Select use cases", searchPlaceholder: "Search or add a use case", isMulti: true, isCreatable: true, isClearable: true, options: options, value: value, onChange: (nextValue) => setValue(nextValue),
34
+ // Created options are not added to `options` by the Combobox, so they are
35
+ // appended here to keep them available for later selections.
36
+ onCreateOption: (option) => setOptions((current) => [...current, option]) }));
37
+ };
38
+ export default Component;
39
+ //# sourceMappingURL=combobox-creatable.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-creatable.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-creatable.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOjC,MAAM,eAAe,GAAa;IAChC,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACtD,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACtD,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACvD,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAEjD,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAC,WAAW,EACjB,WAAW,EAAC,kBAAkB,EAC9B,iBAAiB,EAAC,0BAA0B,EAC5C,OAAO,QACP,WAAW,QACX,WAAW,QACX,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC5C,0EAA0E;QAC1E,6DAA6D;QAC7D,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,GACzE,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 INITIAL_OPTIONS: Option[] = [\n { label: 'Recommendations', value: 'recommendations' },\n { label: 'Fraud detection', value: 'fraud-detection' },\n { label: 'Knowledge graph', value: 'knowledge-graph' },\n];\n\nconst Component = () => {\n const [options, setOptions] = useState(INITIAL_OPTIONS);\n const [value, setValue] = useState<Option[]>([]);\n\n return (\n <Combobox\n label=\"Use cases\"\n placeholder=\"Select use cases\"\n searchPlaceholder=\"Search or add a use case\"\n isMulti\n isCreatable\n isClearable\n options={options}\n value={value}\n onChange={(nextValue) => setValue(nextValue)}\n // Created options are not added to `options` by the Combobox, so they are\n // appended here to keep them available for later selections.\n onCreateOption={(option) => setOptions((current) => [...current, option])}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { tokens } from '@neo4j-ndl/base';
24
+ import { Combobox, GraphLabel } from '@neo4j-ndl/react';
25
+ import { useState } from 'react';
26
+ const options = [
27
+ { color: tokens.graph['1'], label: 'Person', value: 'person' },
28
+ { color: tokens.graph['2'], label: 'Movie', value: 'movie' },
29
+ { color: tokens.graph['3'], label: 'Director', value: 'director' },
30
+ { color: tokens.graph['4'], label: 'Actor', value: 'actor' },
31
+ { color: tokens.graph['7'], label: 'Genre', value: 'genre' },
32
+ { color: tokens.graph['12'], label: 'Studio', value: 'studio' },
33
+ ];
34
+ // One presentation for the selected values and for the options, so both read
35
+ // the same. `as="span"` keeps it non-interactive, which leaves the list and the
36
+ // clear button as the ways to deselect.
37
+ const NodeLabel = ({ option, isDisabled, }) => (_jsx(GraphLabel, { as: "span", type: "node", size: "small", color: option.color, isDisabled: isDisabled, children: option.label }));
38
+ const Component = () => {
39
+ const [value, setValue] = useState(options.slice(0, 2));
40
+ return (_jsx(Combobox, { label: "Node labels", helpText: "Deselect a label in the list to remove it.", isMulti: true, isClearable: true, options: options, value: value, onChange: setValue, components: { MultiValue: NodeLabel, OptionLabel: NodeLabel } }));
41
+ };
42
+ export default Component;
43
+ //# sourceMappingURL=combobox-custom-multi.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-custom-multi.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-custom-multi.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,MAA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CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAoB,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE3E,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAC,aAAa,EACnB,QAAQ,EAAC,4CAA4C,EACrD,OAAO,QACP,WAAW,QACX,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,GAC7D,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 { tokens } from '@neo4j-ndl/base';\nimport { Combobox, GraphLabel } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\n// The option type is free to carry fields of its own. Passing these options to\n// the combobox is what types `option` inside the overrides below.\ntype NodeLabelOption = {\n label: string;\n value: string;\n color: string;\n};\n\nconst options: NodeLabelOption[] = [\n { color: tokens.graph['1'], label: 'Person', value: 'person' },\n { color: tokens.graph['2'], label: 'Movie', value: 'movie' },\n { color: tokens.graph['3'], label: 'Director', value: 'director' },\n { color: tokens.graph['4'], label: 'Actor', value: 'actor' },\n { color: tokens.graph['7'], label: 'Genre', value: 'genre' },\n { color: tokens.graph['12'], label: 'Studio', value: 'studio' },\n];\n\n// One presentation for the selected values and for the options, so both read\n// the same. `as=\"span\"` keeps it non-interactive, which leaves the list and the\n// clear button as the ways to deselect.\nconst NodeLabel = ({\n option,\n isDisabled,\n}: {\n option: NodeLabelOption;\n isDisabled: boolean;\n}) => (\n <GraphLabel\n as=\"span\"\n type=\"node\"\n size=\"small\"\n color={option.color}\n isDisabled={isDisabled}\n >\n {option.label}\n </GraphLabel>\n);\n\nconst Component = () => {\n const [value, setValue] = useState<NodeLabelOption[]>(options.slice(0, 2));\n\n return (\n <Combobox\n label=\"Node labels\"\n helpText=\"Deselect a label in the list to remove it.\"\n isMulti\n isClearable\n options={options}\n value={value}\n onChange={setValue}\n components={{ MultiValue: NodeLabel, OptionLabel: NodeLabel }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { tokens } from '@neo4j-ndl/base';
24
+ import { Combobox, GraphLabel } from '@neo4j-ndl/react';
25
+ import { useState } from 'react';
26
+ const options = [
27
+ { color: tokens.graph['1'], label: 'Person', value: 'person' },
28
+ { color: tokens.graph['2'], label: 'Movie', value: 'movie' },
29
+ { color: tokens.graph['3'], label: 'Director', value: 'director' },
30
+ { color: tokens.graph['4'], label: 'Actor', value: 'actor' },
31
+ { color: tokens.graph['7'], label: 'Genre', value: 'genre' },
32
+ { color: tokens.graph['12'], label: 'Studio', value: 'studio' },
33
+ ];
34
+ // One presentation for the selected value and for the options, so both read
35
+ // the same. `as="span"` keeps the label non-interactive.
36
+ const NodeLabel = ({ option, isDisabled, }) => (_jsx(GraphLabel, { as: "span", type: "node", size: "small", color: option.color, isDisabled: isDisabled, children: option.label }));
37
+ const Component = () => {
38
+ const [value, setValue] = useState(options[0]);
39
+ return (_jsx(Combobox, { label: "Node label", isClearable: true, options: options, value: value, onChange: setValue, components: { OptionLabel: NodeLabel, SingleValue: NodeLabel } }));
40
+ };
41
+ export default Component;
42
+ //# sourceMappingURL=combobox-custom-single.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-custom-single.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-custom-single.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjC,MAAM,OAAO,GAAsB;IACjC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC9D,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IAClE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;CAChE,CAAC;AAEF,4EAA4E;AAC5E,yDAAyD;AACzD,MAAM,SAAS,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,GAIX,EAAE,EAAE,CAAC,CACJ,KAAC,UAAU,IACT,EAAE,EAAC,MAAM,EACT,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,UAAU,EAAE,UAAU,YAErB,MAAM,CAAC,KAAK,GACF,CACd,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAyB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAC,YAAY,EAClB,WAAW,QACX,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,GAC9D,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 { tokens } from '@neo4j-ndl/base';\nimport { Combobox, GraphLabel } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\n// The option type is free to carry fields of its own. Passing these options to\n// the combobox is what types `option` inside the overrides below.\ntype NodeLabelOption = {\n label: string;\n value: string;\n color: string;\n};\n\nconst options: NodeLabelOption[] = [\n { color: tokens.graph['1'], label: 'Person', value: 'person' },\n { color: tokens.graph['2'], label: 'Movie', value: 'movie' },\n { color: tokens.graph['3'], label: 'Director', value: 'director' },\n { color: tokens.graph['4'], label: 'Actor', value: 'actor' },\n { color: tokens.graph['7'], label: 'Genre', value: 'genre' },\n { color: tokens.graph['12'], label: 'Studio', value: 'studio' },\n];\n\n// One presentation for the selected value and for the options, so both read\n// the same. `as=\"span\"` keeps the label non-interactive.\nconst NodeLabel = ({\n option,\n isDisabled,\n}: {\n option: NodeLabelOption;\n isDisabled: boolean;\n}) => (\n <GraphLabel\n as=\"span\"\n type=\"node\"\n size=\"small\"\n color={option.color}\n isDisabled={isDisabled}\n >\n {option.label}\n </GraphLabel>\n);\n\nconst Component = () => {\n const [value, setValue] = useState<NodeLabelOption | null>(options[0]);\n\n return (\n <Combobox\n label=\"Node label\"\n isClearable\n options={options}\n value={value}\n onChange={setValue}\n components={{ OptionLabel: NodeLabel, SingleValue: NodeLabel }}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,58 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
34
+ import { Combobox, OutlinedButton } from '@neo4j-ndl/react';
35
+ import { AdjustmentsHorizontalIconOutline } from '@neo4j-ndl/react/icons';
36
+ const Component = () => {
37
+ const options = [
38
+ { label: 'Neo4j', value: 'neo4j' },
39
+ { label: 'Aura', value: 'aura' },
40
+ { label: 'Bloom', value: 'bloom' },
41
+ ];
42
+ return (_jsx(Combobox
43
+ // The custom trigger renders no label of its own, so the label reaches it
44
+ // as its accessible name only.
45
+ , {
46
+ // The custom trigger renders no label of its own, so the label reaches it
47
+ // as its accessible name only.
48
+ label: "Product", options: options, searchPlaceholder: "Search products",
49
+ // The panel anchors to whichever element the props land on, and that
50
+ // element becomes the combobox, so it has to be focusable.
51
+ renderTrigger: (_a, state) => {
52
+ var _b, _c;
53
+ var { ref } = _a, triggerProps = __rest(_a, ["ref"]);
54
+ return (_jsx(OutlinedButton, { ref: ref, htmlAttributes: triggerProps, leadingVisual: _jsx(AdjustmentsHorizontalIconOutline, {}), children: (_c = (_b = state.selectedOptions[0]) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : 'Pick a product' }));
55
+ } }));
56
+ };
57
+ export default Component;
58
+ //# sourceMappingURL=combobox-custom-trigger.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-custom-trigger.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-custom-trigger.story.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAE1E,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;KACnC,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ;IACP,0EAA0E;IAC1E,+BAA+B;;QAD/B,0EAA0E;QAC1E,+BAA+B;QAC/B,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAC,iBAAiB;QACnC,qEAAqE;QACrE,2DAA2D;QAC3D,aAAa,EAAE,CAAC,EAAwB,EAAE,KAAK,EAAE,EAAE;;gBAAnC,EAAE,GAAG,OAAmB,EAAd,YAAY,cAAtB,OAAwB,CAAF;YAAc,OAAA,CAClD,KAAC,cAAc,IACb,GAAG,EAAE,GAAmC,EACxC,cAAc,EAAE,YAAY,EAC5B,aAAa,EAAE,KAAC,gCAAgC,KAAG,YAElD,MAAA,MAAA,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,gBAAgB,GACrC,CAClB,CAAA;SAAA,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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, OutlinedButton } from '@neo4j-ndl/react';\nimport { AdjustmentsHorizontalIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n const options = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Aura', value: 'aura' },\n { label: 'Bloom', value: 'bloom' },\n ];\n\n return (\n <Combobox\n // The custom trigger renders no label of its own, so the label reaches it\n // as its accessible name only.\n label=\"Product\"\n options={options}\n searchPlaceholder=\"Search products\"\n // The panel anchors to whichever element the props land on, and that\n // element becomes the combobox, so it has to be focusable.\n renderTrigger={({ ref, ...triggerProps }, state) => (\n <OutlinedButton\n ref={ref as React.Ref<HTMLButtonElement>}\n htmlAttributes={triggerProps}\n leadingVisual={<AdjustmentsHorizontalIconOutline />}\n >\n {state.selectedOptions[0]?.label ?? 'Pick a product'}\n </OutlinedButton>\n )}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ const Component = () => {
25
+ let options = [
26
+ {
27
+ label: 'Option 1 ',
28
+ value: 'option-1',
29
+ },
30
+ { label: 'Option 2', value: 'option-2' },
31
+ {
32
+ label: 'Option 3 has a really, really, really, really, long label',
33
+ value: 'option-3',
34
+ },
35
+ { isDisabled: true, label: 'Option 4', value: 'option-4' },
36
+ ];
37
+ return (_jsx(Combobox, { label: "Products", options: options, defaultValue: options[0] }));
38
+ };
39
+ export default Component;
40
+ //# sourceMappingURL=combobox-default.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-default.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,IAAI,OAAO,GAAG;QACZ;YACE,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,UAAU;SAClB;QACD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;QACxC;YACE,KAAK,EAAE,2DAA2D;YAClE,KAAK,EAAE,UAAU;SAClB;QACD,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;KAC3D,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,GAAI,CAC1E,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 let options = [\n {\n label: 'Option 1 ',\n value: 'option-1',\n },\n { label: 'Option 2', value: 'option-2' },\n {\n label: 'Option 3 has a really, really, really, really, long label',\n value: 'option-3',\n },\n { isDisabled: true, label: 'Option 4', value: 'option-4' },\n ];\n\n return (\n <Combobox label=\"Products\" options={options} defaultValue={options[0]} />\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ const options = [
25
+ {
26
+ description: 'A fully managed graph database service',
27
+ label: 'AuraDB',
28
+ value: 'auradb',
29
+ },
30
+ {
31
+ description: 'Graph analytics and data science tools',
32
+ label: 'Graph Data Science',
33
+ value: 'graph-data-science',
34
+ },
35
+ {
36
+ description: 'Explore and visualize connected data',
37
+ label: 'Neo4j Bloom',
38
+ value: 'neo4j-bloom',
39
+ },
40
+ ];
41
+ const Component = () => (_jsx(Combobox, { label: "Products", options: options, placeholder: "Select product" }));
42
+ export default Component;
43
+ //# sourceMappingURL=combobox-descriptions.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-descriptions.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-descriptions.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,OAAO,GAAG;IACd;QACE,WAAW,EAAE,wCAAwC;QACrD,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,WAAW,EAAE,wCAAwC;QACrD,KAAK,EAAE,oBAAoB;QAC3B,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,WAAW,EAAE,sCAAsC;QACnD,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,aAAa;KACrB;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CACtB,KAAC,QAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAC,gBAAgB,GAAG,CAC7E,CAAC;AAEF,eAAe,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 {\n description: 'A fully managed graph database service',\n label: 'AuraDB',\n value: 'auradb',\n },\n {\n description: 'Graph analytics and data science tools',\n label: 'Graph Data Science',\n value: 'graph-data-science',\n },\n {\n description: 'Explore and visualize connected data',\n label: 'Neo4j Bloom',\n value: 'neo4j-bloom',\n },\n];\n\nconst Component = () => (\n <Combobox label=\"Products\" options={options} placeholder=\"Select product\" />\n);\n\nexport default Component;\n"]}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Combobox } from '@neo4j-ndl/react';
24
+ const options = [
25
+ { label: 'Neo4j', value: 'neo4j' },
26
+ { label: 'Aura', value: 'aura' },
27
+ { label: 'Bloom', value: 'bloom' },
28
+ { label: 'Data Importer', value: 'data-importer' },
29
+ ];
30
+ const Component = () => (_jsxs("div", { className: "n-flex n-flex-col n-items-start n-gap-token-16", children: [_jsx(Combobox, { label: "Disabled single select", defaultValue: options[0], isDisabled: true, options: options }), _jsx(Combobox, { label: "Disabled multi select", defaultValue: options.slice(0, 3), isDisabled: true, isMulti: true, options: options })] }));
31
+ export default Component;
32
+ //# sourceMappingURL=combobox-disabled.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-disabled.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-disabled.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;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;IAClC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;CACnD,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CACtB,eAAK,SAAS,EAAC,gDAAgD,aAC7D,KAAC,QAAQ,IACP,KAAK,EAAC,wBAAwB,EAC9B,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,EACxB,UAAU,QACV,OAAO,EAAE,OAAO,GAChB,EACF,KAAC,QAAQ,IACP,KAAK,EAAC,uBAAuB,EAC7B,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACjC,UAAU,QACV,OAAO,QACP,OAAO,EAAE,OAAO,GAChB,IACE,CACP,CAAC;AAEF,eAAe,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 { label: 'Data Importer', value: 'data-importer' },\n];\n\nconst Component = () => (\n <div className=\"n-flex n-flex-col n-items-start n-gap-token-16\">\n <Combobox\n label=\"Disabled single select\"\n defaultValue={options[0]}\n isDisabled\n options={options}\n />\n <Combobox\n label=\"Disabled multi select\"\n defaultValue={options.slice(0, 3)}\n isDisabled\n isMulti\n options={options}\n />\n </div>\n);\n\nexport default Component;\n"]}