@neo4j-ndl/react 4.18.13 → 4.20.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.
- package/lib/LICENSES.txt +54 -0
- package/lib/NOTICE.txt +8 -0
- package/lib/cjs/_common/use-semi-controlled-state.js +6 -1
- package/lib/cjs/_common/use-semi-controlled-state.js.map +1 -1
- package/lib/cjs/combobox/Combobox.js +1031 -0
- package/lib/cjs/combobox/Combobox.js.map +1 -0
- package/lib/cjs/combobox/combobox-types.js +23 -0
- package/lib/cjs/combobox/combobox-types.js.map +1 -0
- package/lib/cjs/combobox/combobox-utils.js +129 -0
- package/lib/cjs/combobox/combobox-utils.js.map +1 -0
- package/lib/cjs/combobox/index.js +26 -0
- package/lib/cjs/combobox/index.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-action-on-select.story.js +82 -0
- package/lib/cjs/combobox/stories/combobox-action-on-select.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-actions.story.js +78 -0
- package/lib/cjs/combobox/stories/combobox-actions.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-async.story.js +75 -0
- package/lib/cjs/combobox/stories/combobox-async.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-clean.story.js +38 -0
- package/lib/cjs/combobox/stories/combobox-clean.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-creatable.story.js +41 -0
- package/lib/cjs/combobox/stories/combobox-creatable.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-multi.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-custom-multi.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-single.story.js +44 -0
- package/lib/cjs/combobox/stories/combobox-custom-single.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js +60 -0
- package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-default.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-default.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-descriptions.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-descriptions.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-disabled.story.js +34 -0
- package/lib/cjs/combobox/stories/combobox-disabled.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-fluid.story.js +34 -0
- package/lib/cjs/combobox/stories/combobox-fluid.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-groups.story.js +49 -0
- package/lib/cjs/combobox/stories/combobox-groups.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-hidden-label.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-hidden-label.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-icons.story.js +46 -0
- package/lib/cjs/combobox/stories/combobox-icons.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-dialog.story.js +40 -0
- package/lib/cjs/combobox/stories/combobox-in-dialog.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js +40 -0
- package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-popover.story.js +36 -0
- package/lib/cjs/combobox/stories/combobox-in-popover.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-large-data-set.story.js +36 -0
- package/lib/cjs/combobox/stories/combobox-large-data-set.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-max-rows.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-max-rows.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-multi.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-multi.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-native-form.story.js +49 -0
- package/lib/cjs/combobox/stories/combobox-native-form.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-select-only.story.js +38 -0
- package/lib/cjs/combobox/stories/combobox-select-only.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-sizes.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-sizes.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-validation.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-validation.story.js.map +1 -0
- package/lib/cjs/combobox/stories/index.js +133 -0
- package/lib/cjs/combobox/stories/index.js.map +1 -0
- package/lib/cjs/combobox/use-combobox-multi-value-overflow.js +173 -0
- package/lib/cjs/combobox/use-combobox-multi-value-overflow.js.map +1 -0
- package/lib/cjs/combobox/use-combobox-popover.js +80 -0
- package/lib/cjs/combobox/use-combobox-popover.js.map +1 -0
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/dismissible-tag/DismissibleTag.js +1 -1
- package/lib/cjs/dismissible-tag/DismissibleTag.js.map +1 -1
- package/lib/cjs/icons/generated/custom/PencilSparkle.js +30 -0
- package/lib/cjs/icons/generated/custom/PencilSparkle.js.map +1 -0
- package/lib/cjs/icons/generated/custom/index.js +4 -2
- package/lib/cjs/icons/generated/custom/index.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/select/Select.js +3 -0
- package/lib/cjs/select/Select.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/esm/_common/use-semi-controlled-state.js +6 -1
- package/lib/esm/_common/use-semi-controlled-state.js.map +1 -1
- package/lib/esm/combobox/Combobox.js +1024 -0
- package/lib/esm/combobox/Combobox.js.map +1 -0
- package/lib/esm/combobox/combobox-types.js +22 -0
- package/lib/esm/combobox/combobox-types.js.map +1 -0
- package/lib/esm/combobox/combobox-utils.js +112 -0
- package/lib/esm/combobox/combobox-utils.js.map +1 -0
- package/lib/esm/combobox/index.js +22 -0
- package/lib/esm/combobox/index.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-action-on-select.story.js +80 -0
- package/lib/esm/combobox/stories/combobox-action-on-select.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-actions.story.js +76 -0
- package/lib/esm/combobox/stories/combobox-actions.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-async.story.js +73 -0
- package/lib/esm/combobox/stories/combobox-async.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-clean.story.js +36 -0
- package/lib/esm/combobox/stories/combobox-clean.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-creatable.story.js +39 -0
- package/lib/esm/combobox/stories/combobox-creatable.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-multi.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-custom-multi.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-single.story.js +42 -0
- package/lib/esm/combobox/stories/combobox-custom-single.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-trigger.story.js +58 -0
- package/lib/esm/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-default.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-default.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-descriptions.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-descriptions.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-disabled.story.js +32 -0
- package/lib/esm/combobox/stories/combobox-disabled.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-fluid.story.js +32 -0
- package/lib/esm/combobox/stories/combobox-fluid.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-groups.story.js +47 -0
- package/lib/esm/combobox/stories/combobox-groups.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-hidden-label.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-hidden-label.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-icons.story.js +44 -0
- package/lib/esm/combobox/stories/combobox-icons.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-dialog.story.js +38 -0
- package/lib/esm/combobox/stories/combobox-in-dialog.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js +38 -0
- package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-popover.story.js +34 -0
- package/lib/esm/combobox/stories/combobox-in-popover.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-large-data-set.story.js +34 -0
- package/lib/esm/combobox/stories/combobox-large-data-set.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-max-rows.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-max-rows.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-multi.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-multi.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-native-form.story.js +47 -0
- package/lib/esm/combobox/stories/combobox-native-form.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-select-only.story.js +36 -0
- package/lib/esm/combobox/stories/combobox-select-only.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-sizes.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-sizes.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-validation.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-validation.story.js.map +1 -0
- package/lib/esm/combobox/stories/index.js +100 -0
- package/lib/esm/combobox/stories/index.js.map +1 -0
- package/lib/esm/combobox/use-combobox-multi-value-overflow.js +166 -0
- package/lib/esm/combobox/use-combobox-multi-value-overflow.js.map +1 -0
- package/lib/esm/combobox/use-combobox-popover.js +77 -0
- package/lib/esm/combobox/use-combobox-popover.js.map +1 -0
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/dismissible-tag/DismissibleTag.js +1 -1
- package/lib/esm/dismissible-tag/DismissibleTag.js.map +1 -1
- package/lib/esm/icons/generated/custom/PencilSparkle.js +28 -0
- package/lib/esm/icons/generated/custom/PencilSparkle.js.map +1 -0
- package/lib/esm/icons/generated/custom/index.js +1 -0
- package/lib/esm/icons/generated/custom/index.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/select/Select.js +3 -0
- package/lib/esm/select/Select.js.map +1 -1
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/types/_common/use-semi-controlled-state.d.ts +5 -1
- package/lib/types/_common/use-semi-controlled-state.d.ts.map +1 -1
- package/lib/types/combobox/Combobox.d.ts +24 -0
- package/lib/types/combobox/Combobox.d.ts.map +1 -0
- package/lib/types/combobox/combobox-types.d.ts +419 -0
- package/lib/types/combobox/combobox-types.d.ts.map +1 -0
- package/lib/types/combobox/combobox-utils.d.ts +81 -0
- package/lib/types/combobox/combobox-utils.d.ts.map +1 -0
- package/lib/types/combobox/index.d.ts +23 -0
- package/lib/types/combobox/index.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-actions.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-actions.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-async.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-async.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-clean.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-clean.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-creatable.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-creatable.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-single.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-single.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-default.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-default.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-descriptions.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-descriptions.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-disabled.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-disabled.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-fluid.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-fluid.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-groups.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-groups.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-icons.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-icons.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-popover.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-popover.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-max-rows.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-max-rows.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-multi.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-multi.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-native-form.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-native-form.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-select-only.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-select-only.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-sizes.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-sizes.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-validation.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-validation.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/index.d.ts +73 -0
- package/lib/types/combobox/stories/index.d.ts.map +1 -0
- package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts +76 -0
- package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts.map +1 -0
- package/lib/types/combobox/use-combobox-popover.d.ts +66 -0
- package/lib/types/combobox/use-combobox-popover.d.ts.map +1 -0
- package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
- package/lib/types/dismissible-tag/DismissibleTag.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/PencilSparkle.d.ts +29 -0
- package/lib/types/icons/generated/custom/PencilSparkle.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/index.d.ts +1 -0
- package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/select/Select.d.ts +3 -0
- package/lib/types/select/Select.d.ts.map +1 -1
- package/lib/types/text-input/TextInput.d.ts.map +1 -1
- package/package.json +10 -4
- package/skills/ndl-react/SKILL.md +20 -0
- package/skills/ndl-react/components/combobox.md +1487 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-action-on-select.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-action-on-select.story.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAkE;AAClE,kDAAgE;AAChE,iCAAyC;AAEzC,MAAM,QAAQ,GAAG;IACf;QACE,WAAW,EAAE,gCAAgC;QAC7C,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,6BAA6B;KACrC;IACD;QACE,WAAW,EAAE,mDAAmD;QAChE,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,gCAAgC;KACxC;IACD;QACE,WAAW,EAAE,gDAAgD;QAC7D,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,cAAc;KACtB;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,IAAA,cAAM,EAAsB,IAAI,CAAC,CAAC;IACtD,OAAO,CACL,iCAAK,SAAS,EAAC,qCAAqC,aAClD,uBAAC,gBAAQ,IACP,GAAG,EAAE,WAAW,EAChB,KAAK,EAAC,eAAe,EACrB,KAAK,EAAE,aAAa,EACpB,cAAc,EAAE;oBACd,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;oBACzD,IAAI,EAAE,CAAC;iBACR,EACD,QAAQ,EAAC,+CAA+C,GACxD,EACF,uBAAC,gBAAQ,IACP,KAAK,EAAC,gBAAgB,EACtB,OAAO,EAAE,QAAQ,EACjB,iBAAiB,EAAC,iBAAiB,EACnC,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc;gBAC9B,kEAAkE;gBAClE,yEAAyE;gBACzE,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;;oBACpB,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;wBACrB,OAAO;oBACT,CAAC;oBAED,gBAAgB,CAAC,CAAC,YAAY,EAAE,EAAE,CAChC,YAAY,KAAK,EAAE;wBACjB,CAAC,CAAC,OAAO,CAAC,KAAK;wBACf,CAAC,CAAC,GAAG,YAAY,KAAK,OAAO,CAAC,KAAK,EAAE,CACxC,CAAC;oBACF,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,MAAA,WAAW,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;gBAC/B,CAAC,EACD,aAAa,EAAE,CAAC,EAAwB,EAAE,EAAE;wBAA5B,EAAE,GAAG,OAAmB,EAAd,YAAY,cAAtB,OAAwB,CAAF;oBAAO,OAAA,CAC3C,uBAAC,kBAAU,IACT,GAAG,EAAE,GAAmC,EACxC,WAAW,EAAC,gBAAgB,EAC5B,cAAc,EAAE,YAAY,YAE5B,uBAAC,8BAAsB,KAAG,GACf,CACd,CAAA;iBAAA,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Combobox, IconButton, TextArea } from '@neo4j-ndl/react';\nimport { CommandLineIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst commands = [\n {\n description: 'Return a small sample of nodes',\n label: 'Match nodes',\n value: 'MATCH (n) RETURN n LIMIT 25',\n },\n {\n description: 'Show the labels and relationships in the database',\n label: 'Visualize schema',\n value: 'CALL db.schema.visualization()',\n },\n {\n description: 'List the indexes available to the current user',\n label: 'Show indexes',\n value: 'SHOW INDEXES',\n },\n];\n\nconst Component = () => {\n const [terminalValue, setTerminalValue] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n return (\n <div className=\"n-flex n-gap-token-2 n-items-center\">\n <TextArea\n ref={textAreaRef}\n label=\"Command input\"\n value={terminalValue}\n htmlAttributes={{\n onChange: (event) => setTerminalValue(event.target.value),\n rows: 5,\n }}\n helpText=\"Use the button below to search for a command.\"\n />\n <Combobox\n label=\"Insert command\"\n options={commands}\n searchPlaceholder=\"Search commands\"\n searchValue={searchValue}\n onSearchChange={setSearchValue}\n // The picker activates an option but never keeps it as its value.\n // Keeping the controlled value empty avoids a persistent selected state.\n value={null}\n onChange={(command) => {\n if (command === null) {\n return;\n }\n\n setTerminalValue((currentValue) =>\n currentValue === ''\n ? command.value\n : `${currentValue}\\n${command.value}`,\n );\n setSearchValue('');\n textAreaRef.current?.focus();\n }}\n renderTrigger={({ ref, ...triggerProps }) => (\n <IconButton\n ref={ref as React.Ref<HTMLButtonElement>}\n description=\"Insert command\"\n htmlAttributes={triggerProps}\n >\n <CommandLineIconOutline />\n </IconButton>\n )}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 icons_1 = require("@neo4j-ndl/react/icons");
|
|
27
|
+
const options = [
|
|
28
|
+
{ label: 'Movie recommendations', value: 'movie-recommendations' },
|
|
29
|
+
{ label: 'Fraud detection', value: 'fraud-detection' },
|
|
30
|
+
{ label: 'Supply chain', value: 'supply-chain' },
|
|
31
|
+
{ label: 'Customer 360', value: 'customer-360' },
|
|
32
|
+
{ label: 'Knowledge graph', value: 'knowledge-graph' },
|
|
33
|
+
{ label: 'Network topology', value: 'network-topology' },
|
|
34
|
+
{ label: 'Identity resolution', value: 'identity-resolution' },
|
|
35
|
+
{ label: 'Master data management', value: 'master-data-management' },
|
|
36
|
+
{ label: 'Social network analysis', value: 'social-network-analysis' },
|
|
37
|
+
{ label: 'Route optimization', value: 'route-optimization' },
|
|
38
|
+
{ label: 'Recommendation engine', value: 'recommendation-engine' },
|
|
39
|
+
{ label: 'Access control', value: 'access-control' },
|
|
40
|
+
{ label: 'Data lineage', value: 'data-lineage' },
|
|
41
|
+
{ label: 'Entity resolution', value: 'entity-resolution' },
|
|
42
|
+
{ label: 'Bill of materials', value: 'bill-of-materials' },
|
|
43
|
+
{ label: 'Impact analysis', value: 'impact-analysis' },
|
|
44
|
+
{ label: 'Anti money laundering', value: 'anti-money-laundering' },
|
|
45
|
+
{ label: 'Dependency mapping', value: 'dependency-mapping' },
|
|
46
|
+
{ label: 'Patient journey', value: 'patient-journey' },
|
|
47
|
+
{ label: 'Content personalization', value: 'content-personalization' },
|
|
48
|
+
{ label: 'Risk assessment', value: 'risk-assessment' },
|
|
49
|
+
{ label: 'Churn prediction', value: 'churn-prediction' },
|
|
50
|
+
{ label: 'Inventory tracking', value: 'inventory-tracking' },
|
|
51
|
+
{ label: 'Semantic search', value: 'semantic-search' },
|
|
52
|
+
{ label: 'Digital twin', value: 'digital-twin' },
|
|
53
|
+
];
|
|
54
|
+
const Component = () => {
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-flex-col n-gap-token-4", children: (0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Project", placeholder: "Select project", searchPlaceholder: "Search projects", options: options,
|
|
56
|
+
// An action never becomes part of the value. It runs, the panel closes,
|
|
57
|
+
// and the selection is left as it was, which is what makes it usable for
|
|
58
|
+
// leaving the combobox entirely.
|
|
59
|
+
actions: [
|
|
60
|
+
{
|
|
61
|
+
label: 'All projects',
|
|
62
|
+
onSelect: () => console.info('all projects'),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
// A divider above the action separates it from the actions before
|
|
66
|
+
// it. The first action never needs one: it already sits below the
|
|
67
|
+
// divider that separates actions from options.
|
|
68
|
+
hasDivider: true,
|
|
69
|
+
label: 'Create project',
|
|
70
|
+
leadingVisual: (0, jsx_runtime_1.jsx)(icons_1.PlusIconOutline, {}),
|
|
71
|
+
// The search value comes along, so an unmatched query can prefill
|
|
72
|
+
// the flow the action leads to.
|
|
73
|
+
onSelect: ({ searchValue }) => console.info('create project with search value', searchValue),
|
|
74
|
+
},
|
|
75
|
+
], helpText: "actions stay pinned below the scrolling options, and are exempt from searching" }) }));
|
|
76
|
+
};
|
|
77
|
+
exports.default = Component;
|
|
78
|
+
//# 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":"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","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 { 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,75 @@
|
|
|
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 catalog = [
|
|
28
|
+
{ label: 'Neo4j', value: 'neo4j' },
|
|
29
|
+
{ label: 'Aura', value: 'aura' },
|
|
30
|
+
{ label: 'Bloom', value: 'bloom' },
|
|
31
|
+
{ label: 'Browser', value: 'browser' },
|
|
32
|
+
{ label: 'Cypher', value: 'cypher' },
|
|
33
|
+
{ label: 'Data Importer', value: 'data-importer' },
|
|
34
|
+
{ label: 'GraphQL', value: 'graphql' },
|
|
35
|
+
];
|
|
36
|
+
const SEARCH_DELAY_MS = 600;
|
|
37
|
+
const Component = () => {
|
|
38
|
+
const [searchValue, setSearchValue] = (0, react_2.useState)('');
|
|
39
|
+
const [options, setOptions] = (0, react_2.useState)([]);
|
|
40
|
+
const [isLoading, setIsLoading] = (0, react_2.useState)(false);
|
|
41
|
+
const [hasOpened, setHasOpened] = (0, react_2.useState)(false);
|
|
42
|
+
(0, react_2.useEffect)(() => {
|
|
43
|
+
if (!hasOpened) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let isCancelled = false;
|
|
47
|
+
const query = searchValue.trim().toLowerCase();
|
|
48
|
+
setIsLoading(true);
|
|
49
|
+
setOptions([]);
|
|
50
|
+
const timeoutId = window.setTimeout(() => {
|
|
51
|
+
if (isCancelled) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
setOptions(query === ''
|
|
55
|
+
? catalog
|
|
56
|
+
: catalog.filter((option) => option.label.toLowerCase().includes(query)));
|
|
57
|
+
setIsLoading(false);
|
|
58
|
+
}, SEARCH_DELAY_MS);
|
|
59
|
+
return () => {
|
|
60
|
+
isCancelled = true;
|
|
61
|
+
window.clearTimeout(timeoutId);
|
|
62
|
+
};
|
|
63
|
+
}, [hasOpened, searchValue]);
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-4", children: [(0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Products",
|
|
65
|
+
// The consumer supplies already-filtered options, so internal
|
|
66
|
+
// filtering must be disabled.
|
|
67
|
+
filterOption: false, searchValue: searchValue, onSearchChange: setSearchValue, onOpenChange: (isOpen) => {
|
|
68
|
+
if (isOpen) {
|
|
69
|
+
setIsLoading(true);
|
|
70
|
+
setHasOpened(true);
|
|
71
|
+
}
|
|
72
|
+
}, options: options, isLoading: isLoading, searchPlaceholder: "Search products" }), (0, jsx_runtime_1.jsx)(react_1.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." })] }));
|
|
73
|
+
};
|
|
74
|
+
exports.default = Component;
|
|
75
|
+
//# 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":"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","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, 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,38 @@
|
|
|
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 Component = () => {
|
|
27
|
+
const options = [
|
|
28
|
+
{ label: 'Neo4j', value: 'neo4j' },
|
|
29
|
+
{ label: 'Aura', value: 'aura' },
|
|
30
|
+
{ label: 'Bloom', value: 'bloom' },
|
|
31
|
+
{ isDisabled: true, label: 'Unavailable', value: 'unavailable' },
|
|
32
|
+
];
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Product",
|
|
34
|
+
// A clean combobox sits inline, next to whatever already names it.
|
|
35
|
+
hasVisuallyHiddenLabel: true, isClean: true, options: options, defaultValue: options[0] }));
|
|
36
|
+
};
|
|
37
|
+
exports.default = Component;
|
|
38
|
+
//# 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,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,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;KACjE,CAAC;IAEF,OAAO,CACL,uBAAC,gBAAQ,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,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: '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,41 @@
|
|
|
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 INITIAL_OPTIONS = [
|
|
28
|
+
{ label: 'Recommendations', value: 'recommendations' },
|
|
29
|
+
{ label: 'Fraud detection', value: 'fraud-detection' },
|
|
30
|
+
{ label: 'Knowledge graph', value: 'knowledge-graph' },
|
|
31
|
+
];
|
|
32
|
+
const Component = () => {
|
|
33
|
+
const [options, setOptions] = (0, react_2.useState)(INITIAL_OPTIONS);
|
|
34
|
+
const [value, setValue] = (0, react_2.useState)([]);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(react_1.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),
|
|
36
|
+
// Created options are not added to `options` by the Combobox, so they are
|
|
37
|
+
// appended here to keep them available for later selections.
|
|
38
|
+
onCreateOption: (option) => setOptions((current) => [...current, option]) }));
|
|
39
|
+
};
|
|
40
|
+
exports.default = Component;
|
|
41
|
+
//# 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,mDAAiD;AAEjD,4CAA4C;AAC5C,iCAAiC;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,IAAA,gBAAQ,EAAC,eAAe,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,CAAC;IAEjD,OAAO,CACL,uBAAC,gBAAQ,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,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 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,45 @@
|
|
|
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 base_1 = require("@neo4j-ndl/base");
|
|
26
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
27
|
+
const react_2 = require("react");
|
|
28
|
+
const options = [
|
|
29
|
+
{ color: base_1.tokens.graph['1'], label: 'Person', value: 'person' },
|
|
30
|
+
{ color: base_1.tokens.graph['2'], label: 'Movie', value: 'movie' },
|
|
31
|
+
{ color: base_1.tokens.graph['3'], label: 'Director', value: 'director' },
|
|
32
|
+
{ color: base_1.tokens.graph['4'], label: 'Actor', value: 'actor' },
|
|
33
|
+
{ color: base_1.tokens.graph['7'], label: 'Genre', value: 'genre' },
|
|
34
|
+
{ color: base_1.tokens.graph['12'], label: 'Studio', value: 'studio' },
|
|
35
|
+
];
|
|
36
|
+
// One presentation for the selected values and for the options, so both read
|
|
37
|
+
// the same. `as="span"` keeps it non-interactive, which leaves the list and the
|
|
38
|
+
// clear button as the ways to deselect.
|
|
39
|
+
const NodeLabel = ({ option, isDisabled, }) => ((0, jsx_runtime_1.jsx)(react_1.GraphLabel, { as: "span", type: "node", size: "small", color: option.color, isDisabled: isDisabled, children: option.label }));
|
|
40
|
+
const Component = () => {
|
|
41
|
+
const [value, setValue] = (0, react_2.useState)(options.slice(0, 2));
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(react_1.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 } }));
|
|
43
|
+
};
|
|
44
|
+
exports.default = Component;
|
|
45
|
+
//# 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,mDAAiD;AAEjD,0CAAyC;AACzC,4CAAwD;AACxD,iCAAiC;AAUjC,MAAM,OAAO,GAAsB;IACjC,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC9D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IAClE,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;CAChE,CAAC;AAEF,6EAA6E;AAC7E,gFAAgF;AAChF,wCAAwC;AACxC,MAAM,SAAS,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,GAIX,EAAE,EAAE,CAAC,CACJ,uBAAC,kBAAU,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,IAAA,gBAAQ,EAAoB,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE3E,OAAO,CACL,uBAAC,gBAAQ,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,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 { 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,44 @@
|
|
|
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 base_1 = require("@neo4j-ndl/base");
|
|
26
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
27
|
+
const react_2 = require("react");
|
|
28
|
+
const options = [
|
|
29
|
+
{ color: base_1.tokens.graph['1'], label: 'Person', value: 'person' },
|
|
30
|
+
{ color: base_1.tokens.graph['2'], label: 'Movie', value: 'movie' },
|
|
31
|
+
{ color: base_1.tokens.graph['3'], label: 'Director', value: 'director' },
|
|
32
|
+
{ color: base_1.tokens.graph['4'], label: 'Actor', value: 'actor' },
|
|
33
|
+
{ color: base_1.tokens.graph['7'], label: 'Genre', value: 'genre' },
|
|
34
|
+
{ color: base_1.tokens.graph['12'], label: 'Studio', value: 'studio' },
|
|
35
|
+
];
|
|
36
|
+
// One presentation for the selected value and for the options, so both read
|
|
37
|
+
// the same. `as="span"` keeps the label non-interactive.
|
|
38
|
+
const NodeLabel = ({ option, isDisabled, }) => ((0, jsx_runtime_1.jsx)(react_1.GraphLabel, { as: "span", type: "node", size: "small", color: option.color, isDisabled: isDisabled, children: option.label }));
|
|
39
|
+
const Component = () => {
|
|
40
|
+
const [value, setValue] = (0, react_2.useState)(options[0]);
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Node label", isClearable: true, options: options, value: value, onChange: setValue, components: { OptionLabel: NodeLabel, SingleValue: NodeLabel } }));
|
|
42
|
+
};
|
|
43
|
+
exports.default = Component;
|
|
44
|
+
//# 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,mDAAiD;AAEjD,0CAAyC;AACzC,4CAAwD;AACxD,iCAAiC;AAUjC,MAAM,OAAO,GAAsB;IACjC,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC9D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IAClE,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5D,EAAE,KAAK,EAAE,aAAM,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,uBAAC,kBAAU,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,IAAA,gBAAQ,EAAyB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,CACL,uBAAC,gBAAQ,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,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 { 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,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) "Neo4j"
|
|
18
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
19
|
+
*
|
|
20
|
+
* This file is part of Neo4j.
|
|
21
|
+
*
|
|
22
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
23
|
+
* it under the terms of the GNU General Public License as published by
|
|
24
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
25
|
+
* (at your option) any later version.
|
|
26
|
+
*
|
|
27
|
+
* This program is distributed in the hope that it will be useful,
|
|
28
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
29
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
30
|
+
* GNU General Public License for more details.
|
|
31
|
+
*
|
|
32
|
+
* You should have received a copy of the GNU General Public License
|
|
33
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
34
|
+
*/
|
|
35
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
36
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
37
|
+
const icons_1 = require("@neo4j-ndl/react/icons");
|
|
38
|
+
const Component = () => {
|
|
39
|
+
const options = [
|
|
40
|
+
{ label: 'Neo4j', value: 'neo4j' },
|
|
41
|
+
{ label: 'Aura', value: 'aura' },
|
|
42
|
+
{ label: 'Bloom', value: 'bloom' },
|
|
43
|
+
];
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Combobox
|
|
45
|
+
// The custom trigger renders no label of its own, so the label reaches it
|
|
46
|
+
// as its accessible name only.
|
|
47
|
+
, {
|
|
48
|
+
// The custom trigger renders no label of its own, so the label reaches it
|
|
49
|
+
// as its accessible name only.
|
|
50
|
+
label: "Product", options: options, searchPlaceholder: "Search products",
|
|
51
|
+
// The panel anchors to whichever element the props land on, and that
|
|
52
|
+
// element becomes the combobox, so it has to be focusable.
|
|
53
|
+
renderTrigger: (_a, state) => {
|
|
54
|
+
var _b, _c;
|
|
55
|
+
var { ref } = _a, triggerProps = __rest(_a, ["ref"]);
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { ref: ref, htmlAttributes: triggerProps, leadingVisual: (0, jsx_runtime_1.jsx)(icons_1.AdjustmentsHorizontalIconOutline, {}), children: (_c = (_b = state.selectedOptions[0]) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : 'Pick a product' }));
|
|
57
|
+
} }));
|
|
58
|
+
};
|
|
59
|
+
exports.default = Component;
|
|
60
|
+
//# 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,mDAAiD;AAEjD,4CAA4D;AAC5D,kDAA0E;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,uBAAC,gBAAQ;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,uBAAC,sBAAc,IACb,GAAG,EAAE,GAAmC,EACxC,cAAc,EAAE,YAAY,EAC5B,aAAa,EAAE,uBAAC,wCAAgC,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,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, 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,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 Component = () => {
|
|
27
|
+
let options = [
|
|
28
|
+
{
|
|
29
|
+
label: 'Option 1 ',
|
|
30
|
+
value: 'option-1',
|
|
31
|
+
},
|
|
32
|
+
{ label: 'Option 2', value: 'option-2' },
|
|
33
|
+
{
|
|
34
|
+
label: 'Option 3 has a really, really, really, really, long label',
|
|
35
|
+
value: 'option-3',
|
|
36
|
+
},
|
|
37
|
+
{ isDisabled: true, label: 'Option 4', value: 'option-4' },
|
|
38
|
+
];
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Products", options: options, defaultValue: options[0] }));
|
|
40
|
+
};
|
|
41
|
+
exports.default = Component;
|
|
42
|
+
//# 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,mDAAiD;AAEjD,4CAA4C;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,uBAAC,gBAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,GAAI,CAC1E,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { 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,45 @@
|
|
|
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
|
+
{
|
|
28
|
+
description: 'A fully managed graph database service',
|
|
29
|
+
label: 'AuraDB',
|
|
30
|
+
value: 'auradb',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
description: 'Graph analytics and data science tools',
|
|
34
|
+
label: 'Graph Data Science',
|
|
35
|
+
value: 'graph-data-science',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
description: 'Explore and visualize connected data',
|
|
39
|
+
label: 'Neo4j Bloom',
|
|
40
|
+
value: 'neo4j-bloom',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const Component = () => ((0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Products", options: options, placeholder: "Select product" }));
|
|
44
|
+
exports.default = Component;
|
|
45
|
+
//# 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,mDAAiD;AAEjD,4CAA4C;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,uBAAC,gBAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAC,gBAAgB,GAAG,CAC7E,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 {\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,34 @@
|
|
|
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
|
+
{ label: 'Data Importer', value: 'data-importer' },
|
|
31
|
+
];
|
|
32
|
+
const Component = () => ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-items-start n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Disabled single select", defaultValue: options[0], isDisabled: true, options: options }), (0, jsx_runtime_1.jsx)(react_1.Combobox, { label: "Disabled multi select", defaultValue: options.slice(0, 3), isDisabled: true, isMulti: true, options: options })] }));
|
|
33
|
+
exports.default = Component;
|
|
34
|
+
//# sourceMappingURL=combobox-disabled.story.js.map
|