@eccenca/gui-elements 22.0.0-rc.7 → 22.1.0-rc.1
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/CHANGELOG.md +36 -4
- package/README.md +21 -7
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +23 -15
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +23 -6
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +59 -31
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/index.js +11 -0
- package/dist/cjs/cmem/ActivityControl/index.js.map +1 -0
- package/dist/cjs/cmem/ContentBlobToggler/index.js +8 -0
- package/dist/cjs/cmem/ContentBlobToggler/index.js.map +1 -0
- package/dist/cjs/cmem/index.js +14 -13
- package/dist/cjs/cmem/index.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +57 -0
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/dist/cjs/cmem/react-flow/configuration/graph.js +31 -0
- package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/linking.js +29 -0
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/unspecified.js +15 -0
- package/dist/cjs/cmem/react-flow/configuration/unspecified.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/workflow.js +27 -0
- package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -0
- package/dist/cjs/common/utils/stringUtils.js +7 -0
- package/dist/cjs/common/utils/stringUtils.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationContent.js +1 -7
- package/dist/cjs/components/Application/ApplicationContent.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationTitle.js +1 -7
- package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +284 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +81 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +46 -0
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +12 -15
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Card/Card.js +18 -3
- package/dist/cjs/components/Card/Card.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +2 -2
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Form/FieldItemRow.js +2 -3
- package/dist/cjs/components/Form/FieldItemRow.js.map +1 -1
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +30 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +212 -0
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/cjs/components/Notification/Notification.js +8 -2
- package/dist/cjs/components/Notification/Notification.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemList.js +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +1 -1
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Tabs/Tab.js +94 -0
- package/dist/cjs/components/Tabs/Tab.js.map +1 -0
- package/dist/cjs/components/Tabs/TabTitle.js +20 -0
- package/dist/cjs/components/Tabs/TabTitle.js.map +1 -0
- package/dist/cjs/components/Tabs/Tabs.js +26 -19
- package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js +7 -1
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/Typography/HtmlContentBlock.js +6 -6
- package/dist/cjs/components/Typography/HtmlContentBlock.js.map +1 -1
- package/dist/cjs/components/Typography/classnames.js +2 -1
- package/dist/cjs/components/Typography/classnames.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/getSmoothStepPath.js +98 -0
- package/dist/cjs/extensions/react-flow/edges/getSmoothStepPath.js.map +1 -0
- package/dist/cjs/extensions/react-flow/edges/utils.js +97 -4
- package/dist/cjs/extensions/react-flow/edges/utils.js.map +1 -1
- package/dist/cjs/extensions/react-flow/index.js +5 -1
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/utils.js +2 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +141 -0
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -0
- package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +41 -0
- package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -0
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +3 -130
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +11 -9
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/cjs/index.js +17 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/Button.js +61 -0
- package/dist/cjs/legacy-replacements/Button/Button.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/DismissiveButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/DismissiveButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js +55 -0
- package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
- package/dist/cjs/legacy-replacements/Radio/RadioButton.js +48 -0
- package/dist/cjs/legacy-replacements/Radio/RadioButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Tabs/Tabs.js +36 -0
- package/dist/cjs/legacy-replacements/Tabs/Tabs.js.map +1 -0
- package/dist/cjs/legacy-replacements/TextField/TextField.js +75 -0
- package/dist/cjs/legacy-replacements/TextField/TextField.js.map +1 -0
- package/dist/cjs/legacy-replacements/index.js +22 -0
- package/dist/cjs/legacy-replacements/index.js.map +1 -0
- package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js +23 -15
- package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/es5/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +21 -4
- package/dist/es5/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/es5/cmem/ActivityControl/SilkActivityControl.js +57 -31
- package/dist/es5/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/es5/cmem/ActivityControl/index.js +4 -0
- package/dist/es5/cmem/ActivityControl/index.js.map +1 -0
- package/dist/es5/cmem/ContentBlobToggler/index.js +3 -0
- package/dist/es5/cmem/ContentBlobToggler/index.js.map +1 -0
- package/dist/es5/cmem/index.js +6 -8
- package/dist/es5/cmem/index.js.map +1 -1
- package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js +43 -0
- package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/dist/es5/cmem/react-flow/configuration/graph.js +23 -0
- package/dist/es5/cmem/react-flow/configuration/graph.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/linking.js +21 -0
- package/dist/es5/cmem/react-flow/configuration/linking.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/unspecified.js +12 -0
- package/dist/es5/cmem/react-flow/configuration/unspecified.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/workflow.js +19 -0
- package/dist/es5/cmem/react-flow/configuration/workflow.js.map +1 -0
- package/dist/es5/common/utils/stringUtils.js +3 -0
- package/dist/es5/common/utils/stringUtils.js.map +1 -0
- package/dist/es5/components/Application/ApplicationContent.js +1 -7
- package/dist/es5/components/Application/ApplicationContent.js.map +1 -1
- package/dist/es5/components/Application/ApplicationTitle.js +1 -7
- package/dist/es5/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/es5/components/AutoSuggestion/AutoSuggestion.js +346 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js +93 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
- package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js +42 -0
- package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
- package/dist/es5/components/AutocompleteField/AutoCompleteField.js +12 -15
- package/dist/es5/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/es5/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/es5/components/Button/Button.js +1 -1
- package/dist/es5/components/Button/Button.js.map +1 -1
- package/dist/es5/components/Card/Card.js +18 -3
- package/dist/es5/components/Card/Card.js.map +1 -1
- package/dist/es5/components/ContextOverlay/ContextMenu.js +1 -1
- package/dist/es5/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/es5/components/Dialog/Modal.js +2 -2
- package/dist/es5/components/Dialog/Modal.js.map +1 -1
- package/dist/es5/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/es5/components/Form/FieldItemRow.js +2 -3
- package/dist/es5/components/Form/FieldItemRow.js.map +1 -1
- package/dist/es5/components/Icon/Icon.js.map +1 -1
- package/dist/es5/components/Icon/canonicalIconNames.js +30 -0
- package/dist/es5/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/es5/components/MultiSelect/MultiSelect.js +290 -0
- package/dist/es5/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/es5/components/Notification/Notification.js +10 -3
- package/dist/es5/components/Notification/Notification.js.map +1 -1
- package/dist/es5/components/OverviewItem/OverviewItemList.js +1 -1
- package/dist/es5/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/es5/components/Spinner/Spinner.js +2 -2
- package/dist/es5/components/Spinner/Spinner.js.map +1 -1
- package/dist/es5/components/Tabs/Tab.js +97 -0
- package/dist/es5/components/Tabs/Tab.js.map +1 -0
- package/dist/es5/components/Tabs/TabTitle.js +16 -0
- package/dist/es5/components/Tabs/TabTitle.js.map +1 -0
- package/dist/es5/components/Tabs/Tabs.js +8 -21
- package/dist/es5/components/Tabs/Tabs.js.map +1 -1
- package/dist/es5/components/Tag/Tag.js +7 -1
- package/dist/es5/components/Tag/Tag.js.map +1 -1
- package/dist/es5/components/Typography/HtmlContentBlock.js +17 -8
- package/dist/es5/components/Typography/HtmlContentBlock.js.map +1 -1
- package/dist/es5/components/Typography/classnames.js +1 -0
- package/dist/es5/components/Typography/classnames.js.map +1 -1
- package/dist/es5/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/es5/extensions/react-flow/edges/getSmoothStepPath.js +119 -0
- package/dist/es5/extensions/react-flow/edges/getSmoothStepPath.js.map +1 -0
- package/dist/es5/extensions/react-flow/edges/utils.js +100 -5
- package/dist/es5/extensions/react-flow/edges/utils.js.map +1 -1
- package/dist/es5/extensions/react-flow/index.js +2 -0
- package/dist/es5/extensions/react-flow/index.js.map +1 -1
- package/dist/es5/extensions/react-flow/minimap/utils.js +1 -1
- package/dist/es5/extensions/react-flow/nodes/NodeContent.js +162 -0
- package/dist/es5/extensions/react-flow/nodes/NodeContent.js.map +1 -0
- package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js +45 -0
- package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -0
- package/dist/es5/extensions/react-flow/nodes/NodeDefault.js +2 -129
- package/dist/es5/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/es5/extensions/react-flow/nodes/NodeTools.js +12 -10
- package/dist/es5/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/es5/index.js +9 -4
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/legacy-replacements/Button/AffirmativeButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/Button.js +65 -0
- package/dist/es5/legacy-replacements/Button/Button.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/DismissiveButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/DismissiveButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/DisruptiveButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Checkbox/Checkbox.js +59 -0
- package/dist/es5/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
- package/dist/es5/legacy-replacements/Radio/RadioButton.js +52 -0
- package/dist/es5/legacy-replacements/Radio/RadioButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Tabs/Tabs.js +40 -0
- package/dist/es5/legacy-replacements/Tabs/Tabs.js.map +1 -0
- package/dist/es5/legacy-replacements/TextField/TextField.js +81 -0
- package/dist/es5/legacy-replacements/TextField/TextField.js.map +1 -0
- package/dist/es5/legacy-replacements/index.js +10 -0
- package/dist/es5/legacy-replacements/index.js.map +1 -0
- package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +2 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +48 -2
- package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +18 -3
- package/dist/types/cmem/ActivityControl/index.d.ts +3 -0
- package/dist/types/cmem/ContentBlobToggler/index.d.ts +2 -0
- package/dist/types/cmem/index.d.ts +8 -8
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
- package/dist/types/cmem/react-flow/configuration/graph.d.ts +21 -0
- package/dist/types/cmem/react-flow/configuration/linking.d.ts +19 -0
- package/dist/types/cmem/react-flow/configuration/unspecified.d.ts +9 -0
- package/dist/types/cmem/react-flow/configuration/workflow.d.ts +17 -0
- package/dist/types/common/utils/stringUtils.d.ts +2 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +67 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +13 -0
- package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +25 -0
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +8 -7
- package/dist/types/components/Button/Button.d.ts +3 -2
- package/dist/types/components/Card/Card.d.ts +9 -4
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +6 -1
- package/dist/types/components/Dialog/Modal.d.ts +4 -3
- package/dist/types/components/Dialog/SimpleDialog.d.ts +2 -0
- package/dist/types/components/Form/FieldItemRow.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +86 -0
- package/dist/types/components/Notification/Notification.d.ts +55 -2
- package/dist/types/components/OverviewItem/OverviewItemList.d.ts +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts +1 -1
- package/dist/types/components/Tabs/Tab.d.ts +549 -0
- package/dist/types/components/Tabs/TabTitle.d.ts +38 -0
- package/dist/types/components/Tabs/Tabs.d.ts +14 -20
- package/dist/types/components/Tag/Tag.d.ts +1 -1
- package/dist/types/components/Typography/HtmlContentBlock.d.ts +15 -5
- package/dist/types/components/Typography/classnames.d.ts +1 -0
- package/dist/types/extensions/react-flow/edges/getSmoothStepPath.d.ts +18 -0
- package/dist/types/extensions/react-flow/edges/utils.d.ts +1 -1
- package/dist/types/extensions/react-flow/index.d.ts +4 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +127 -0
- package/dist/types/extensions/react-flow/nodes/NodeContentExtension.d.ts +34 -0
- package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +4 -121
- package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +9 -2
- package/dist/types/extensions/react-flow/nodes/nodeTypes.d.ts +10 -10
- package/dist/types/index.d.ts +9 -4
- package/dist/types/legacy-replacements/Button/AffirmativeButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Button/Button.d.ts +5 -0
- package/dist/types/legacy-replacements/Button/DismissiveButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Button/DisruptiveButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Checkbox/Checkbox.d.ts +2 -0
- package/dist/types/legacy-replacements/Radio/RadioButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Tabs/Tabs.d.ts +22 -0
- package/dist/types/legacy-replacements/TextField/TextField.d.ts +2 -0
- package/dist/types/legacy-replacements/index.d.ts +10 -0
- package/package.json +48 -20
- package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +98 -0
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +144 -89
- package/src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx +11 -3
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +182 -120
- package/src/cmem/ActivityControl/index.ts +3 -0
- package/src/cmem/ContentBlobToggler/index.ts +2 -0
- package/src/cmem/_index.scss +6 -0
- package/src/cmem/index.ts +10 -23
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +222 -0
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +40 -0
- package/src/cmem/react-flow/_edges.scss +23 -0
- package/src/cmem/react-flow/_handles.scss +34 -0
- package/src/cmem/react-flow/_index.scss +5 -0
- package/src/cmem/react-flow/_minimap.scss +33 -0
- package/src/cmem/react-flow/_nodes.scss +66 -0
- package/src/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/src/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/src/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/src/cmem/react-flow/configuration/_colors.scss +3 -0
- package/src/cmem/react-flow/configuration/graph.ts +29 -0
- package/src/cmem/react-flow/configuration/linking.ts +28 -0
- package/src/cmem/react-flow/configuration/unspecified.ts +13 -0
- package/src/cmem/react-flow/configuration/workflow.ts +25 -0
- package/src/common/utils/stringUtils.ts +2 -0
- package/src/components/Application/ApplicationContent.tsx +0 -5
- package/src/components/Application/ApplicationTitle.tsx +0 -5
- package/src/components/AutoSuggestion/AutoSuggestion.scss +100 -0
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +446 -0
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +170 -0
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +97 -0
- package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +37 -0
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +124 -0
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +55 -0
- package/src/components/AutocompleteField/AutoCompleteField.tsx +24 -23
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +2 -1
- package/src/components/Breadcrumb/BreadcrumbItem.tsx +5 -5
- package/src/components/Breadcrumb/BreadcrumbList.tsx +1 -1
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Button/Button.tsx +4 -3
- package/src/components/Card/Card.tsx +23 -4
- package/src/components/Card/card.scss +4 -0
- package/src/components/Checkbox/checkbox.scss +4 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +8 -2
- package/src/components/Dialog/Modal.tsx +9 -2
- package/src/components/Dialog/SimpleDialog.tsx +2 -0
- package/src/components/Form/FieldItem.tsx +3 -3
- package/src/components/Form/FieldItemRow.tsx +2 -4
- package/src/components/Icon/Icon.tsx +4 -4
- package/src/components/Icon/IconButton.tsx +3 -3
- package/src/components/Icon/canonicalIconNames.tsx +39 -2
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/MultiSelect/MultiSelect.stories.tsx +71 -0
- package/src/components/MultiSelect/MultiSelect.tsx +373 -0
- package/src/components/Notification/Notification.stories.tsx +82 -0
- package/src/components/Notification/Notification.tsx +62 -4
- package/src/components/Notification/notification.scss +2 -1
- package/src/components/OverviewItem/OverviewItemList.tsx +2 -2
- package/src/components/RadioButton/radiobutton.scss +4 -0
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Switch/switch.scss +1 -0
- package/src/components/Tabs/Tab.tsx +111 -0
- package/src/components/Tabs/TabTitle.tsx +71 -0
- package/src/components/Tabs/Tabs.tsx +22 -90
- package/src/components/Tabs/stories/Tab.stories.tsx +65 -0
- package/src/components/Tabs/stories/TabTitle.stories.tsx +35 -0
- package/src/components/Tabs/stories/Tabs.stories.tsx +98 -0
- package/src/components/Tabs/tabs.scss +11 -4
- package/src/components/Tag/Tag.tsx +10 -3
- package/src/components/Tag/tag.scss +2 -2
- package/src/components/TextField/TextField.tsx +1 -1
- package/src/components/Toolbar/toolbar.scss +1 -1
- package/src/components/Typography/HtmlContentBlock.tsx +27 -4
- package/src/components/Typography/classnames.ts +1 -0
- package/src/components/Typography/typography.scss +8 -0
- package/src/configuration/_variables.scss +3 -3
- package/src/extensions/react-flow/_config.scss +2 -2
- package/src/extensions/react-flow/_react-flow.scss +4 -0
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +0 -1
- package/src/extensions/react-flow/edges/_edges.scss +3 -28
- package/src/extensions/react-flow/edges/getSmoothStepPath.ts +118 -0
- package/src/extensions/react-flow/edges/utils.ts +131 -4
- package/src/extensions/react-flow/handles/_handles.scss +4 -58
- package/src/extensions/react-flow/index.ts +4 -0
- package/src/extensions/react-flow/minimap/_minimap.scss +0 -45
- package/src/extensions/react-flow/minimap/utils.ts +1 -1
- package/src/extensions/react-flow/nodes/NodeContent.tsx +336 -0
- package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +17 -10
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +4 -326
- package/src/extensions/react-flow/nodes/NodeTools.tsx +27 -10
- package/src/extensions/react-flow/nodes/_nodes.scss +61 -196
- package/src/extensions/react-flow/nodes/{NodeContent.stories.tsx → stories/NodeContent.stories.tsx} +14 -5
- package/src/extensions/react-flow/nodes/stories/NodeContentExtension.stories.tsx +59 -0
- package/src/extensions/react-flow/nodes/{NodeDefault.stories.tsx → stories/NodeDefault.stories.tsx} +5 -3
- package/src/index.scss +1 -0
- package/src/index.ts +19 -4
- package/src/legacy-replacements/Tabs/Tabs.stories.tsx +46 -0
- package/src/legacy-replacements/Tabs/Tabs.tsx +84 -0
- package/src/legacy-replacements/index.ts +11 -0
- package/src/test/setupTests.js +19 -0
- package/src/components/Icon/canonicalIconNames.json +0 -120
- package/src/extensions/react-flow/nodes/NodeContentExtension.stories.tsx +0 -36
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Intent as BlueprintIntent} from "@blueprintjs/core";
|
|
3
|
+
import {IItemRendererProps, MultiSelect as BlueprintMultiSelect, MultiSelectProps} from "@blueprintjs/select";
|
|
4
|
+
import MenuItem from "../Menu/MenuItem";
|
|
5
|
+
import Highlighter from "../Typography/Highlighter";
|
|
6
|
+
import Button from "../Button/Button";
|
|
7
|
+
import OverflowText from "../Typography/OverflowText";
|
|
8
|
+
import {HTMLInputProps} from "@blueprintjs/core/src/common/props";
|
|
9
|
+
import {removeExtraSpaces} from "../../common/utils/stringUtils";
|
|
10
|
+
|
|
11
|
+
interface SelectedParamsType<T> {
|
|
12
|
+
newlySelected: T;
|
|
13
|
+
selectedItems: T[];
|
|
14
|
+
createdItems: Partial<T>[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface IProps<T> extends Pick<MultiSelectProps<T>, "items" | "placeholder" | "openOnKeyDown"> {
|
|
18
|
+
/**
|
|
19
|
+
* Returns the unique ID of an item. This will be used for equality of items.
|
|
20
|
+
*/
|
|
21
|
+
itemId: (item: T) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the label of an item.
|
|
24
|
+
* this would be used in the item selection list as well as the multi-select input
|
|
25
|
+
*/
|
|
26
|
+
itemLabel: (item: T) => string;
|
|
27
|
+
/**
|
|
28
|
+
* When set to true will set the multi-select value with all the items provided
|
|
29
|
+
*/
|
|
30
|
+
prePopulateWithItems?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* function handler that would be called anytime an item is selected/deselected or an item is created/removed
|
|
33
|
+
*/
|
|
34
|
+
onSelection?: (params: SelectedParamsType<T>) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Props to spread to `Popover`. Note that `content` cannot be changed.
|
|
37
|
+
*/
|
|
38
|
+
popoverProps?: MultiSelectProps<T>["popoverProps"];
|
|
39
|
+
/**
|
|
40
|
+
* Props to spread to `TagInput`. Use `query` and `onQueryChange` to control the input.
|
|
41
|
+
*/
|
|
42
|
+
tagInputProps?: MultiSelectProps<T>["tagInputProps"];
|
|
43
|
+
|
|
44
|
+
/** Additional properties for the (query) input field of the multi-selection. */
|
|
45
|
+
inputProps?: HTMLInputProps;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* prop to listen for query changes, when text is entered in the multi-select input
|
|
49
|
+
*/
|
|
50
|
+
runOnQueryChange?: (query: string) => Promise<T[] | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the component should take up the full width of its container.
|
|
53
|
+
* This overrides `popoverProps.fill` and `tagInputProps.fill`.
|
|
54
|
+
*/
|
|
55
|
+
fullWidth?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* text content to render when filtering items returns zero results.
|
|
58
|
+
* If omitted, "No results." will be rendered in this case.
|
|
59
|
+
*/
|
|
60
|
+
noResultText?: string;
|
|
61
|
+
/**
|
|
62
|
+
* text content to render when a new item non-existing in filtered items is about to be created .
|
|
63
|
+
* If omitted, "No results." will be rendered in this case.
|
|
64
|
+
*/
|
|
65
|
+
newItemCreationText?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Allows to creates new item from a given query. If this is not provided then no new items can be created.
|
|
68
|
+
*/
|
|
69
|
+
createNewItemFromQuery?: (query: string) => T
|
|
70
|
+
/**
|
|
71
|
+
* Items that were newly created and not taken from the list will be post-fixed with this string.
|
|
72
|
+
*/
|
|
73
|
+
newItemPostfix?: string
|
|
74
|
+
/**
|
|
75
|
+
* The input element is displayed with primary color scheme.
|
|
76
|
+
*/
|
|
77
|
+
hasStatePrimary?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The input element is displayed with success (some type of green) color scheme.
|
|
80
|
+
*/
|
|
81
|
+
hasStateSuccess?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The input element is displayed with success (some type of orange) color scheme.
|
|
84
|
+
*/
|
|
85
|
+
hasStateWarning?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The input element is displayed with success (some type of red) color scheme.
|
|
88
|
+
*/
|
|
89
|
+
hasStateDanger?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Disables the input element
|
|
92
|
+
*/
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function MultiSelect<T>({
|
|
97
|
+
items,
|
|
98
|
+
prePopulateWithItems,
|
|
99
|
+
itemId,
|
|
100
|
+
itemLabel,
|
|
101
|
+
onSelection,
|
|
102
|
+
popoverProps,
|
|
103
|
+
tagInputProps,
|
|
104
|
+
inputProps,
|
|
105
|
+
runOnQueryChange,
|
|
106
|
+
fullWidth = true,
|
|
107
|
+
noResultText = "No results.",
|
|
108
|
+
newItemCreationText = "Add new item",
|
|
109
|
+
newItemPostfix = " (new item)",
|
|
110
|
+
hasStatePrimary,
|
|
111
|
+
hasStateDanger,
|
|
112
|
+
hasStateSuccess,
|
|
113
|
+
hasStateWarning,
|
|
114
|
+
disabled,
|
|
115
|
+
createNewItemFromQuery,
|
|
116
|
+
...otherProps
|
|
117
|
+
}: IProps<T>) {
|
|
118
|
+
const [createdItems, setCreatedItems] = React.useState<T[]>([]);
|
|
119
|
+
const [itemsCopy, setItemsCopy] = React.useState<T[]>([...items]);
|
|
120
|
+
const [filteredItemList, setFilteredItemList] = React.useState<T[]>([]);
|
|
121
|
+
const [selectedItems, setSelectedItems] = React.useState<T[]>(() => (prePopulateWithItems ? [...items] : []));
|
|
122
|
+
const [query, setQuery] = React.useState<string | undefined>(undefined);
|
|
123
|
+
//currently focused element in popover list
|
|
124
|
+
const [focusedItem, setFocusedItem] = React.useState<T | null>(null);
|
|
125
|
+
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
126
|
+
|
|
127
|
+
let intent;
|
|
128
|
+
switch (true) {
|
|
129
|
+
case hasStatePrimary:
|
|
130
|
+
intent = BlueprintIntent.PRIMARY;
|
|
131
|
+
break;
|
|
132
|
+
case hasStateSuccess:
|
|
133
|
+
intent = BlueprintIntent.SUCCESS;
|
|
134
|
+
break;
|
|
135
|
+
case hasStateWarning:
|
|
136
|
+
intent = BlueprintIntent.WARNING;
|
|
137
|
+
break;
|
|
138
|
+
case hasStateDanger:
|
|
139
|
+
intent = BlueprintIntent.DANGER;
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** update items copy when the items change
|
|
146
|
+
* e.g for auto-complete when query change
|
|
147
|
+
*/
|
|
148
|
+
React.useEffect(() => {
|
|
149
|
+
setItemsCopy([...items, ...createdItems]);
|
|
150
|
+
setFilteredItemList([...items, ...createdItems]);
|
|
151
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
152
|
+
}, [items.map((item) => itemId(item)).join("|")]);
|
|
153
|
+
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
onSelection &&
|
|
156
|
+
onSelection({
|
|
157
|
+
newlySelected: selectedItems.slice(-1)[0],
|
|
158
|
+
createdItems,
|
|
159
|
+
selectedItems,
|
|
160
|
+
});
|
|
161
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
162
|
+
}, [
|
|
163
|
+
onSelection,
|
|
164
|
+
selectedItems.map((item) => itemId(item)).join("|"),
|
|
165
|
+
createdItems.map((item) => itemId(item)).join("|"),
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* using the equality prop specified checks if an item has already been selected
|
|
170
|
+
* @param matcher
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
const itemHasBeenSelectedAlready = (matcher: string) => {
|
|
174
|
+
return !!selectedItems.find((item) => itemId(item) === matcher);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* removes already selected item from the selectedItems
|
|
179
|
+
* @param matcher
|
|
180
|
+
*/
|
|
181
|
+
const removeItemSelection = (matcher: string) => {
|
|
182
|
+
setSelectedItems((items) => items.filter((item) => itemId(item) !== matcher));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* selects and deselects an item from selection list
|
|
187
|
+
* if the item exists it removes it instead
|
|
188
|
+
* @param item
|
|
189
|
+
*/
|
|
190
|
+
const onItemSelect = (item: T) => {
|
|
191
|
+
if (itemHasBeenSelectedAlready(itemId(item))) {
|
|
192
|
+
removeItemSelection(itemId(item));
|
|
193
|
+
} else {
|
|
194
|
+
setSelectedItems((items) => [...items, item]);
|
|
195
|
+
}
|
|
196
|
+
inputRef.current?.select()
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* search through item list using "label prop" and update the items popover
|
|
201
|
+
* @param query
|
|
202
|
+
*/
|
|
203
|
+
const onQueryChange = async (query: string) => {
|
|
204
|
+
if (query.length) {
|
|
205
|
+
setQuery(query);
|
|
206
|
+
setFilteredItemList([])
|
|
207
|
+
const resultFromQuery = runOnQueryChange && (await runOnQueryChange(removeExtraSpaces(query)));
|
|
208
|
+
setFilteredItemList(() =>
|
|
209
|
+
[...(resultFromQuery ?? itemsCopy), ...createdItems].filter(item =>
|
|
210
|
+
itemLabel(item).toLowerCase().includes(query.toLowerCase())
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// Renders the entries of the (search) options list
|
|
217
|
+
const optionRenderer = (label: string) => {
|
|
218
|
+
return <Highlighter label={label} searchValue={query} />;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* defines how an item in the item list is displayed
|
|
223
|
+
*/
|
|
224
|
+
const onItemRenderer = (item: T, { handleClick, modifiers }: IItemRendererProps) => {
|
|
225
|
+
if (!modifiers.matchesPredicate) {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
let label = itemLabel(item)
|
|
229
|
+
if(createdItems.find(created => itemId(created) === itemId(item))) {
|
|
230
|
+
label += newItemPostfix
|
|
231
|
+
}
|
|
232
|
+
return (
|
|
233
|
+
<MenuItem
|
|
234
|
+
active={modifiers.active}
|
|
235
|
+
key={itemId(item)}
|
|
236
|
+
icon={itemHasBeenSelectedAlready(itemId(item)) ? "state-checked" : "state-unchecked"}
|
|
237
|
+
onClick={handleClick}
|
|
238
|
+
text={optionRenderer(label)}
|
|
239
|
+
shouldDismissPopover={false}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* clear all selected items in the multi-select input
|
|
246
|
+
*/
|
|
247
|
+
const handleClear = () => {
|
|
248
|
+
setSelectedItems([]);
|
|
249
|
+
setFilteredItemList(itemsCopy);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* remove a specific item from the multi-select input
|
|
254
|
+
* @param label
|
|
255
|
+
* @param index
|
|
256
|
+
*/
|
|
257
|
+
const removeTagFromSelectionViaIndex = (label: string, index: number) => {
|
|
258
|
+
setSelectedItems([...selectedItems.slice(0, index), ...selectedItems.slice(index + 1)]);
|
|
259
|
+
setCreatedItems(items => items.filter(item => itemLabel(item) !== label));
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Utility function to create a new Item. createNewItemFromQuery is assumed to be defined!
|
|
264
|
+
*/
|
|
265
|
+
const createNewItem = (query: string): T => {
|
|
266
|
+
const newItem = createNewItemFromQuery!!(query);
|
|
267
|
+
//set new items
|
|
268
|
+
setCreatedItems((items) => [...items, newItem]);
|
|
269
|
+
setQuery("");
|
|
270
|
+
itemsCopy.push(newItem);
|
|
271
|
+
return newItem;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* added functionality to create new item when there are no matching items on enter keypress
|
|
276
|
+
* @param event
|
|
277
|
+
*/
|
|
278
|
+
const handleOnKeyUp = (event: React.KeyboardEvent<HTMLElement>) => {
|
|
279
|
+
if (event.key === "Enter" && !filteredItemList.length && !!query && createNewItemFromQuery) {
|
|
280
|
+
createNewItem(query);
|
|
281
|
+
}
|
|
282
|
+
inputRef.current?.focus();
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* added functionality to either create new item
|
|
287
|
+
* when there are no matching items or select an item on tab keypress
|
|
288
|
+
* @param event
|
|
289
|
+
*/
|
|
290
|
+
const handleOnKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
|
|
291
|
+
if (event.key === "Tab" && !!query) {
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
focusedItem ? onItemSelect(focusedItem) : onItemSelect(createNewItem(query));
|
|
294
|
+
setQuery("");
|
|
295
|
+
setTimeout(() => inputRef.current?.focus());
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* create new item handler, displays the new item selector and creates a new item when selected
|
|
301
|
+
* @param label '
|
|
302
|
+
* @param active
|
|
303
|
+
* @param handleClick
|
|
304
|
+
* @returns
|
|
305
|
+
*/
|
|
306
|
+
const newItemRenderer = (label: string, active: boolean, handleClick: React.MouseEventHandler<HTMLElement>) => {
|
|
307
|
+
if (!createNewItemFromQuery) return undefined;
|
|
308
|
+
const clickHandler = (e: React.MouseEvent<HTMLElement>) => {
|
|
309
|
+
createNewItem(label);
|
|
310
|
+
handleClick(e);
|
|
311
|
+
};
|
|
312
|
+
return (
|
|
313
|
+
<MenuItem
|
|
314
|
+
id={"new-item"}
|
|
315
|
+
icon="item-add-artefact"
|
|
316
|
+
active={active}
|
|
317
|
+
key={label}
|
|
318
|
+
onClick={clickHandler}
|
|
319
|
+
text={<OverflowText>{`${newItemCreationText} '${label}'`}</OverflowText>}
|
|
320
|
+
/>
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
const clearButton =
|
|
325
|
+
selectedItems.length > 0 ? (
|
|
326
|
+
<Button icon="operation-clear" data-test-id="clear-all-items" minimal={true} onClick={handleClear} />
|
|
327
|
+
) : undefined;
|
|
328
|
+
|
|
329
|
+
return (
|
|
330
|
+
<BlueprintMultiSelect<T>
|
|
331
|
+
{...otherProps}
|
|
332
|
+
query={query}
|
|
333
|
+
onQueryChange={onQueryChange}
|
|
334
|
+
items={filteredItemList}
|
|
335
|
+
onItemSelect={onItemSelect}
|
|
336
|
+
itemRenderer={onItemRenderer}
|
|
337
|
+
itemsEqual={(a: T, b: T) => itemId(a) === itemId(b)}
|
|
338
|
+
selectedItems={selectedItems}
|
|
339
|
+
noResults={<MenuItem disabled={true} text={noResultText} />}
|
|
340
|
+
tagRenderer={item => itemLabel(item)}
|
|
341
|
+
createNewItemRenderer={newItemRenderer}
|
|
342
|
+
onActiveItemChange={(activeItem) => setFocusedItem(activeItem)}
|
|
343
|
+
fill={fullWidth}
|
|
344
|
+
createNewItemFromQuery={createNewItemFromQuery}
|
|
345
|
+
tagInputProps={{
|
|
346
|
+
inputProps: {
|
|
347
|
+
id: "item",
|
|
348
|
+
autoComplete: "off",
|
|
349
|
+
...inputProps
|
|
350
|
+
},
|
|
351
|
+
inputRef: inputRef,
|
|
352
|
+
intent,
|
|
353
|
+
addOnBlur: true,
|
|
354
|
+
onKeyDown: handleOnKeyDown,
|
|
355
|
+
onKeyUp: handleOnKeyUp,
|
|
356
|
+
onRemove: removeTagFromSelectionViaIndex,
|
|
357
|
+
rightElement: disabled ? undefined : clearButton,
|
|
358
|
+
tagProps: { minimal: true },
|
|
359
|
+
disabled,
|
|
360
|
+
...tagInputProps,
|
|
361
|
+
}}
|
|
362
|
+
popoverProps={{
|
|
363
|
+
minimal: true,
|
|
364
|
+
position: "bottom-left",
|
|
365
|
+
hasBackdrop: true,
|
|
366
|
+
...popoverProps,
|
|
367
|
+
defaultIsOpen: true,
|
|
368
|
+
}}
|
|
369
|
+
/>
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export default MultiSelect;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
4
|
+
|
|
5
|
+
import Notification from "./Notification";
|
|
6
|
+
import HtmlContentBlock from "./../Typography/HtmlContentBlock";
|
|
7
|
+
import Button from "./../Button/Button";
|
|
8
|
+
import Spacing from "./../Separation/Spacing";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: "Components/Notification",
|
|
12
|
+
component: Notification,
|
|
13
|
+
argTypes: {
|
|
14
|
+
className: {
|
|
15
|
+
description: "A space-delimited list of class names.",
|
|
16
|
+
control: "text",
|
|
17
|
+
table: {
|
|
18
|
+
defaultValue: { summary: undefined },
|
|
19
|
+
type: { summary: "string" },
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
onDismiss: {
|
|
23
|
+
description: "Callback invoked when the toast is dismissed, either by the user or by the timeout.",
|
|
24
|
+
control: "none",
|
|
25
|
+
table: {
|
|
26
|
+
defaultValue: { summary: undefined },
|
|
27
|
+
type: { summary: "(didTimeoutExpire: boolean) => void" },
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
timeout: {
|
|
31
|
+
description: "Milliseconds to wait before automatically dismissing toast. Providing a value less than or equal to 0 will disable the timeout.",
|
|
32
|
+
control: "number",
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: { summary: 0 },
|
|
35
|
+
type: { summary: "number" },
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
message: {
|
|
39
|
+
control: "none",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
} as ComponentMeta<typeof Notification>;
|
|
43
|
+
|
|
44
|
+
const TemplateFull: ComponentStory<typeof Notification> = (args) => (
|
|
45
|
+
<Notification {...args} />
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export const ExampleWithMessage = TemplateFull.bind({});
|
|
49
|
+
ExampleWithMessage.args = {
|
|
50
|
+
message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
|
|
51
|
+
onDismiss: false, // workaround for undefined function in Storybook
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ExampleWithChildren = TemplateFull.bind({});
|
|
55
|
+
ExampleWithChildren.args = {
|
|
56
|
+
children: (
|
|
57
|
+
<HtmlContentBlock>
|
|
58
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />
|
|
59
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
|
|
60
|
+
</HtmlContentBlock>
|
|
61
|
+
),
|
|
62
|
+
onDismiss: false, // workaround for undefined function in Storybook
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const ExampleNeutralMessage = TemplateFull.bind({});
|
|
66
|
+
ExampleNeutralMessage.args = {
|
|
67
|
+
message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
|
|
68
|
+
onDismiss: false, // workaround for undefined function in Storybook
|
|
69
|
+
neutral: true,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const ExampleWithActions = TemplateFull.bind({});
|
|
73
|
+
ExampleWithActions.args = {
|
|
74
|
+
message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
|
|
75
|
+
onDismiss: false, // workaround for undefined function in Storybook
|
|
76
|
+
danger: true,
|
|
77
|
+
actions: [
|
|
78
|
+
<Button text="Something" key="b1" />,
|
|
79
|
+
<Spacing size="tiny" vertical />,
|
|
80
|
+
<Button text="Important" hasStateDanger key="b2" />
|
|
81
|
+
]
|
|
82
|
+
};
|
|
@@ -1,9 +1,65 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Toast as BlueprintToast,
|
|
4
|
+
ToastProps as BlueprintToastProps,
|
|
5
|
+
Classes as BlueprintClassNames,
|
|
6
|
+
} from "@blueprintjs/core";
|
|
3
7
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
8
|
import {ClassNames as IntentClassNames} from "../../common/Intent";
|
|
5
9
|
import Icon from "./../Icon/Icon";
|
|
10
|
+
import { ValidIconName } from "./../Icon/canonicalIconNames";
|
|
6
11
|
|
|
12
|
+
export interface NotificationProps extends Omit<BlueprintToastProps, "message" | "action" | "icon" | "intent">, React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/**
|
|
14
|
+
* Extra user action elements
|
|
15
|
+
*/
|
|
16
|
+
actions?: JSX.Element | JSX.Element[];
|
|
17
|
+
/**
|
|
18
|
+
* Notification message that can be used as alternative to children elements.
|
|
19
|
+
*/
|
|
20
|
+
message?: JSX.Element | string;
|
|
21
|
+
/**
|
|
22
|
+
* Notification has a neutral color scheme.
|
|
23
|
+
*/
|
|
24
|
+
neutral?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Notification is a success info.
|
|
27
|
+
* This defines the colorization and the icon symbol.
|
|
28
|
+
*/
|
|
29
|
+
success?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Notification is a warning alert.
|
|
32
|
+
* This defines the colorization and the icon symbol.
|
|
33
|
+
*/
|
|
34
|
+
warning?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Notification is a danger alert.
|
|
37
|
+
* This defines the colorization and the icon symbol.
|
|
38
|
+
*/
|
|
39
|
+
danger?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Notification uses the the given space more flexible.
|
|
42
|
+
* Depracation notice: Property name will removed in futire versions.
|
|
43
|
+
* Please use `flexWidth`.
|
|
44
|
+
* @depracted
|
|
45
|
+
*/
|
|
46
|
+
fullWidth?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Notification uses the the given space more flexible.
|
|
49
|
+
* Default notifcation is displayed in min and max limits.
|
|
50
|
+
* Those limits are removed by setting this property to `true`.
|
|
51
|
+
*/
|
|
52
|
+
flexWidth?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Icon used as depiction that is displayed with the notification.
|
|
55
|
+
*/
|
|
56
|
+
iconName?: ValidIconName;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Displays a notification message, optionally combined with depiction and further action buttons.
|
|
61
|
+
* By default it uses colorization of an blueish info alert.
|
|
62
|
+
*/
|
|
7
63
|
function Notification({
|
|
8
64
|
actions,
|
|
9
65
|
children,
|
|
@@ -13,11 +69,12 @@ function Notification({
|
|
|
13
69
|
warning = false,
|
|
14
70
|
danger = false,
|
|
15
71
|
neutral = false,
|
|
16
|
-
fullWidth = false,
|
|
72
|
+
fullWidth = false, // deprecated
|
|
73
|
+
flexWidth = false,
|
|
17
74
|
iconName = "state-info",
|
|
18
75
|
timeout,
|
|
19
76
|
...otherProps
|
|
20
|
-
}:
|
|
77
|
+
}: NotificationProps) {
|
|
21
78
|
let intentLevel: string = IntentClassNames.INFO;
|
|
22
79
|
let iconSymbol = iconName;
|
|
23
80
|
switch (true) {
|
|
@@ -55,7 +112,8 @@ function Notification({
|
|
|
55
112
|
`${eccgui}-notification ` +
|
|
56
113
|
intentLevel +
|
|
57
114
|
(className ? ` ${className}` : "") +
|
|
58
|
-
(fullWidth ? ` ${eccgui}-notification--fullwidth` : "") +
|
|
115
|
+
(fullWidth ? ` ${eccgui}-notification--fullwidth` : "") + // deprecated
|
|
116
|
+
(flexWidth ? ` ${eccgui}-notification--flexwidth` : "") +
|
|
59
117
|
(otherProps.onDismiss ? "" : ` ${eccgui}-notification--static`)
|
|
60
118
|
}
|
|
61
119
|
message={content}
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
.#{$eccgui}-notification--flexwidth,
|
|
58
59
|
.#{$eccgui}-notification--fullwidth {
|
|
59
60
|
min-width: 0;
|
|
60
61
|
max-width: none;
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
flex-grow: 0;
|
|
78
79
|
flex-shrink: 0;
|
|
79
80
|
|
|
80
|
-
.#{$ns}-button {
|
|
81
|
+
.#{$ns}-button:not([class*="intent"]) {
|
|
81
82
|
color: inherit;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -18,7 +18,7 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
|
|
|
18
18
|
* Use multiple columns.
|
|
19
19
|
* Currently only lists using 1 and 2 columns are supported.
|
|
20
20
|
*/
|
|
21
|
-
columns?:
|
|
21
|
+
columns?: 1 | 2;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -42,7 +42,7 @@ function OverviewItemList({
|
|
|
42
42
|
(densityHigh ? `${eccgui}-overviewitem__list--highdensity ` : '') +
|
|
43
43
|
(hasDivider ? `${eccgui}-overviewitem__list--hasdivider ` : '') +
|
|
44
44
|
(hasSpacing ? `${eccgui}-overviewitem__list--hasspacing ` : '') +
|
|
45
|
-
(columns > 1 ? `${eccgui}-overviewitem__list--hascolumns ` : '') + //
|
|
45
|
+
(columns > 1 ? `${eccgui}-overviewitem__list--hascolumns ` : '') + // FIXME: Support numbers > 2
|
|
46
46
|
className
|
|
47
47
|
}
|
|
48
48
|
>
|
|
@@ -28,7 +28,7 @@ export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<Bluep
|
|
|
28
28
|
function Spinner({
|
|
29
29
|
className = "",
|
|
30
30
|
color = "inherit",
|
|
31
|
-
description = "Loading indicator", // currently unsupported (
|
|
31
|
+
description = "Loading indicator", // currently unsupported (FIXME)
|
|
32
32
|
position = "local",
|
|
33
33
|
size,
|
|
34
34
|
stroke,
|