@eccenca/gui-elements 23.0.0-rc.6 → 23.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/cjs/cmem/markdown/Markdown.js +14 -2
  3. package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
  4. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
  5. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  6. package/dist/cjs/components/Accordion/Accordion.js +7 -2
  7. package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
  8. package/dist/cjs/components/Accordion/AccordionItem.js.map +1 -1
  9. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +59 -33
  10. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  11. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +10 -1
  12. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  13. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +10 -4
  14. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  15. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +13 -8
  16. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  17. package/dist/cjs/components/Button/Button.js.map +1 -1
  18. package/dist/cjs/components/Checkbox/Checkbox.js +1 -0
  19. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  20. package/dist/cjs/components/Form/FieldItem.js.map +1 -1
  21. package/dist/cjs/components/Menu/Menu.js +2 -2
  22. package/dist/cjs/components/Menu/Menu.js.map +1 -1
  23. package/dist/cjs/components/Menu/MenuDivider.js +2 -2
  24. package/dist/cjs/components/Menu/MenuDivider.js.map +1 -1
  25. package/dist/cjs/components/Menu/MenuItem.js +5 -3
  26. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  27. package/dist/cjs/components/MultiSelect/MultiSelect.js +17 -4
  28. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  29. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  30. package/dist/cjs/components/RadioButton/RadioButton.js +1 -0
  31. package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
  32. package/dist/cjs/components/Separation/Spacing.js +4 -1
  33. package/dist/cjs/components/Separation/Spacing.js.map +1 -1
  34. package/dist/cjs/components/Spinner/Spinner.js +3 -3
  35. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  36. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  37. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  38. package/dist/esm/cmem/markdown/Markdown.js +13 -2
  39. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  40. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
  41. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  42. package/dist/esm/components/Accordion/Accordion.js +8 -3
  43. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  44. package/dist/esm/components/Accordion/AccordionItem.js +1 -1
  45. package/dist/esm/components/Accordion/AccordionItem.js.map +1 -1
  46. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +71 -45
  47. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  48. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +11 -2
  49. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  50. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +11 -5
  51. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  52. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +19 -14
  53. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  54. package/dist/esm/components/Button/Button.js.map +1 -1
  55. package/dist/esm/components/Checkbox/Checkbox.js +1 -0
  56. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  57. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  58. package/dist/esm/components/Menu/Menu.js +3 -3
  59. package/dist/esm/components/Menu/Menu.js.map +1 -1
  60. package/dist/esm/components/Menu/MenuDivider.js +3 -3
  61. package/dist/esm/components/Menu/MenuDivider.js.map +1 -1
  62. package/dist/esm/components/Menu/MenuItem.js +5 -3
  63. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  64. package/dist/esm/components/MultiSelect/MultiSelect.js +22 -9
  65. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  66. package/dist/esm/components/Pagination/Pagination.js +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  68. package/dist/esm/components/RadioButton/RadioButton.js +2 -1
  69. package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
  70. package/dist/esm/components/Separation/Spacing.js +4 -1
  71. package/dist/esm/components/Separation/Spacing.js.map +1 -1
  72. package/dist/esm/components/Spinner/Spinner.js +3 -4
  73. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  74. package/dist/esm/components/Switch/Switch.js +1 -1
  75. package/dist/esm/components/Switch/Switch.js.map +1 -1
  76. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  77. package/dist/types/cmem/markdown/Markdown.d.ts +3 -2
  78. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +1 -1
  79. package/dist/types/components/Accordion/Accordion.d.ts +12 -1
  80. package/dist/types/components/Accordion/AccordionItem.d.ts +21 -6
  81. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +4 -2
  82. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +5 -0
  83. package/dist/types/components/Button/Button.d.ts +1 -1
  84. package/dist/types/components/Checkbox/Checkbox.d.ts +4 -1
  85. package/dist/types/components/Form/FieldItem.d.ts +32 -2
  86. package/dist/types/components/Menu/Menu.d.ts +4 -1
  87. package/dist/types/components/Menu/MenuDivider.d.ts +4 -1
  88. package/dist/types/components/Menu/MenuItem.d.ts +5 -2
  89. package/dist/types/components/Pagination/Pagination.d.ts +9 -5
  90. package/dist/types/components/RadioButton/RadioButton.d.ts +4 -1
  91. package/dist/types/components/Separation/Spacing.d.ts +17 -3
  92. package/dist/types/components/Spinner/Spinner.d.ts +38 -5
  93. package/dist/types/components/Switch/Switch.d.ts +6 -3
  94. package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +15 -0
  95. package/package.json +4 -6
  96. package/src/cmem/markdown/Markdown.tsx +5 -4
  97. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +15 -86
  98. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +1 -5
  99. package/src/components/Accordion/Accordion.tsx +33 -3
  100. package/src/components/Accordion/AccordionItem.tsx +23 -33
  101. package/src/components/Accordion/Stories/Accordion.stories.tsx +33 -0
  102. package/src/components/Accordion/Stories/AccordionItem.stories.tsx +27 -0
  103. package/src/components/Accordion/accordion.scss +20 -1
  104. package/src/components/AutoSuggestion/AutoSuggestion.tsx +73 -39
  105. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -2
  106. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +17 -9
  107. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +9 -7
  108. package/src/components/AutocompleteField/AutoCompleteField.tsx +19 -6
  109. package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
  110. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +1 -1
  111. package/src/components/Button/Button.stories.tsx +1 -107
  112. package/src/components/Button/Button.tsx +2 -2
  113. package/src/components/Card/stories/Card.stories.tsx +2 -21
  114. package/src/components/Checkbox/Checkbox.tsx +9 -2
  115. package/src/components/Checkbox/Stories/Checkbox.stories.tsx +30 -0
  116. package/src/components/Checkbox/checkbox.scss +4 -0
  117. package/src/components/ContextOverlay/ContextMenu.stories.tsx +2 -2
  118. package/src/components/Dialog/stories/Modal.stories.tsx +1 -61
  119. package/src/components/Dialog/stories/SimpleDialog.stories.tsx +1 -2
  120. package/src/components/Form/FieldItem.tsx +32 -2
  121. package/src/components/Form/Stories/FieldItem.stories.tsx +27 -0
  122. package/src/components/Form/Stories/FieldItemRow.stories.tsx +31 -0
  123. package/src/components/Label/Label.stories.tsx +1 -1
  124. package/src/components/Menu/Menu.tsx +21 -3
  125. package/src/components/Menu/MenuDivider.tsx +20 -3
  126. package/src/components/Menu/MenuItem.tsx +13 -10
  127. package/src/components/Menu/Stories/Menu.stories.tsx +31 -0
  128. package/src/components/Menu/Stories/MenuItem.stories.tsx +25 -0
  129. package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -21
  130. package/src/components/MultiSelect/MultiSelect.tsx +22 -5
  131. package/src/components/Notification/Notification.stories.tsx +1 -29
  132. package/src/components/Pagination/Pagination.tsx +13 -6
  133. package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
  134. package/src/components/Pagination/pagination.scss +2 -2
  135. package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +25 -0
  136. package/src/components/RadioButton/RadioButton.tsx +9 -2
  137. package/src/components/RadioButton/Stories/RadioButton.stories.tsx +30 -0
  138. package/src/components/Select/Select.stories.tsx +1 -1
  139. package/src/components/Separation/Spacing.tsx +17 -4
  140. package/src/components/Separation/Stories/Spacing.stories.tsx +25 -0
  141. package/src/components/Spinner/Spinner.tsx +39 -7
  142. package/src/components/Spinner/Stories/spinner.stories.tsx +26 -0
  143. package/src/components/Switch/Stories/Switch.stories.tsx +27 -0
  144. package/src/components/Switch/Switch.tsx +9 -3
  145. package/src/components/Tabs/stories/Tab.stories.tsx +1 -32
  146. package/src/components/Tabs/stories/Tabs.stories.tsx +1 -39
  147. package/src/components/Tag/Tag.stories.tsx +1 -9
  148. package/src/components/TextField/stories/TextArea.stories.tsx +10 -25
  149. package/src/components/TextField/stories/TextField.stories.tsx +2 -73
  150. package/src/extensions/react-flow/edges/EdgeDefault.tsx +19 -0
  151. package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +121 -0
  152. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +1 -1
  153. package/dist/cjs/cmem/react-flow/configuration/customLabel.js +0 -13
  154. package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +0 -1
  155. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +0 -13
  156. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  157. package/dist/esm/cmem/react-flow/configuration/customLabel.js +0 -10
  158. package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +0 -1
  159. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +0 -10
  160. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  161. package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +0 -8
  162. package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +0 -8
  163. package/src/cmem/react-flow/configuration/customLabel.ts +0 -11
  164. package/src/cmem/react-flow/configuration/inverseEdge.ts +0 -11
