@neo4j-ndl/react 0.1.1 → 0.1.4
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/cjs/alert/Alert.js +102 -0
- package/lib/cjs/alert/Alert.js.map +1 -0
- package/lib/{alert → cjs/alert}/index.js +6 -10
- package/lib/cjs/alert/index.js.map +1 -0
- package/lib/cjs/button/Button.js +116 -0
- package/lib/cjs/button/Button.js.map +1 -0
- package/lib/{button → cjs/button}/index.js +1 -1
- package/lib/cjs/button/index.js.map +1 -0
- package/lib/{checkbox → cjs/checkbox}/Checkbox.js +10 -20
- package/lib/cjs/checkbox/Checkbox.js.map +1 -0
- package/lib/{checkbox → cjs/checkbox}/index.js +5 -9
- package/lib/cjs/checkbox/index.js.map +1 -0
- package/lib/{context-menu → cjs/context-menu}/ContextMenu.js +78 -94
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -0
- package/lib/{context-menu → cjs/context-menu}/index.js +1 -1
- package/lib/cjs/context-menu/index.js.map +1 -0
- package/lib/{helpers → cjs/helpers}/debounce.js +7 -13
- package/lib/cjs/helpers/debounce.js.map +1 -0
- package/lib/cjs/helpers/forwardRef.js +26 -0
- package/lib/cjs/helpers/forwardRef.js.map +1 -0
- package/lib/{helpers → cjs/helpers}/index.js +2 -1
- package/lib/cjs/helpers/index.js.map +1 -0
- package/lib/cjs/helpers/testing.js +46 -0
- package/lib/cjs/helpers/testing.js.map +1 -0
- package/lib/{helpers → cjs/helpers}/types.js +1 -1
- package/lib/cjs/helpers/types.js.map +1 -0
- package/lib/{icons → cjs/icons}/Custom.js +29 -42
- package/lib/cjs/icons/Custom.js.map +1 -0
- package/lib/cjs/icons/Hero.js +55 -0
- package/lib/cjs/icons/Hero.js.map +1 -0
- package/lib/cjs/icons/custom/Circle.js +6 -0
- package/lib/cjs/icons/custom/Circle.js.map +1 -0
- package/lib/cjs/icons/custom/DatabaseAddCircle.js +6 -0
- package/lib/cjs/icons/custom/DatabaseAddCircle.js.map +1 -0
- package/lib/cjs/icons/custom/Drag.js +6 -0
- package/lib/cjs/icons/custom/Drag.js.map +1 -0
- package/lib/cjs/icons/custom/Expand.js +6 -0
- package/lib/cjs/icons/custom/Expand.js.map +1 -0
- package/lib/cjs/icons/custom/ExternalLink.js +6 -0
- package/lib/cjs/icons/custom/ExternalLink.js.map +1 -0
- package/lib/cjs/icons/custom/FitToScreen.js +6 -0
- package/lib/cjs/icons/custom/FitToScreen.js.map +1 -0
- package/lib/cjs/icons/custom/FolderBookmark.js +6 -0
- package/lib/cjs/icons/custom/FolderBookmark.js.map +1 -0
- package/lib/cjs/icons/custom/Heirarchy2.js +6 -0
- package/lib/cjs/icons/custom/Heirarchy2.js.map +1 -0
- package/lib/cjs/icons/custom/Hierarchy1.js +6 -0
- package/lib/cjs/icons/custom/Hierarchy1.js.map +1 -0
- package/lib/cjs/icons/custom/Pin.js +6 -0
- package/lib/cjs/icons/custom/Pin.js.map +1 -0
- package/lib/cjs/icons/custom/Presentation.js +6 -0
- package/lib/cjs/icons/custom/Presentation.js.map +1 -0
- package/lib/cjs/icons/custom/Rhombus.js +6 -0
- package/lib/cjs/icons/custom/Rhombus.js.map +1 -0
- package/lib/cjs/icons/custom/Shrink.js +6 -0
- package/lib/cjs/icons/custom/Shrink.js.map +1 -0
- package/lib/cjs/icons/custom/Text.js +6 -0
- package/lib/cjs/icons/custom/Text.js.map +1 -0
- package/lib/cjs/icons/custom/Triangle.js +6 -0
- package/lib/cjs/icons/custom/Triangle.js.map +1 -0
- package/lib/cjs/icons/custom/index.js +57 -0
- package/lib/cjs/icons/custom/index.js.map +1 -0
- package/lib/{icons → cjs/icons}/index.js +6 -10
- package/lib/cjs/icons/index.js.map +1 -0
- package/lib/{index.js → cjs/index.js} +2 -1
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/input/Input.js +60 -0
- package/lib/cjs/input/Input.js.map +1 -0
- package/lib/{input → cjs/input}/index.js +5 -9
- package/lib/cjs/input/index.js.map +1 -0
- package/lib/cjs/label/Label.js +103 -0
- package/lib/cjs/label/Label.js.map +1 -0
- package/lib/{label → cjs/label}/index.js +5 -9
- package/lib/cjs/label/index.js.map +1 -0
- package/lib/{loading-spinner → cjs/loading-spinner}/LoadingSpinner.js +23 -34
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -0
- package/lib/{loading-spinner → cjs/loading-spinner}/index.js +5 -9
- package/lib/cjs/loading-spinner/index.js.map +1 -0
- package/lib/{popover → cjs/popover}/Popover.js +81 -96
- package/lib/cjs/popover/Popover.js.map +1 -0
- package/lib/{popover → cjs/popover}/index.js +1 -1
- package/lib/cjs/popover/index.js.map +1 -0
- package/lib/cjs/progress-bar/ProgressBar.js +46 -0
- package/lib/cjs/progress-bar/ProgressBar.js.map +1 -0
- package/lib/{progress-bar → cjs/progress-bar}/index.js +5 -9
- package/lib/cjs/progress-bar/index.js.map +1 -0
- package/lib/{radio → cjs/radio}/Radio.js +10 -20
- package/lib/cjs/radio/Radio.js.map +1 -0
- package/lib/{radio → cjs/radio}/index.js +5 -9
- package/lib/cjs/radio/index.js.map +1 -0
- package/lib/{switch → cjs/switch}/Switch.js +10 -20
- package/lib/cjs/switch/Switch.js.map +1 -0
- package/lib/{switch → cjs/switch}/index.js +5 -9
- package/lib/cjs/switch/index.js.map +1 -0
- package/lib/cjs/tabs/Tabs.js +101 -0
- package/lib/cjs/tabs/Tabs.js.map +1 -0
- package/lib/{tabs → cjs/tabs}/index.js +1 -1
- package/lib/cjs/tabs/index.js.map +1 -0
- package/lib/{tag → cjs/tag}/Tag.js +25 -38
- package/lib/cjs/tag/Tag.js.map +1 -0
- package/lib/{tag → cjs/tag}/index.js +5 -9
- package/lib/cjs/tag/index.js.map +1 -0
- package/lib/{tooltip → cjs/tooltip}/Tooltip.js +23 -35
- package/lib/cjs/tooltip/Tooltip.js.map +1 -0
- package/lib/{tooltip → cjs/tooltip}/index.js +5 -9
- package/lib/cjs/tooltip/index.js.map +1 -0
- package/lib/{icons/Hero.js → cjs/view-selector/ViewSelector.js} +49 -52
- package/lib/cjs/view-selector/ViewSelector.js.map +1 -0
- package/lib/{view-selector → cjs/view-selector}/index.js +1 -1
- package/lib/cjs/view-selector/index.js.map +1 -0
- package/lib/esm/alert/Alert.js +95 -0
- package/lib/esm/alert/Alert.js.map +1 -0
- package/lib/esm/alert/index.js +22 -0
- package/lib/esm/alert/index.js.map +1 -0
- package/lib/esm/button/Button.js +108 -0
- package/lib/esm/button/Button.js.map +1 -0
- package/lib/esm/button/index.js +22 -0
- package/lib/esm/button/index.js.map +1 -0
- package/lib/esm/checkbox/Checkbox.js +47 -0
- package/lib/esm/checkbox/Checkbox.js.map +1 -0
- package/lib/esm/checkbox/index.js +22 -0
- package/lib/esm/checkbox/index.js.map +1 -0
- package/lib/esm/context-menu/ContextMenu.js +189 -0
- package/lib/esm/context-menu/ContextMenu.js.map +1 -0
- package/lib/esm/context-menu/index.js +22 -0
- package/lib/esm/context-menu/index.js.map +1 -0
- package/lib/esm/helpers/debounce.js +37 -0
- package/lib/esm/helpers/debounce.js.map +1 -0
- package/lib/esm/helpers/forwardRef.js +23 -0
- package/lib/esm/helpers/forwardRef.js.map +1 -0
- package/lib/esm/helpers/index.js +24 -0
- package/lib/esm/helpers/index.js.map +1 -0
- package/lib/esm/helpers/testing.js +42 -0
- package/lib/esm/helpers/testing.js.map +1 -0
- package/lib/esm/helpers/types.js +22 -0
- package/lib/esm/helpers/types.js.map +1 -0
- package/lib/esm/icons/Custom.js +41 -0
- package/lib/esm/icons/Custom.js.map +1 -0
- package/lib/esm/icons/Hero.js +33 -0
- package/lib/esm/icons/Hero.js.map +1 -0
- package/lib/esm/icons/custom/Circle.js +4 -0
- package/lib/esm/icons/custom/Circle.js.map +1 -0
- package/lib/esm/icons/custom/DatabaseAddCircle.js +4 -0
- package/lib/esm/icons/custom/DatabaseAddCircle.js.map +1 -0
- package/lib/esm/icons/custom/Drag.js +4 -0
- package/lib/esm/icons/custom/Drag.js.map +1 -0
- package/lib/esm/icons/custom/Expand.js +4 -0
- package/lib/esm/icons/custom/Expand.js.map +1 -0
- package/lib/esm/icons/custom/ExternalLink.js +4 -0
- package/lib/esm/icons/custom/ExternalLink.js.map +1 -0
- package/lib/esm/icons/custom/FitToScreen.js +4 -0
- package/lib/esm/icons/custom/FitToScreen.js.map +1 -0
- package/lib/esm/icons/custom/FolderBookmark.js +4 -0
- package/lib/esm/icons/custom/FolderBookmark.js.map +1 -0
- package/lib/esm/icons/custom/Heirarchy2.js +4 -0
- package/lib/esm/icons/custom/Heirarchy2.js.map +1 -0
- package/lib/esm/icons/custom/Hierarchy1.js +4 -0
- package/lib/esm/icons/custom/Hierarchy1.js.map +1 -0
- package/lib/esm/icons/custom/Pin.js +4 -0
- package/lib/esm/icons/custom/Pin.js.map +1 -0
- package/lib/esm/icons/custom/Presentation.js +4 -0
- package/lib/esm/icons/custom/Presentation.js.map +1 -0
- package/lib/esm/icons/custom/Rhombus.js +4 -0
- package/lib/esm/icons/custom/Rhombus.js.map +1 -0
- package/lib/esm/icons/custom/Shrink.js +4 -0
- package/lib/esm/icons/custom/Shrink.js.map +1 -0
- package/lib/esm/icons/custom/Text.js +4 -0
- package/lib/esm/icons/custom/Text.js.map +1 -0
- package/lib/esm/icons/custom/Triangle.js +4 -0
- package/lib/esm/icons/custom/Triangle.js.map +1 -0
- package/lib/esm/icons/custom/index.js +36 -0
- package/lib/esm/icons/custom/index.js.map +1 -0
- package/lib/esm/icons/index.js +23 -0
- package/lib/esm/icons/index.js.map +1 -0
- package/lib/esm/index.js +35 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/input/Input.js +55 -0
- package/lib/esm/input/Input.js.map +1 -0
- package/lib/esm/input/index.js +22 -0
- package/lib/esm/input/index.js.map +1 -0
- package/lib/esm/label/Label.js +97 -0
- package/lib/esm/label/Label.js.map +1 -0
- package/lib/esm/label/index.js +22 -0
- package/lib/esm/label/index.js.map +1 -0
- package/lib/esm/loading-spinner/LoadingSpinner.js +48 -0
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -0
- package/lib/esm/loading-spinner/index.js +22 -0
- package/lib/esm/loading-spinner/index.js.map +1 -0
- package/lib/esm/popover/Popover.js +184 -0
- package/lib/esm/popover/Popover.js.map +1 -0
- package/lib/esm/popover/index.js +22 -0
- package/lib/esm/popover/index.js.map +1 -0
- package/lib/esm/progress-bar/ProgressBar.js +41 -0
- package/lib/esm/progress-bar/ProgressBar.js.map +1 -0
- package/lib/esm/progress-bar/index.js +22 -0
- package/lib/esm/progress-bar/index.js.map +1 -0
- package/lib/esm/radio/Radio.js +43 -0
- package/lib/esm/radio/Radio.js.map +1 -0
- package/lib/esm/radio/index.js +22 -0
- package/lib/esm/radio/index.js.map +1 -0
- package/lib/esm/switch/Switch.js +43 -0
- package/lib/esm/switch/Switch.js.map +1 -0
- package/lib/esm/switch/index.js +22 -0
- package/lib/esm/switch/index.js.map +1 -0
- package/lib/esm/tabs/Tabs.js +76 -0
- package/lib/esm/tabs/Tabs.js.map +1 -0
- package/lib/esm/tabs/index.js +22 -0
- package/lib/esm/tabs/index.js.map +1 -0
- package/lib/esm/tag/Tag.js +62 -0
- package/lib/esm/tag/Tag.js.map +1 -0
- package/lib/esm/tag/index.js +22 -0
- package/lib/esm/tag/index.js.map +1 -0
- package/lib/esm/tooltip/Tooltip.js +41 -0
- package/lib/esm/tooltip/Tooltip.js.map +1 -0
- package/lib/esm/tooltip/index.js +22 -0
- package/lib/esm/tooltip/index.js.map +1 -0
- package/lib/esm/view-selector/ViewSelector.js +60 -0
- package/lib/esm/view-selector/ViewSelector.js.map +1 -0
- package/lib/esm/view-selector/index.js +22 -0
- package/lib/esm/view-selector/index.js.map +1 -0
- package/lib/{alert → types/alert}/Alert.d.ts +0 -0
- package/lib/{alert → types/alert}/index.d.ts +0 -0
- package/lib/{button → types/button}/Button.d.ts +0 -0
- package/lib/{button → types/button}/index.d.ts +0 -0
- package/lib/{checkbox → types/checkbox}/Checkbox.d.ts +0 -0
- package/lib/{checkbox → types/checkbox}/index.d.ts +0 -0
- package/lib/{context-menu → types/context-menu}/ContextMenu.d.ts +0 -0
- package/lib/{context-menu → types/context-menu}/index.d.ts +0 -0
- package/lib/{helpers → types/helpers}/debounce.d.ts +0 -0
- package/lib/types/helpers/forwardRef.d.ts +24 -0
- package/lib/{helpers → types/helpers}/index.d.ts +1 -0
- package/lib/{helpers → types/helpers}/testing.d.ts +0 -0
- package/lib/{helpers → types/helpers}/types.d.ts +0 -0
- package/lib/types/icons/Custom.d.ts +27 -0
- package/lib/types/icons/Hero.d.ts +28 -0
- package/lib/{icons → types/icons}/custom/Circle.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/DatabaseAddCircle.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Drag.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Expand.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/ExternalLink.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/FitToScreen.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/FolderBookmark.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Heirarchy2.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Hierarchy1.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Pin.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Presentation.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Rhombus.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Shrink.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Text.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/Triangle.d.ts +0 -0
- package/lib/{icons → types/icons}/custom/index.d.ts +0 -0
- package/lib/{icons → types/icons}/index.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +1 -0
- package/lib/{input → types/input}/Input.d.ts +0 -0
- package/lib/{input → types/input}/index.d.ts +0 -0
- package/lib/{label → types/label}/Label.d.ts +2 -2
- package/lib/{label → types/label}/index.d.ts +0 -0
- package/lib/{loading-spinner → types/loading-spinner}/LoadingSpinner.d.ts +0 -0
- package/lib/{loading-spinner → types/loading-spinner}/index.d.ts +0 -0
- package/lib/{popover → types/popover}/Popover.d.ts +0 -0
- package/lib/{popover → types/popover}/index.d.ts +0 -0
- package/lib/{progress-bar → types/progress-bar}/ProgressBar.d.ts +0 -0
- package/lib/{progress-bar → types/progress-bar}/index.d.ts +0 -0
- package/lib/{radio → types/radio}/Radio.d.ts +0 -0
- package/lib/{radio → types/radio}/index.d.ts +0 -0
- package/lib/{switch → types/switch}/Switch.d.ts +0 -0
- package/lib/{switch → types/switch}/index.d.ts +0 -0
- package/lib/{tabs → types/tabs}/Tabs.d.ts +0 -0
- package/lib/{tabs → types/tabs}/index.d.ts +0 -0
- package/lib/{tag → types/tag}/Tag.d.ts +0 -0
- package/lib/{tag → types/tag}/index.d.ts +0 -0
- package/lib/{tooltip → types/tooltip}/Tooltip.d.ts +0 -0
- package/lib/{tooltip → types/tooltip}/index.d.ts +0 -0
- package/lib/{view-selector → types/view-selector}/ViewSelector.d.ts +2 -2
- package/lib/{view-selector → types/view-selector}/index.d.ts +0 -0
- package/package.json +16 -8
- package/lib/alert/Alert.js +0 -121
- package/lib/alert/Alert.js.map +0 -1
- package/lib/alert/index.js.map +0 -1
- package/lib/button/Button.js +0 -112
- package/lib/button/Button.js.map +0 -1
- package/lib/button/index.js.map +0 -1
- package/lib/checkbox/Checkbox.js.map +0 -1
- package/lib/checkbox/index.js.map +0 -1
- package/lib/context-menu/ContextMenu.js.map +0 -1
- package/lib/context-menu/index.js.map +0 -1
- package/lib/helpers/debounce.js.map +0 -1
- package/lib/helpers/index.js.map +0 -1
- package/lib/helpers/testing.js +0 -81
- package/lib/helpers/testing.js.map +0 -1
- package/lib/helpers/types.js.map +0 -1
- package/lib/icons/Custom.d.ts +0 -27
- package/lib/icons/Custom.js.map +0 -1
- package/lib/icons/Hero.d.ts +0 -28
- package/lib/icons/Hero.js.map +0 -1
- package/lib/icons/custom/Circle.js +0 -57
- package/lib/icons/custom/Circle.js.map +0 -1
- package/lib/icons/custom/DatabaseAddCircle.js +0 -57
- package/lib/icons/custom/DatabaseAddCircle.js.map +0 -1
- package/lib/icons/custom/Drag.js +0 -62
- package/lib/icons/custom/Drag.js.map +0 -1
- package/lib/icons/custom/Expand.js +0 -57
- package/lib/icons/custom/Expand.js.map +0 -1
- package/lib/icons/custom/ExternalLink.js +0 -57
- package/lib/icons/custom/ExternalLink.js.map +0 -1
- package/lib/icons/custom/FitToScreen.js +0 -57
- package/lib/icons/custom/FitToScreen.js.map +0 -1
- package/lib/icons/custom/FolderBookmark.js +0 -57
- package/lib/icons/custom/FolderBookmark.js.map +0 -1
- package/lib/icons/custom/Heirarchy2.js +0 -57
- package/lib/icons/custom/Heirarchy2.js.map +0 -1
- package/lib/icons/custom/Hierarchy1.js +0 -57
- package/lib/icons/custom/Hierarchy1.js.map +0 -1
- package/lib/icons/custom/Pin.js +0 -57
- package/lib/icons/custom/Pin.js.map +0 -1
- package/lib/icons/custom/Presentation.js +0 -57
- package/lib/icons/custom/Presentation.js.map +0 -1
- package/lib/icons/custom/Rhombus.js +0 -57
- package/lib/icons/custom/Rhombus.js.map +0 -1
- package/lib/icons/custom/Shrink.js +0 -57
- package/lib/icons/custom/Shrink.js.map +0 -1
- package/lib/icons/custom/Text.js +0 -57
- package/lib/icons/custom/Text.js.map +0 -1
- package/lib/icons/custom/Triangle.js +0 -57
- package/lib/icons/custom/Triangle.js.map +0 -1
- package/lib/icons/custom/index.js +0 -61
- package/lib/icons/custom/index.js.map +0 -1
- package/lib/icons/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/input/Input.js +0 -92
- package/lib/input/Input.js.map +0 -1
- package/lib/input/index.js.map +0 -1
- package/lib/label/Label.js +0 -103
- package/lib/label/Label.js.map +0 -1
- package/lib/label/index.js.map +0 -1
- package/lib/loading-spinner/LoadingSpinner.js.map +0 -1
- package/lib/loading-spinner/index.js.map +0 -1
- package/lib/popover/Popover.js.map +0 -1
- package/lib/popover/index.js.map +0 -1
- package/lib/progress-bar/ProgressBar.js +0 -64
- package/lib/progress-bar/ProgressBar.js.map +0 -1
- package/lib/progress-bar/index.js.map +0 -1
- package/lib/radio/Radio.js.map +0 -1
- package/lib/radio/index.js.map +0 -1
- package/lib/switch/Switch.js.map +0 -1
- package/lib/switch/index.js.map +0 -1
- package/lib/tabs/Tabs.js +0 -114
- package/lib/tabs/Tabs.js.map +0 -1
- package/lib/tabs/index.js.map +0 -1
- package/lib/tag/Tag.js.map +0 -1
- package/lib/tag/index.js.map +0 -1
- package/lib/tooltip/Tooltip.js.map +0 -1
- package/lib/tooltip/index.js.map +0 -1
- package/lib/view-selector/ViewSelector.js +0 -95
- package/lib/view-selector/ViewSelector.js.map +0 -1
- package/lib/view-selector/index.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
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, jsxs as _jsxs } 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 React from 'react';
|
|
34
|
+
import classnames from 'classnames';
|
|
35
|
+
import { LoadingSpinner } from '../loading-spinner';
|
|
36
|
+
export const removeNewlines = (input) => input.replace(/(\r\n|\n|\r)/gm, '');
|
|
37
|
+
/** Remove extra spaces from sting */
|
|
38
|
+
export const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
|
|
39
|
+
export const Button = React.forwardRef(function Button(_a, ref) {
|
|
40
|
+
var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = 'regular', className, onClick, tabIndex = 0 } = _a, props = __rest(_a, ["children", "as", "type", "loading", "color", "disabled", "fill", "rectangle", "buttonSize", "className", "onClick", "tabIndex"]);
|
|
41
|
+
let Component = as || 'button';
|
|
42
|
+
if (!as && props.href) {
|
|
43
|
+
Component = 'a';
|
|
44
|
+
}
|
|
45
|
+
const interactable = !disabled && !loading;
|
|
46
|
+
const classes = classnames(`ndl-btn ${fill} ${buttonSize}`, {
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
loading: loading,
|
|
49
|
+
rectangle: rectangle,
|
|
50
|
+
/** Now check button is outlined or filled */
|
|
51
|
+
/**
|
|
52
|
+
* Notice:
|
|
53
|
+
* "Hover" here does not exist for "warning" and "success"
|
|
54
|
+
* and is custom for Neutral
|
|
55
|
+
*/
|
|
56
|
+
[`
|
|
57
|
+
${color === 'neutral'
|
|
58
|
+
? `n-bg-light-${color}-bg-strongest`
|
|
59
|
+
: `n-bg-light-${color}-bg-strong`}
|
|
60
|
+
${interactable && `hover:n-bg-light-${color}-hover-strong`}
|
|
61
|
+
`]: fill === 'filled',
|
|
62
|
+
[`
|
|
63
|
+
n-text-light-${color}-text
|
|
64
|
+
${interactable && `hover:n-bg-light-${color}-hover-weak`}
|
|
65
|
+
n-border-light-${color}-bg-strong
|
|
66
|
+
`]: fill === 'outlined' && color !== 'neutral',
|
|
67
|
+
/**
|
|
68
|
+
* Neutral needs overriding as it doesn't follow
|
|
69
|
+
* the same principles with colored variations
|
|
70
|
+
*/
|
|
71
|
+
[`
|
|
72
|
+
n-text-${color}-80
|
|
73
|
+
n-bg-${color}-10
|
|
74
|
+
${interactable && `hover:n-bg-${color}-20`}
|
|
75
|
+
n-border-${color}-60
|
|
76
|
+
`]: fill === 'outlined' && color === 'neutral',
|
|
77
|
+
[`
|
|
78
|
+
n-text-${color}-50
|
|
79
|
+
${interactable && `hover:n-bg-${color}-10`}
|
|
80
|
+
`]: fill === 'text' && color !== 'neutral',
|
|
81
|
+
[`
|
|
82
|
+
n-text-light-neutral-text-weak
|
|
83
|
+
${interactable && `hover:n-bg-light-neutral-bg-default`}
|
|
84
|
+
`]: fill === 'text' && color == 'neutral',
|
|
85
|
+
});
|
|
86
|
+
const sanitisedClasses = removeSpaces(removeNewlines(classes));
|
|
87
|
+
const handleClick = (e) => {
|
|
88
|
+
if (!interactable) {
|
|
89
|
+
// By default, a <button /> element with disabled set to true will not get its
|
|
90
|
+
// on click handler called. To support the same behavior on <a /> tags we
|
|
91
|
+
// swallow the event here when disabled, since the <a /> tag with disabled set to
|
|
92
|
+
// true will have its onClick handler called
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (onClick) {
|
|
98
|
+
onClick(e);
|
|
99
|
+
}
|
|
100
|
+
else if (!props.href) {
|
|
101
|
+
console.error('onClick was not provided');
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return (_jsxs(Component
|
|
105
|
+
/** First props and then className to avoid overriding in classNames */
|
|
106
|
+
, Object.assign({}, props, (Component === 'button' ? { type } : {}), { onClick: handleClick, disabled: !interactable, className: [sanitisedClasses, className].join(' '), ref: ref, tabIndex: !interactable ? -1 : tabIndex }, { children: [loading ? (_jsx(LoadingSpinner, { className: "n-my-auto n-mr-1", size: "small" }, void 0)) : null, children] }), void 0));
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AA8BpC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CACpD,EAcc,EACd,GAAG;QAfH,EACE,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,QAAQ,EACf,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,OAAO,EACP,QAAQ,GAAG,CAAC,OAEA,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AkD,EAAE,EAAE;QACzE,IAAI,CAAC,YAAY,EAAE;YACjB,8EAA8E;YAC9E,yEAAyE;YACzE,iFAAiF;YACjF,4CAA4C;YAC5C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,OAAO;SACR;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,SAAS;IACR,uEAAuE;wBACnE,KAAK,EAEL,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,YAAY,EACvB,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAClD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,iBAEtC,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,cAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,WAAG,CAC7D,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,aACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './Button';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 React from 'react';
|
|
23
|
+
import { Input } from '../input';
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* Helpers
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/** Add any helper functions here. */
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* Checkbox Component
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
const Checkbox = React.forwardRef((props, ref) => {
|
|
40
|
+
if (!props['aria-label'] && !props.label) {
|
|
41
|
+
console.warn('To be accesible the input component requires either `aria-label` or `label` prop: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
|
|
42
|
+
}
|
|
43
|
+
return _jsx(Input, Object.assign({}, props, { ref: ref, type: "checkbox", role: "checkbox" }), void 0);
|
|
44
|
+
});
|
|
45
|
+
Checkbox.displayName = 'Checkbox';
|
|
46
|
+
export default Checkbox;
|
|
47
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,KAAiB,EAAE,GAAyC,EAAE,EAAE;IAC/D,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QACxC,OAAO,CAAC,IAAI,CACV,sJAAsJ,CACvJ,CAAC;KACH;IAED,OAAO,KAAC,KAAK,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,YAAG,CAAC;AACxE,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export { default as Checkbox } from './Checkbox';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
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, jsxs as _jsxs } 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 React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
34
|
+
import { HeroIcon } from '../icons';
|
|
35
|
+
import { Popover } from '../popover';
|
|
36
|
+
import classnames from 'classnames';
|
|
37
|
+
const MenuContext = React.createContext(null);
|
|
38
|
+
const useMenuContext = () => {
|
|
39
|
+
const context = useContext(MenuContext);
|
|
40
|
+
if (context === null) {
|
|
41
|
+
throw new Error('Menu used without context. Did you render this component inside a <Menu />?');
|
|
42
|
+
}
|
|
43
|
+
return context;
|
|
44
|
+
};
|
|
45
|
+
export const Menu = forwardRef(function Menu(_a, ref) {
|
|
46
|
+
var { menuSize = 'small', className, minWidth = 250, open, onClose, children } = _a, rest = __rest(_a, ["menuSize", "className", "minWidth", "open", "onClose", "children"]);
|
|
47
|
+
const menuRef = useRef();
|
|
48
|
+
const focusFirstMenuItem = useCallback(() => {
|
|
49
|
+
const menu = menuRef.current;
|
|
50
|
+
if (!menu)
|
|
51
|
+
return;
|
|
52
|
+
const items = menu.querySelectorAll(':scope > .menu-items > .menu-item');
|
|
53
|
+
if (items.length === 0) {
|
|
54
|
+
menu.focus();
|
|
55
|
+
}
|
|
56
|
+
items[0].focus();
|
|
57
|
+
}, []);
|
|
58
|
+
// Override ref to map to internal ref
|
|
59
|
+
// as well as change focus to focus the
|
|
60
|
+
// first menu item
|
|
61
|
+
useImperativeHandle(ref, () => {
|
|
62
|
+
const menu = menuRef.current;
|
|
63
|
+
if (!menu) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return Object.assign(Object.assign({}, menu), { focus: focusFirstMenuItem });
|
|
67
|
+
});
|
|
68
|
+
// Focus first menu item on open.
|
|
69
|
+
// This effect is separate from the above
|
|
70
|
+
// `setPositiongStyles` effect as the above
|
|
71
|
+
// is triggered on every render usually as
|
|
72
|
+
// anchorOrigin and transformOrigin
|
|
73
|
+
// are typically not memoized
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (open) {
|
|
76
|
+
focusFirstMenuItem();
|
|
77
|
+
}
|
|
78
|
+
}, [open, focusFirstMenuItem]);
|
|
79
|
+
const classes = classnames('ndl-menu', menuSize, className);
|
|
80
|
+
return (_jsx(MenuContext.Provider, Object.assign({ value: { onClose } }, { children: _jsx(Popover, Object.assign({ tabIndex: -1 }, rest, { open: open, style: Object.assign({ minWidth }, (rest.style || {})), className: classes, ref: menuRef, onClose: onClose }, { children: children }), void 0) }), void 0));
|
|
81
|
+
});
|
|
82
|
+
const getMenuItem = (menuItems, iterator) => {
|
|
83
|
+
const activeElement = document.activeElement;
|
|
84
|
+
let newEl = iterator(menuItems, activeElement);
|
|
85
|
+
let menuItem = null;
|
|
86
|
+
// Iterate over next element until we find a menu item
|
|
87
|
+
// Iterate a maximum of 10 times looking for an element
|
|
88
|
+
for (let i = 0; i < 10; i++) {
|
|
89
|
+
// Can't find new element, break
|
|
90
|
+
if (!newEl) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const role = newEl.getAttribute('role');
|
|
94
|
+
if (role === 'menuitem') {
|
|
95
|
+
menuItem = newEl;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
newEl = iterator(menuItems, newEl);
|
|
99
|
+
}
|
|
100
|
+
return menuItem;
|
|
101
|
+
};
|
|
102
|
+
// Gets next sibling child of the menu items, looping at the end
|
|
103
|
+
const nextElement = (menuItems, currentEl) => {
|
|
104
|
+
if (currentEl === menuItems || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.nextElementSibling)) {
|
|
105
|
+
return menuItems.firstChild ? menuItems.firstChild : null;
|
|
106
|
+
}
|
|
107
|
+
else if (currentEl === null || currentEl === void 0 ? void 0 : currentEl.nextElementSibling) {
|
|
108
|
+
return currentEl.nextElementSibling;
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
};
|
|
112
|
+
// Gets prev sibling child of the menu items, looping at the top
|
|
113
|
+
const prevElement = (menuItems, currentEl) => {
|
|
114
|
+
if (currentEl === menuItems || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.previousElementSibling)) {
|
|
115
|
+
return menuItems.lastChild ? menuItems.lastChild : null;
|
|
116
|
+
}
|
|
117
|
+
else if (currentEl === null || currentEl === void 0 ? void 0 : currentEl.previousElementSibling) {
|
|
118
|
+
return currentEl.previousElementSibling;
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
};
|
|
122
|
+
export const MenuItems = forwardRef(function MenuItems(_a, ref) {
|
|
123
|
+
var { as = 'ul', children, className } = _a, rest = __rest(_a, ["as", "children", "className"]);
|
|
124
|
+
const menuItemsRef = useRef();
|
|
125
|
+
const { onClose } = useMenuContext();
|
|
126
|
+
const handleKeyDown = (event) => {
|
|
127
|
+
const menuItems = menuItemsRef.current;
|
|
128
|
+
if (!menuItems) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (event.key == 'ArrowDown') {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
event.stopPropagation();
|
|
134
|
+
const newFocusedElement = getMenuItem(menuItems, nextElement);
|
|
135
|
+
newFocusedElement === null || newFocusedElement === void 0 ? void 0 : newFocusedElement.focus();
|
|
136
|
+
}
|
|
137
|
+
else if (event.key == 'ArrowUp') {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
const newFocusedElement = getMenuItem(menuItems, prevElement);
|
|
141
|
+
newFocusedElement === null || newFocusedElement === void 0 ? void 0 : newFocusedElement.focus();
|
|
142
|
+
}
|
|
143
|
+
else if (event.key == 'Tab' || event.key == 'Escape') {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
onClose && onClose(event);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
useImperativeHandle(ref, () => menuItemsRef.current);
|
|
149
|
+
const Component = as;
|
|
150
|
+
const classes = classnames('menu-items', className);
|
|
151
|
+
return (_jsx(Component, Object.assign({ tabIndex: -1, onKeyDown: handleKeyDown, role: "menu" }, rest, { className: classes, ref: menuItemsRef }, { children: children }), void 0));
|
|
152
|
+
});
|
|
153
|
+
export const MenuItem = forwardRef(function MenuItem(_a, ref) {
|
|
154
|
+
var { as = 'li', icon, title, description, className, disabled = false, onClick, onKeyDown } = _a, rest = __rest(_a, ["as", "icon", "title", "description", "className", "disabled", "onClick", "onKeyDown"]);
|
|
155
|
+
const Component = as;
|
|
156
|
+
const classes = classnames(`menu-item n-flex n-flex-col`, className, {
|
|
157
|
+
disabled,
|
|
158
|
+
});
|
|
159
|
+
const handleClick = (e) => {
|
|
160
|
+
if (disabled) {
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (onClick)
|
|
165
|
+
onClick(e);
|
|
166
|
+
};
|
|
167
|
+
const handleKeyDown = (e) => {
|
|
168
|
+
if (onKeyDown)
|
|
169
|
+
onKeyDown(e);
|
|
170
|
+
if (e.key === 'Enter') {
|
|
171
|
+
if (disabled) {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (onClick)
|
|
176
|
+
onClick(e);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return (_jsxs(Component, Object.assign({ tabIndex: -1, role: "menuitem" }, rest, { className: classes, onClick: handleClick, onKeyDown: handleKeyDown, ref: ref }, { children: [_jsxs("div", Object.assign({ className: "n-flex n-items-center" }, { children: [icon && _jsx("div", Object.assign({ className: "menu-item-icon" }, { children: icon }), void 0), _jsx("div", Object.assign({ className: "menu-item-title" }, { children: title }), void 0)] }), void 0), description && (_jsx("div", Object.assign({ className: "menu-item-description" }, { children: description }), void 0))] }), void 0));
|
|
180
|
+
});
|
|
181
|
+
export const MenuHeader = forwardRef(function MenuHeader(_a, ref) {
|
|
182
|
+
var { as = 'div', title, description, className } = _a, rest = __rest(_a, ["as", "title", "description", "className"]);
|
|
183
|
+
const Component = as;
|
|
184
|
+
const { onClose } = useMenuContext();
|
|
185
|
+
const handleClose = (e) => onClose && onClose(e);
|
|
186
|
+
const classes = classnames('menu-header n-flex n-flex-col', className);
|
|
187
|
+
return (_jsxs(Component, Object.assign({}, rest, { className: classes, ref: ref }, { children: [_jsxs("div", Object.assign({ className: "n-flex n-justify-between n-items-center" }, { children: [_jsx("div", Object.assign({ className: "menu-header-title" }, { children: title }), void 0), _jsx("div", Object.assign({ tabIndex: 0, role: "button", onKeyDown: handleClose, onClick: handleClose, className: "menu-header-icon" }, { children: _jsx(HeroIcon, { iconName: "XIcon" }, void 0) }), void 0)] }), void 0), description && (_jsx("div", Object.assign({ className: "menu-header-description" }, { children: description }), void 0))] }), void 0));
|
|
188
|
+
});
|
|
189
|
+
//# sourceMappingURL=ContextMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.js","sourceRoot":"","sources":["../../../src/context-menu/ContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;AACnD,OAAO,UAAU,MAAM,YAAY,CAAC;AAiBpC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAyB,IAAI,CAAC,CAAC;AAEtE,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,IAAI,CAC1C,EAQmB,EACnB,GAAG;QATH,EACE,QAAQ,GAAG,OAAO,EAClB,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,IAAI,EACJ,OAAO,EACP,QAAQ,OAES,EADd,IAAI,cAPT,oEAQC,CADQ;IAIT,MAAM,OAAO,GAAG,MAAM,EAAe,CAAC;IAEtC,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,mCAAmC,CAAC,CAAC;QACzE,IAA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AAK,SAAS,EAAC,mBAAmB,gBAAE,KAAK,YAAO,EAChD,4BACE,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,kBAAkB,gBAE5B,KAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,WAAG,YACzB,aACF,EACL,WAAW,IAAI,CACd,4BAAK,SAAS,EAAC,yBAAyB,gBAAE,WAAW,YAAO,CAC7D,aACS,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './ContextMenu';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context-menu/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
// Corresponds to 10 frames at 60 Hz.
|
|
22
|
+
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
23
|
+
export function debounce(func, wait = 166) {
|
|
24
|
+
let timeout;
|
|
25
|
+
function debounced(...args) {
|
|
26
|
+
const later = () => {
|
|
27
|
+
func.apply(this, args);
|
|
28
|
+
};
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
timeout = setTimeout(later, wait);
|
|
31
|
+
}
|
|
32
|
+
debounced.clear = () => {
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
};
|
|
35
|
+
return debounced;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../../src/helpers/debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qCAAqC;AACrC,kFAAkF;AAClF,MAAM,UAAU,QAAQ,CAAC,IAAqC,EAAE,IAAI,GAAG,GAAG;IACxE,IAAI,OAAuB,CAAC;IAC5B,SAAS,SAAS,CAAgB,GAAG,IAAe;QAClD,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;QACF,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE;QACrB,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import { forwardRef as reactForwardRef, } from 'react';
|
|
22
|
+
export const forwardRef = reactForwardRef;
|
|
23
|
+
//# sourceMappingURL=forwardRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwardRef.js","sourceRoot":"","sources":["../../../src/helpers/forwardRef.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAEL,UAAU,IAAI,eAAe,GAG9B,MAAM,OAAO,CAAC;AAYf,MAAM,CAAC,MAAM,UAAU,GAAG,eAAiC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './debounce';
|
|
22
|
+
export * from './types';
|
|
23
|
+
export * from './forwardRef';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
import { axe } from 'jest-axe';
|
|
31
|
+
/**
|
|
32
|
+
* A11y testing with Axe
|
|
33
|
+
* Jest helper to the container for HTML
|
|
34
|
+
* inaccessibilities
|
|
35
|
+
*
|
|
36
|
+
* More: https://github.com/nickcolley/jest-axe
|
|
37
|
+
*/
|
|
38
|
+
export const a11yValidation = (container) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
const results = yield axe(container);
|
|
40
|
+
expect(results).toHaveNoViolations();
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/helpers/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAO,SAAsB,EAAE,EAAE;IAC7D,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACvC,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/helpers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|