@@ -5,21 +5,54 @@ export declare type SpinnerSize = "tiny" | "small" | "medium" | "large" | "xlarg
5
5
  export declare type SpinnerStroke = "thin" | "medium" | "bold";
6
6
  declare type Intent = "inherit" | "primary" | "success" | "warning" | "danger";
7
7
  /** A spinner that is either displayed globally or locally. */
8
- export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<BlueprintSpinnerProps, "size">> {
8
+ export interface SpinnerProps extends Omit<BlueprintSpinnerProps, "size"> {
9
+ /**
10
+ * intent value or a valid css color definition
11
+ */
9
12
  color?: Intent | string;
13
+ /**
14
+ * Additional CSS class names.
15
+ */
10
16
  className?: string;
11
- description?: string;
17
+ /**
18
+ * Position where and how the spinner is displayed:
19
+ * * `local`: the spinner is displayed as centered overlay to the neareast parent with relative (or equivalent) positioning
20
+ * * `inline`: the spinner is displayed as inline element
21
+ * * `global`: the spinner is displayed including backdrop centered over the full viewport
22
+ */
12
23
  position?: SpinnerPosition;
24
+ /**
25
+ * The size of the spinner.
26
+ * The default size relates to the `position`.
27
+ */
13
28
  size?: SpinnerSize;
29
+ /**
30
+ * The stroke width that is used to visualize the spinner.
31
+ * The default size relates to the `position`.
32
+ * There are only rare cases to set this property,
33
+ */
14
34
  stroke?: SpinnerStroke;
35
+ /**
36
+ * Delay when to show the spinner in ms.
37
+ */
15
38
  delay?: number;
16
39
  /**
17
40
  * Includes a backdrop behind the spinner that narrows visibility of the area behind the spinner.
18
41
  * This option only works with "local" spinners, for "inline" spinners there is no backdrop, "global" spinners always have backdrops.
19
- * The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or soe equivalent CSS rule.
42
+ * The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or some other CSS rule with an equivalent outcome.
20
43
  */
21
44
  showLocalBackdrop?: boolean;
45
+ /**
46
+ * Use this property to alter the display of the backdrop used for the global spinner
47
+ */
48
+ overlayProps?: BlueprintOverlayProps;
49
+ /**
50
+ * Label displayed next to the spinner (planned).
51
+ * You can set it to document the purpose of the spinner.
52
+ * It is currently not supported and not displayed.
53
+ */
54
+ description?: string;
22
55
  }
23
- declare function Spinner({ className, color, description, // currently unsupported (FIXME)
24
- position, size, stroke, showLocalBackdrop, delay, ...otherProps }: SpinnerProps): JSX.Element | null;
56
+ declare function Spinner({ className, color, position, size, stroke, showLocalBackdrop, delay, overlayProps, description, // currently unsupported (FIXME):
57
+ ...otherProps }: SpinnerProps): JSX.Element | null;
25
58
  export default Spinner;
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
- import { SwitchProps } from "@blueprintjs/core";
3
- interface Props extends Omit<SwitchProps, "onChange"> {
2
+ import { SwitchProps as BlueprintSwitchProps } from "@blueprintjs/core";
3
+ export interface SwitchProps extends Omit<BlueprintSwitchProps, "onChange"> {
4
+ /**
5
+ * Event handler for changed state.
6
+ */
4
7
  onChange?: (value: boolean) => any;
5
8
  }
6
- declare function Switch({ onChange, ...otherProps }: Props): JSX.Element;
9
+ declare function Switch({ onChange, ...otherProps }: SwitchProps): JSX.Element;
7
10
  declare const _default: React.MemoExoticComponent<typeof Switch>;
8
11
  export default _default;
@@ -1,13 +1,28 @@
1
1
  import React from 'react';
2
2
  import { EdgeProps as ReactFlowEdgeProps } from "react-flow-renderer/dist/types";
3
3
  export interface EdgeDefaultDataProps {
4
+ /**
5
+ * Size of the "glow" effect when the edge is hovered.
6
+ */
4
7
  pathGlowWidth?: number;
5
8
  inversePath?: boolean;
9
+ /**
10
+ * Reference linnk to the SVG marker used for the start of the edge
11
+ */
6
12
  markerStart?: string;
13
+ /**
14
+ * Callback handler that returns a React element used as edge title.
15
+ */
7
16
  renderLabel?: (edgeCenter: [number, number, number, number]) => React.ReactNode;
8
17
  }
9
18
  export interface EdgeDefaultProps extends ReactFlowEdgeProps {
19
+ /**
20
+ * Defining content and markers for the edge.
21
+ */
10
22
  data?: EdgeDefaultDataProps;
23
+ /**
24
+ * Callback handler that returns a SVG path as string to define how the edge is rendered.
25
+ */
11
26
  drawSvgPath?: (edge: ReactFlowEdgeProps) => string;
12
27
  }
13
28
  export declare const EdgeDefault: React.MemoExoticComponent<(edge: EdgeDefaultProps) => JSX.Element>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eccenca/gui-elements",
3
3
  "description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
4
- "version": "23.0.0-rc.6",
4
+ "version": "23.0.0-rc.7",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/eccenca/gui-elements",
7
7
  "bugs": "https://github.com/eccenca/gui-elements/issues",
@@ -116,7 +116,6 @@
116
116
  "@typescript-eslint/parser": "^4.33.0",
117
117
  "babel-jest": "^27.5.1",
118
118
  "chromatic": "^6.5.1",
119
- "css-loader": "3.4.2",
120
119
  "eslint": "^7.32.0",
121
120
  "eslint-config-react-app": "^6.0.0",
122
121
  "identity-obj-proxy": "^3.0.0",
@@ -131,11 +130,9 @@
131
130
  "rimraf": "^3.0.2",
132
131
  "sass": "^1.53.0",
133
132
  "sass-loader": "^10.3.1",
134
- "style-loader": "0.23.1",
135
133
  "ts-node": "^10.9.1",
136
134
  "tsc-esm-fix": "^2.13.0",
137
- "typescript": "4.4.4",
138
- "webpack": "^4.46.0"
135
+ "typescript": "4.4.4"
139
136
  },
140
137
  "peerDependencies": {
141
138
  "react": ">=16",
@@ -152,7 +149,8 @@
152
149
  "**/glob-parent": "^5.1.2",
153
150
  "**/trim": "^0.0.3",
154
151
  "**/trim-newlines": "^3.0.1",
155
- "**/minimist": "^1.2.6"
152
+ "**/minimist": "^1.2.6",
153
+ "**/postcss": "^7.0.36"
156
154
  },
157
155
  "eslintConfig": {
158
156
  "extends": [
@@ -5,10 +5,10 @@ import remarkGfm from "remark-gfm";
5
5
  import remarkTypograf from "@mavrin/remark-typograf";
6
6
  import {remarkDefinitionList} from 'remark-definition-list';
7
7
  import React from "react";
8
- import { HtmlContentBlock } from "../../index";
8
+ import {HtmlContentBlock, TestableComponent} from "../../index";
9
9
  import { PluggableList } from "react-markdown/lib/react-markdown";
10
10
 
11
- export interface MarkdownParserProps {
11
+ export interface MarkdownParserProps extends TestableComponent {
12
12
  children: string;
13
13
  /**
14
14
  * Allow HTML as partial content, otherwise escape HTML tags.
@@ -65,7 +65,8 @@ export const Markdown = ({
65
65
  removeMarkup = false,
66
66
  inheritBlock = false,
67
67
  allowedElements,
68
- reHypePlugins
68
+ reHypePlugins,
69
+ ...otherProps
69
70
  }: MarkdownParserProps) => {
70
71
 
71
72
  const configHtml = allowHtml ? {
@@ -93,7 +94,7 @@ export const Markdown = ({
93
94
  return inheritBlock ? (
94
95
  <ReactMarkdown {...reactMarkdownProperties} />
95
96
  ) : (
96
- <HtmlContentBlock>
97
+ <HtmlContentBlock data-test-id={otherProps["data-test-id"]} >
97
98
  <ReactMarkdown {...reactMarkdownProperties} />
98
99
  </HtmlContentBlock>
99
100
  );
@@ -1,15 +1,8 @@
1
1
  import React, { useState, useEffect, useCallback, FC } from "react";
2
2
  import { ComponentStory, ComponentMeta } from "@storybook/react";
3
- import { ReactFlow, EdgeTools, NodeTools, IconButton } from "./../../../index";
3
+ import { ReactFlow, EdgeTools, NodeTools } from "./../../../index";
4
4
  import { ReactFlowProps } from "./ReactFlow";
5
- import { ArrowHeadType, Elements, FlowElement, getMarkerEnd } from "react-flow-renderer";
6
-
7
- export default {
8
- title: "CMEM/React Flow/Configurations",
9
- component: ReactFlow,
10
- argTypes: {
11
- },
12
- } as ComponentMeta<typeof ReactFlow>;
5
+ import { Elements, FlowElement } from "react-flow-renderer";
13
6
 
14
7
  const nodeExamples = {
15
8
  unspecified: [
@@ -32,10 +25,10 @@ const nodeExamples = {
32
25
  position: { x: 200, y: 300 },
33
26
  },
34
27
  {
35
- id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'unspecified-1', target: 'unspecified-2',
28
+ id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'unspecified-1', target: 'unspecified-2',
36
29
  },
37
30
  {
38
- id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: 'unspecified-2', target: 'unspecified-1',
31
+ id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed", source: 'unspecified-2', target: 'unspecified-1',
39
32
  }
40
33
  ],
41
34
  linking: [
@@ -188,83 +181,19 @@ const nodeExamples = {
188
181
  { id: 'graph-e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: 'graph-4', target: 'graph-5' },
189
182
  { id: 'graph-e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: 'graph-5', target: 'graph-1' },
190
183
  ],
191
- inverseEdge: [
192
- {
193
- id: 'inverseEdge-1',
194
- type: "default",
195
- data: {
196
- label: "Default ", content: "Example content.", minimalShape: "none"
197
- },
198
- position: { x: 200, y: 50 },
199
- },
200
- {
201
- id: 'inverseEdge-2',
202
- type: "default",
203
- data: {
204
- label: "Default ", content: "Example content.", minimalShape: "none",
205
- handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
206
- inversePath: true,
207
- },
208
- position: { x: 200, y: 300 },
209
- },
210
- {
211
- id: 'inverseEdge-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'inverseEdge-1', target: 'inverseEdge-2',
212
- },
213
- {
214
- id: 'inverseEdge-e2', type: 'default', label: "inverse edge", source: 'inverseEdge-2', target: 'inverseEdge-1',
215
- data: {
216
- markerStart: getMarkerEnd(
217
- `${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType
218
- ),
219
- }
220
- }
221
- ],
222
- customLabel: [
223
- {
224
- id: 'customLabel-1',
225
- type: "default",
226
- data: {
227
- label: "Default ", content: "Example content.", minimalShape: "none"
228
- },
229
- position: { x: 200, y: 50 },
230
- },
231
- {
232
- id: 'customLabel-2',
233
- type: "default",
234
- data: {
235
- label: "Default ", content: "Example content.", minimalShape: "none",
236
- handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
237
- inversePath: true,
238
- },
239
- position: { x: 200, y: 300 },
240
- },
241
- {
242
- id: 'customLabel-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'customLabel-1', target: 'customLabel-2',
243
- },
244
- {
245
- id: 'customLabel-e2', type: 'default', label: "custom edge", arrowHeadType: "arrowclosed", source: 'customLabel-2', target: 'customLabel-1',
246
- data: {
247
- renderLabel: (
248
- edgeCenter: [number, number, number, number]
249
- ) => (
250
- <foreignObject
251
- width={30}
252
- height={30}
253
- x={edgeCenter[0] - 15}
254
- y={edgeCenter[1] - 15}
255
- className="instance-viz-multiedge"
256
- requiredExtensions="http://www.w3.org/1999/xhtml"
257
- >
258
- <body>
259
- <IconButton name="navigation-close" />
260
- </body>
261
- </foreignObject>
262
- )
263
- }
264
- }
265
- ]
266
184
  }
267
185
 
186
+ export default {
187
+ title: "CMEM/React Flow/Configurations",
188
+ component: ReactFlow,
189
+ argTypes: {
190
+ configuration: {
191
+ control: "select",
192
+ options: Object.keys(nodeExamples),
193
+ }
194
+ },
195
+ } as ComponentMeta<typeof ReactFlow>;
196
+
268
197
  const ReactFlowExample: FC<ReactFlowProps> = (args) => {
269
198
  const [reactflowInstance, setReactflowInstance] = useState(null);
270
199
  const [elements, setElements] = useState([] as Elements);
@@ -5,14 +5,12 @@ import * as unspecifiedConfig from "./../configuration/unspecified";
5
5
  import * as graphConfig from "./../configuration/graph";
6
6
  import * as workflowConfig from "./../configuration/workflow";
7
7
  import * as linkingConfig from "./../configuration/linking";
8
- import * as inverseEdgeConfig from "./../configuration/inverseEdge";
9
- import * as customLabelConfig from "./../configuration/customLabel";
10
8
 
11
9
  export interface ReactFlowProps extends ReactFlowOriginalProps {
12
10
  /**
13
11
  * Load `ReactFlow` component with pre-configured values for `nodeTypes` and `edgeTypes`
14
12
  */
15
- configuration?: "unspecified" | "graph" | "workflow" | "linking" | "inverseEdge" | "customLabel";
13
+ configuration?: "unspecified" | "graph" | "workflow" | "linking";
16
14
  }
17
15
 
18
16
  /**
@@ -31,8 +29,6 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
31
29
  graph: graphConfig,
32
30
  workflow: workflowConfig,
33
31
  linking: linkingConfig,
34
- inverseEdge: inverseEdgeConfig,
35
- customLabel: customLabelConfig,
36
32
  }
37
33
 
38
34
  return (
@@ -1,10 +1,40 @@
1
1
  import React from "react";
2
- import {Accordion as CarbonAccordion} from "carbon-components-react";
2
+ import {
3
+ Accordion as CarbonAccordion,
4
+ AccordionProps as CarbonAccordionProps,
5
+ } from "carbon-components-react";
3
6
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
4
7
 
5
- function Accordion({ children, className = "", align = "start", ...otherProps }: any) {
8
+ export interface AccordionProps extends Omit<CarbonAccordionProps, "className" | "size"> {
9
+ /**
10
+ * Additional CSS classes.
11
+ */
12
+ className?: string;
13
+ /**
14
+ * How much space is used for the header of the each of the accordion items.
15
+ */
16
+ size?: "small" | "medium" | "large";
17
+ }
18
+
19
+ const carbonAccordionSizeMapping = {
20
+ "small": "sm" as "sm",
21
+ "medium": "md" as "md",
22
+ "large": "lg" as "lg"
23
+ }
24
+
25
+ function Accordion({
26
+ children,
27
+ className = "",
28
+ align = "start",
29
+ size = "medium",
30
+ ...otherProps
31
+ }: AccordionProps) {
6
32
  return (
7
- <CarbonAccordion className={`${eccgui}-accordion__container ` + className} align={align} {...otherProps}>
33
+ <CarbonAccordion
34
+ className={`${eccgui}-accordion__container ` + className}
35
+ align={align}
36
+ size={carbonAccordionSizeMapping[size]}
37
+ {...otherProps}>
8
38
  {children}
9
39
  </CarbonAccordion>
10
40
  );
@@ -1,45 +1,35 @@
1
1
  import React from "react";
2
- import {AccordionItem as CarbonAccordionItem} from "carbon-components-react";
2
+ import {
3
+ AccordionItem as CarbonAccordionItem,
4
+ AccordionItemProps as CarbonAccordionItemProps,
5
+ } from "carbon-components-react";
3
6
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
4
7
 
5
- export interface AccordionItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
6
- /*
7
- additional user class name
8
- */
8
+ export interface AccordionItemProps extends Omit<CarbonAccordionItemProps, "title" | "iconDescription" | "renderExpando"> {
9
+ /**
10
+ * additional user class name
11
+ */
9
12
  className?: string;
10
- /*
11
- content of accordion item
12
- */
13
- children: string | JSX.Element | JSX.Element[];
14
- /*
15
- disable accordion item
16
- */
17
- disabled?: boolean;
18
- /*
19
- set accordion item expliciteky as open when displayed first
20
- */
21
- open?: boolean;
22
- /*
23
- header of accordion item
24
- */
13
+ /**
14
+ * header of accordion item
15
+ */
25
16
  label: string | JSX.Element;
26
- /*
27
- use full available width for content
28
- */
17
+ /**
18
+ * use full available width for content
19
+ */
29
20
  fullWidth?: boolean;
30
- /*
31
- minimize white space and paddings
32
- */
21
+ /**
22
+ * minimize white space and paddings
23
+ */
33
24
  condensed?: boolean;
34
- /*
35
- do not use borders as visible separations on accordion item
36
- */
25
+ /**
26
+ * do not use borders as visible separations on accordion item
27
+ */
37
28
  noBorder?: boolean;
38
- /*
39
- highlight accordion item by different background color
40
- */
29
+ /**
30
+ * highlight accordion item by different background color
31
+ */
41
32
  elevated?: boolean;
42
- title?: never;
43
33
  };
44
34
 
45
35
  function AccordionItem({
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { Accordion, AccordionItem } from "../../../../index";
4
+ import { Default as AccordionStoryItem } from '../Stories/AccordionItem.stories'
5
+
6
+ export default {
7
+ title: "Components/Accordion",
8
+ component: Accordion,
9
+ subcomponents: { AccordionItem },
10
+ argTypes: {
11
+ children: {
12
+ control: "none",
13
+ description: "Elements to include into the Accordion component"
14
+ },
15
+ }
16
+
17
+ } as ComponentMeta<typeof Accordion>;
18
+
19
+ const TemplateIcons: ComponentStory<typeof Accordion> = (args) => (
20
+ <Accordion {...args} />
21
+ );
22
+ export const Default = TemplateIcons.bind({});
23
+ Default.args = {
24
+ children : [
25
+ <AccordionItem {...AccordionStoryItem.args} label="Accordion item 1" />,
26
+ <AccordionItem {...AccordionStoryItem.args} label="Accordion item 2 (elevated)" elevated />,
27
+ <AccordionItem {...AccordionStoryItem.args} label="Accordion item 3 (initially opened)" open />,
28
+ <AccordionItem {...AccordionStoryItem.args} label="Accordion item 4 (disabled)" disabled />,
29
+ <AccordionItem {...AccordionStoryItem.args} label="Accordion item 5" />,
30
+ ],
31
+ align: "start",
32
+ size: "medium"
33
+ };
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { Accordion, AccordionItem, HtmlContentBlock } from "../../../../index";
4
+ import { LoremIpsum } from 'react-lorem-ipsum';
5
+
6
+ export default {
7
+ title: "Components/Accordion/AccordionItem",
8
+ component: AccordionItem,
9
+ argTypes: {
10
+ children: {
11
+ control: "none",
12
+ description: "content of accordion item"
13
+ },
14
+ }
15
+
16
+ } as ComponentMeta<typeof AccordionItem>;
17
+
18
+ const Template : ComponentStory<typeof AccordionItem> = (args) => (
19
+ <Accordion>
20
+ <AccordionItem {...args} />
21
+ </Accordion>
22
+ );
23
+ export const Default = Template.bind({});
24
+ Default.args = {
25
+ label: "Title of accordion item",
26
+ children : <HtmlContentBlock><LoremIpsum p={2} avgSentencesPerParagraph={4} random={false} /></HtmlContentBlock>
27
+ };
@@ -1,3 +1,8 @@
1
+ // own vars
2
+ $eccgui-color-accordion-background-elevated: rgba($eccgui-color-accent, 0.1) !default;
3
+ $eccgui-color-accordion-toggler-hover: $menu-item-color-hover !default;
4
+ $eccgui-color-accordion-toggler-elevated-hover: mix($eccgui-color-accordion-background-elevated, $eccgui-color-accordion-toggler-hover, 50%) !default;
5
+
1
6
  // lib import
2
7
  @import "~carbon-components/scss/components/accordion/accordion";
3
8
 
@@ -57,8 +62,22 @@
57
62
  }
58
63
  }
59
64
 
65
+ .#{$prefix}--accordion__heading {
66
+ &:hover::before,
67
+ &:focus::before {
68
+ background-color: $eccgui-color-accordion-toggler-hover;
69
+ }
70
+ }
71
+
60
72
  .#{$eccgui}-accordion__item--elevated {
61
- background-color: $data-table-zebra-color; //rgba($ui-03, alpha($ui-03) * $eccgui-opacity-muted);
73
+ background-color: $eccgui-color-accordion-background-elevated;
74
+
75
+ .#{$prefix}--accordion__heading {
76
+ &:hover::before,
77
+ &:focus::before {
78
+ background-color: $eccgui-color-accordion-toggler-elevated-hover;
79
+ }
80
+ }
62
81
  }
63
82
 
64
83
  .#{$eccgui}-accordion__item--noborder {