@eccenca/gui-elements 23.0.0-rc.3 → 23.0.0-rc.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.
Files changed (185) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +2 -1
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/common/utils/colorDecideContrastvalue.js +18 -0
  5. package/dist/cjs/common/utils/colorDecideContrastvalue.js.map +1 -0
  6. package/dist/cjs/common/utils/getColorConfiguration.js +9 -5
  7. package/dist/cjs/common/utils/getColorConfiguration.js.map +1 -1
  8. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +18 -16
  9. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  10. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +15 -2
  11. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  12. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
  13. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  14. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +9 -7
  15. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  16. package/dist/cjs/components/Breadcrumb/BreadcrumbList.js +28 -8
  17. package/dist/cjs/components/Breadcrumb/BreadcrumbList.js.map +1 -1
  18. package/dist/cjs/components/Card/Card.js +1 -1
  19. package/dist/cjs/components/Card/CardContent.js.map +1 -1
  20. package/dist/cjs/components/ContextOverlay/ContextMenu.js +3 -3
  21. package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
  22. package/dist/cjs/components/Form/FieldItem.js +4 -1
  23. package/dist/cjs/components/Form/FieldItem.js.map +1 -1
  24. package/dist/cjs/components/Form/FieldItemRow.js +7 -6
  25. package/dist/cjs/components/Form/FieldItemRow.js.map +1 -1
  26. package/dist/cjs/components/Grid/Grid.js +1 -1
  27. package/dist/cjs/components/Grid/Grid.js.map +1 -1
  28. package/dist/cjs/components/Grid/GridColumn.js +1 -1
  29. package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
  30. package/dist/cjs/components/Grid/GridRow.js.map +1 -1
  31. package/dist/cjs/components/HoverToggler/HoverToggler.js +33 -0
  32. package/dist/cjs/components/HoverToggler/HoverToggler.js.map +1 -0
  33. package/dist/cjs/components/Icon/canonicalIconNames.js +35 -0
  34. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  35. package/dist/cjs/components/InteractionGate/InteractionGate.js +66 -0
  36. package/dist/cjs/components/InteractionGate/InteractionGate.js.map +1 -0
  37. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  38. package/dist/cjs/components/Spinner/Spinner.js +6 -6
  39. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  40. package/dist/cjs/components/Switch/Switch.js +4 -2
  41. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  42. package/dist/cjs/components/Tabs/Tab.js +2 -1
  43. package/dist/cjs/components/Tabs/Tab.js.map +1 -1
  44. package/dist/cjs/components/Tag/Tag.js +2 -1
  45. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  46. package/dist/cjs/components/Tag/TagList.js +1 -1
  47. package/dist/cjs/components/Tag/TagList.js.map +1 -1
  48. package/dist/cjs/components/TextField/TextField.js +3 -0
  49. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  50. package/dist/cjs/components/Tooltip/Tooltip.js +9 -2
  51. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
  52. package/dist/cjs/components/Tree/Tree.js +37 -0
  53. package/dist/cjs/components/Tree/Tree.js.map +1 -0
  54. package/dist/cjs/index.js +12 -5
  55. package/dist/cjs/index.js.map +1 -1
  56. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +2 -1
  57. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  58. package/dist/esm/common/utils/colorDecideContrastvalue.js +14 -0
  59. package/dist/esm/common/utils/colorDecideContrastvalue.js.map +1 -0
  60. package/dist/esm/common/utils/getColorConfiguration.js +9 -5
  61. package/dist/esm/common/utils/getColorConfiguration.js.map +1 -1
  62. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +35 -33
  63. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  64. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +25 -2
  65. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  66. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
  67. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  68. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +15 -13
  69. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  70. package/dist/esm/components/Breadcrumb/BreadcrumbList.js +9 -8
  71. package/dist/esm/components/Breadcrumb/BreadcrumbList.js.map +1 -1
  72. package/dist/esm/components/Card/Card.js +1 -1
  73. package/dist/esm/components/Card/CardContent.js.map +1 -1
  74. package/dist/esm/components/ContextOverlay/ContextMenu.js +3 -3
  75. package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
  76. package/dist/esm/components/Form/FieldItem.js +4 -1
  77. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  78. package/dist/esm/components/Form/FieldItemRow.js +7 -6
  79. package/dist/esm/components/Form/FieldItemRow.js.map +1 -1
  80. package/dist/esm/components/Grid/Grid.js +1 -1
  81. package/dist/esm/components/Grid/Grid.js.map +1 -1
  82. package/dist/esm/components/Grid/GridColumn.js +1 -1
  83. package/dist/esm/components/Grid/GridColumn.js.map +1 -1
  84. package/dist/esm/components/Grid/GridRow.js.map +1 -1
  85. package/dist/esm/components/HoverToggler/HoverToggler.js +37 -0
  86. package/dist/esm/components/HoverToggler/HoverToggler.js.map +1 -0
  87. package/dist/esm/components/Icon/canonicalIconNames.js +35 -0
  88. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  89. package/dist/esm/components/InteractionGate/InteractionGate.js +53 -0
  90. package/dist/esm/components/InteractionGate/InteractionGate.js.map +1 -0
  91. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  92. package/dist/esm/components/Spinner/Spinner.js +7 -7
  93. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  94. package/dist/esm/components/Switch/Switch.js +4 -2
  95. package/dist/esm/components/Switch/Switch.js.map +1 -1
  96. package/dist/esm/components/Tabs/Tab.js +2 -1
  97. package/dist/esm/components/Tabs/Tab.js.map +1 -1
  98. package/dist/esm/components/Tag/Tag.js +2 -1
  99. package/dist/esm/components/Tag/Tag.js.map +1 -1
  100. package/dist/esm/components/Tag/TagList.js +1 -1
  101. package/dist/esm/components/Tag/TagList.js.map +1 -1
  102. package/dist/esm/components/TextField/TextField.js +3 -0
  103. package/dist/esm/components/TextField/TextField.js.map +1 -1
  104. package/dist/esm/components/Tooltip/Tooltip.js +9 -2
  105. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  106. package/dist/esm/components/Tree/Tree.js +40 -0
  107. package/dist/esm/components/Tree/Tree.js.map +1 -0
  108. package/dist/esm/index.js +9 -5
  109. package/dist/esm/index.js.map +1 -1
  110. package/dist/types/cmem/markdown/Markdown.d.ts +1 -2
  111. package/dist/types/common/utils/colorDecideContrastvalue.d.ts +9 -0
  112. package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +7 -1
  113. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +3 -3
  114. package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +1 -1
  115. package/dist/types/components/Card/CardContent.d.ts +2 -2
  116. package/dist/types/components/ContextOverlay/ContextMenu.d.ts +3 -1
  117. package/dist/types/components/Form/FieldItem.d.ts +6 -3
  118. package/dist/types/components/Form/FieldItemRow.d.ts +11 -3
  119. package/dist/types/components/Grid/Grid.d.ts +6 -1
  120. package/dist/types/components/Grid/GridColumn.d.ts +8 -1
  121. package/dist/types/components/Grid/GridRow.d.ts +7 -1
  122. package/dist/types/components/HoverToggler/HoverToggler.d.ts +24 -0
  123. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  124. package/dist/types/components/InteractionGate/InteractionGate.d.ts +23 -0
  125. package/dist/types/components/Notification/Notification.d.ts +1 -1
  126. package/dist/types/components/Pagination/Pagination.d.ts +21 -4
  127. package/dist/types/components/Spinner/Spinner.d.ts +7 -1
  128. package/dist/types/components/Switch/Switch.d.ts +5 -1
  129. package/dist/types/components/Tooltip/Tooltip.d.ts +12 -1
  130. package/dist/types/components/Tree/Tree.d.ts +43 -0
  131. package/dist/types/index.d.ts +5 -2
  132. package/package.json +3 -2
  133. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +2 -1
  134. package/src/cmem/markdown/Markdown.tsx +1 -1
  135. package/src/common/utils/colorDecideContrastvalue.ts +28 -0
  136. package/src/common/utils/getColorConfiguration.ts +10 -5
  137. package/src/components/AutoSuggestion/AutoSuggestion.scss +16 -10
  138. package/src/components/AutoSuggestion/AutoSuggestion.tsx +81 -52
  139. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +5 -2
  140. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -3
  141. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
  142. package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +2 -1
  143. package/src/components/AutocompleteField/AutoCompleteField.tsx +5 -2
  144. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +15 -4
  145. package/src/components/Breadcrumb/BreadcrumbList.tsx +10 -8
  146. package/src/components/Breadcrumb/breadcrumb.scss +4 -0
  147. package/src/components/Breadcrumb/stories/BreadcrumbList.stories.tsx +1 -0
  148. package/src/components/Card/Card.tsx +1 -1
  149. package/src/components/Card/CardContent.tsx +2 -2
  150. package/src/components/ContextOverlay/ContextMenu.tsx +4 -0
  151. package/src/components/Form/FieldItem.tsx +6 -3
  152. package/src/components/Form/FieldItemRow.tsx +28 -6
  153. package/src/components/Form/form.scss +6 -0
  154. package/src/components/Grid/Grid.tsx +9 -3
  155. package/src/components/Grid/GridColumn.tsx +10 -2
  156. package/src/components/Grid/GridRow.tsx +8 -1
  157. package/src/components/HoverToggler/HoverToggler.stories.tsx +20 -0
  158. package/src/components/HoverToggler/HoverToggler.tsx +58 -0
  159. package/src/components/HoverToggler/hovertoggler.scss +45 -0
  160. package/src/components/Icon/canonicalIconNames.tsx +46 -0
  161. package/src/components/InteractionGate/InteractionGate.stories.tsx +32 -0
  162. package/src/components/InteractionGate/InteractionGate.tsx +65 -0
  163. package/src/components/InteractionGate/interactiongate.scss +11 -0
  164. package/src/components/Link/link.scss +9 -0
  165. package/src/components/Notification/Notification.tsx +1 -1
  166. package/src/components/Pagination/Pagination.tsx +22 -6
  167. package/src/components/SimpleTable/simpletable.scss +62 -2
  168. package/src/components/Spinner/Spinner.tsx +13 -5
  169. package/src/components/Spinner/spinner.scss +14 -0
  170. package/src/components/Switch/Switch.tsx +10 -5
  171. package/src/components/Tabs/Tab.tsx +2 -1
  172. package/src/components/Tag/Tag.tsx +2 -1
  173. package/src/components/Tag/TagList.tsx +1 -1
  174. package/src/components/Tag/tag.scss +1 -0
  175. package/src/components/TextField/TextField.tsx +4 -0
  176. package/src/components/TextField/stories/TextField.stories.tsx +1 -0
  177. package/src/components/TextField/textfield.scss +25 -1
  178. package/src/components/Tooltip/Tooltip.stories.tsx +15 -7
  179. package/src/components/Tooltip/Tooltip.tsx +24 -1
  180. package/src/components/Tree/Tree.stories.tsx +63 -0
  181. package/src/components/Tree/Tree.tsx +61 -0
  182. package/src/components/Tree/tree.scss +28 -0
  183. package/src/includes/carbon-components/_variables.scss +3 -1
  184. package/src/index.scss +5 -2
  185. package/src/index.ts +14 -5
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, {useCallback} from "react";
2
2
  import {
3
3
  Breadcrumbs2 as BlueprintBreadcrumbList,
4
4
  Breadcrumbs2Props as BlueprintBreadcrumbsProps,
@@ -60,7 +60,7 @@ function BreadcrumbList({
60
60
  latenOverflow = false,
61
61
  ...otherBlueprintBreadcrumbsProps
62
62
  }: BreadcrumbListProps) {
63
- const renderBreadcrumb = (propsBreadcrumb: BreadcrumbItemProps) => {
63
+ const renderBreadcrumb = useCallback((propsBreadcrumb: BreadcrumbItemProps) => {
64
64
  const {onClick, ...otherProps} = propsBreadcrumb;
65
65
  return (
66
66
  <BreadcrumbItem
@@ -75,11 +75,15 @@ function BreadcrumbList({
75
75
  }
76
76
  />
77
77
  );
78
- };
78
+ }, [onItemClick]);
79
79
 
80
- const renderCurrentBreadcrumb = (propsBreadcrumb: BreadcrumbItemProps) => {
80
+ const renderCurrentBreadcrumb = React.useCallback((propsBreadcrumb: BreadcrumbItemProps) => {
81
81
  return <BreadcrumbItem {...propsBreadcrumb} current={true} /*itemDivider={itemDivider}*/ />;
82
- };
82
+ }, []);
83
+
84
+ const overflowListProps = React.useMemo(() => ignoreOverflow ? {
85
+ minVisibleItems: otherBlueprintBreadcrumbsProps.items.length,
86
+ } : {}, [ignoreOverflow, otherBlueprintBreadcrumbsProps.items.length])
83
87
 
84
88
  return (
85
89
  <BlueprintBreadcrumbList
@@ -93,9 +97,7 @@ function BreadcrumbList({
93
97
  minVisibleItems={1}
94
98
  breadcrumbRenderer={renderBreadcrumb}
95
99
  currentBreadcrumbRenderer={renderCurrentBreadcrumb}
96
- overflowListProps={ignoreOverflow ? {
97
- minVisibleItems: otherBlueprintBreadcrumbsProps.items.length,
98
- } : {}}
100
+ overflowListProps={overflowListProps}
99
101
  />
100
102
  );
101
103
  }
@@ -67,4 +67,8 @@ a.#{$eccgui}-breadcrumb__item {
67
67
  text-decoration: none;
68
68
  }
69
69
  }
70
+ a {
71
+ @extend .#{$eccgui}-breadcrumb__item;
72
+ @extend .#{$ns}-breadcrumb;
73
+ }
70
74
  }
@@ -21,6 +21,7 @@ Default.args = {
21
21
  {text: "Main click category", onClick: () => alert("Breadcrumb click")},
22
22
  {text: <div>Sub category item</div>, href: "#"},
23
23
  {text: <span>Disabled breadcrumb with a very long title</span>, disabled: true},
24
+ {text: <a href="#wrong">Wrongly placed link inside link</a>},
24
25
  {text: "Current breadcrumb item", current: true}
25
26
  ],
26
27
  };
@@ -49,7 +49,7 @@ function Card({
49
49
  behavior: "smooth",
50
50
  block: scrollinOnFocus,
51
51
  inline: scrollinOnFocus,
52
- })}, 100);
52
+ })}, 200);
53
53
  }
54
54
  } : {}
55
55
  const cardElement = (
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
3
 
4
- export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  }
6
6
 
7
7
  /**
@@ -12,7 +12,7 @@ function CardContent({
12
12
  children,
13
13
  className='',
14
14
  ...otherProps
15
- }: OverviewItemProps) {
15
+ }: CardContentProps) {
16
16
  return (
17
17
  <div
18
18
  {...otherProps}
@@ -38,6 +38,8 @@ interface ContextMenuProps extends TestableComponent {
38
38
  * Props to spread to `ContextOverlay` that is used to display the dropdown.
39
39
  */
40
40
  contextOverlayProps?: Partial<Omit<ContextOverlayProps, "content" | "children" | "className">>
41
+ /** Disables the button to open the menu. */
42
+ disabled?: boolean
41
43
  }
42
44
 
43
45
  /**
@@ -49,6 +51,7 @@ function ContextMenu({
49
51
  togglerElement = "item-moremenu",
50
52
  togglerText = "Show more options",
51
53
  contextOverlayProps,
54
+ disabled,
52
55
  togglerLarge = false,
53
56
  /* FIXME: The Tooltip component can interfere with the opened menu, since it is implemented via portal and may cover the menu,
54
57
  so by default we use the title attribute instead of Tooltip. */
@@ -68,6 +71,7 @@ function ContextMenu({
68
71
  name={[togglerElement]}
69
72
  text={togglerText}
70
73
  large={togglerLarge}
74
+ disabled={!!disabled}
71
75
  data-test-id={restProps["data-test-id"]}
72
76
  />
73
77
  ) : (
@@ -13,7 +13,7 @@ import {TestableComponent} from "../interfaces";
13
13
  * input id could be created when not given
14
14
  */
15
15
 
16
- interface IProps extends TestableComponent {
16
+ export interface FieldItemProps extends React.HTMLAttributes<HTMLDivElement>, TestableComponent {
17
17
  hasStatePrimary?: boolean
18
18
  hasStateSuccess?: boolean
19
19
  hasStateWarning?: boolean
@@ -26,6 +26,9 @@ interface IProps extends TestableComponent {
26
26
  messageText?: string
27
27
  }
28
28
 
29
+ /**
30
+ * Form element that manages the combination of label, helper texts, input element and feedback messages.
31
+ */
29
32
  function FieldItem({
30
33
  hasStatePrimary = false,
31
34
  hasStateSuccess = false,
@@ -38,7 +41,7 @@ function FieldItem({
38
41
  helperText,
39
42
  messageText,
40
43
  ...otherProps
41
- }: IProps) {
44
+ }: FieldItemProps) {
42
45
  let classIntent = "";
43
46
  switch (true) {
44
47
  case hasStatePrimary:
@@ -79,10 +82,10 @@ function FieldItem({
79
82
 
80
83
  return (
81
84
  <div
82
- data-test-id={otherProps["data-test-id"]}
83
85
  className={
84
86
  `${eccgui}-fielditem` + (className ? " " + className : "") + (disabled ? ` ${eccgui}-fielditem--disabled` : "")
85
87
  }
88
+ {...otherProps}
86
89
  >
87
90
  {label}
88
91
  {userhelp}
@@ -1,12 +1,34 @@
1
1
  import React from "react";
2
2
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
3
 
4
- /*
5
- FIXME: allow grow factors for children
6
- */
7
- /** Allows to layout field items horizontally. */
8
- function FieldItemRow({ children, className, ...otherProps }: any) {
9
- return <div className={`${eccgui}-fielditem__row` + (className ? " " + className : "")} {...otherProps}>{children}</div>;
4
+ export interface FieldItemRowProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * If set to `true` all `FieldItem` childrens have the same width.
7
+ */
8
+ justifyItemWidths?: boolean;
9
+ }
10
+
11
+ /**
12
+ * Allows to display `FieldItem` children horizontally in one row.
13
+ */
14
+ function FieldItemRow({
15
+ children,
16
+ className,
17
+ justifyItemWidths = false,
18
+ ...otherProps
19
+ }: FieldItemRowProps) {
20
+ return (
21
+ <div
22
+ className={
23
+ `${eccgui}-fielditem__row` +
24
+ (justifyItemWidths ? ` ${eccgui}-fielditem__row--justified` : "") +
25
+ (className ? ` ${className}` : "")
26
+ }
27
+ {...otherProps}
28
+ >
29
+ {children}
30
+ </div>
31
+ );
10
32
  }
11
33
 
12
34
  export default FieldItemRow;
@@ -157,3 +157,9 @@ form {
157
157
  margin-bottom: $eccgui-size-block-whitespace;
158
158
  }
159
159
  }
160
+
161
+ .#{$eccgui}-fielditem__row--justified {
162
+ & > .#{$eccgui}-fielditem {
163
+ width: 100%;
164
+ }
165
+ }
@@ -2,14 +2,20 @@ import React from "react";
2
2
  // import PropTypes from 'prop-types';
3
3
  import { Grid as CarbonGrid } from "carbon-components-react";
4
4
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
5
+ import {GridDefaultProps} from "carbon-components-react/lib/components/Grid/Grid";
6
+
7
+ interface GridProps extends GridDefaultProps {
8
+ verticalStretchable?: boolean
9
+ useAbsoluteSpace?: boolean
10
+ }
5
11
 
6
12
  function Grid({
7
13
  children,
8
- verticalStretchable,
9
- useAbsoluteSpace,
14
+ verticalStretchable = false,
15
+ useAbsoluteSpace = false,
10
16
  className = '',
11
17
  ...restProps
12
- }: any) {
18
+ }: GridProps) {
13
19
  return (
14
20
  <CarbonGrid
15
21
  {...restProps}
@@ -2,6 +2,14 @@ import React from "react";
2
2
  // import PropTypes from 'prop-types';
3
3
  import { Column as CarbonColumn } from "carbon-components-react";
4
4
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
5
+ import {ColumnDefaultProps} from "carbon-components-react/lib/components/Grid/Column";
6
+
7
+ interface GridColumnProps extends ColumnDefaultProps {
8
+ small?: boolean
9
+ medium?: boolean
10
+ full?: boolean
11
+ verticalAlign?: "center"
12
+ }
5
13
 
6
14
  function GridColumn({
7
15
  children,
@@ -9,9 +17,9 @@ function GridColumn({
9
17
  small = false,
10
18
  medium = false,
11
19
  full = true,
12
- verticalAlign = '',
20
+ verticalAlign,
13
21
  ...otherProps
14
- }: any) {
22
+ }: GridColumnProps) {
15
23
  let sizeConfig = {};
16
24
  if (small) sizeConfig = { md:2, lg:3 };
17
25
  if (medium) sizeConfig = { md:3, lg:5 };
@@ -2,6 +2,13 @@ import React from "react";
2
2
  // import PropTypes from 'prop-types';
3
3
  import { Row as CarbonRow } from "carbon-components-react";
4
4
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
5
+ import {RowDefaultProps} from "carbon-components-react/lib/components/Grid/Row";
6
+
7
+ interface GridRowProps extends RowDefaultProps {
8
+ dontWrapColumns?: boolean
9
+ fullHeight?: boolean
10
+ verticalStretched?: boolean
11
+ }
5
12
 
6
13
  function GridRow({
7
14
  children,
@@ -10,7 +17,7 @@ function GridRow({
10
17
  fullHeight = false,
11
18
  verticalStretched,
12
19
  ...otherProps
13
- }: any) {
20
+ }: GridRowProps) {
14
21
  return (
15
22
  <CarbonRow
16
23
  {...otherProps}
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { HoverToggler } from "./../../index";
4
+
5
+ export default {
6
+ title: "Components/HoverToggler",
7
+ component: HoverToggler,
8
+ argTypes: {
9
+ },
10
+ } as ComponentMeta<typeof HoverToggler>;
11
+
12
+ const Template: ComponentStory<typeof HoverToggler> = (args) => (
13
+ <HoverToggler {...args} style={{height: "auto"}} />
14
+ );
15
+
16
+ export const Default = Template.bind({});
17
+ Default.args = {
18
+ baseContent: "Base content.",
19
+ hoverContent: <>Content<br/>on <a href="#">hover</a>.</>
20
+ };
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
+
4
+ interface HoverTogglerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
5
+ /**
6
+ * Additional CSS class name.
7
+ */
8
+ className?: string;
9
+ /**
10
+ * The content that is shown when not hovered.
11
+ */
12
+ baseContent: JSX.Element;
13
+ baseContentProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
14
+ /**
15
+ * The content that is shown when hovered.
16
+ */
17
+ hoverContent: JSX.Element;
18
+ hoverContentProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
19
+ /**
20
+ * Display as inline element.
21
+ */
22
+ inline?: boolean;
23
+ }
24
+
25
+ /** Displays a specific element. Displays another element when hovered. */
26
+ export const HoverToggler = ({
27
+ className = "",
28
+ baseContent,
29
+ baseContentProps,
30
+ hoverContent,
31
+ hoverContentProps,
32
+ inline = false,
33
+ style,
34
+ ...otherProps
35
+ }: HoverTogglerProps) => {
36
+ return (<div
37
+ className={
38
+ `${eccgui}-hovertoggler__wrapper` +
39
+ (inline ? ` ${eccgui}-hovertoggler--inline` : "")
40
+ }
41
+ style={style}
42
+ >
43
+ <div
44
+ className={
45
+ `${eccgui}-hovertoggler` +
46
+ (className ? ` ${className}` : "")
47
+ }
48
+ {...otherProps}
49
+ >
50
+ <div className={`${eccgui}-hovertoggler__basecontent`}>
51
+ <div className={`${eccgui}-hovertoggler__wrappercontent`} {...baseContentProps}>{ baseContent }</div>
52
+ </div>
53
+ <div className={`${eccgui}-hovertoggler__hovercontent`}>
54
+ <div tabIndex={0} className={`${eccgui}-hovertoggler__wrappercontent`} {...hoverContentProps}>{ hoverContent }</div>
55
+ </div>
56
+ </div>
57
+ </div>);
58
+ }
@@ -0,0 +1,45 @@
1
+ .#{$eccgui}-hovertoggler__wrapper {
2
+ width: 100%;
3
+ overflow: hidden;
4
+ display: flex;
5
+ justify-content: flex-start;
6
+ align-items: center;
7
+ }
8
+
9
+ .#{$eccgui}-hovertoggler--inline {
10
+ display: inline-flex;
11
+ width: auto;
12
+ }
13
+
14
+ .#{$eccgui}-hovertoggler {
15
+ display: flex;
16
+ width: 200%;
17
+ justify-content: flex-start;
18
+ align-items: stretch;
19
+ flex-shrink: 0;
20
+
21
+ .#{$eccgui}-hovertoggler--inline > & {
22
+ display: inline-flex;
23
+ }
24
+ }
25
+
26
+ .#{$eccgui}-hovertoggler__basecontent,
27
+ .#{$eccgui}-hovertoggler__hovercontent {
28
+ overflow: hidden;
29
+ order: 1;
30
+ flex-grow: 0;
31
+ flex-shrink: 0;
32
+ width: 50%;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ }
37
+
38
+ .#{$eccgui}-hovertoggler__hovercontent {
39
+ order: 2;
40
+
41
+ .#{$eccgui}-hovertoggler:hover > &,
42
+ &:focus-within {
43
+ order: 0;
44
+ }
45
+ }
@@ -57,8 +57,10 @@ export type ValidIconName =
57
57
  | "item-start"
58
58
  | "item-stop"
59
59
  | "item-reload"
60
+ | "item-reset"
60
61
  | "item-shuffle"
61
62
  | "item-draggable"
63
+ | "item-settings"
62
64
  | "operation-search"
63
65
  | "operation-clear"
64
66
  | "operation-undo"
@@ -84,6 +86,8 @@ export type ValidIconName =
84
86
  | "state-checked"
85
87
  | "state-checkedsimple"
86
88
  | "state-partlychecked"
89
+ | "state-declined"
90
+ | "state-confirmed"
87
91
  | "artefact-project"
88
92
  | "artefact-workflow"
89
93
  | "artefact-dataset"
@@ -116,6 +120,9 @@ export type ValidIconName =
116
120
  | "operation-auto-graph-layout"
117
121
  | "unlinked-item"
118
122
  | "write-protected"
123
+ | "settings"
124
+ | "favorite-empty"
125
+ | "favorite-filled"
119
126
  | "undefined"
120
127
  | "Undefined";
121
128
 
@@ -397,6 +404,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
397
404
  normal: icons.Renew20,
398
405
  large: icons.Renew32,
399
406
  },
407
+ "item-reset": {
408
+ small: icons.Reset16,
409
+ normal: icons.Reset20,
410
+ large: icons.Reset32,
411
+ },
400
412
  "item-comment": {
401
413
  small: icons.AddComment16,
402
414
  normal: icons.AddComment20,
@@ -412,6 +424,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
412
424
  normal: icons.Draggable20,
413
425
  large: icons.Draggable32,
414
426
  },
427
+ "item-settings": {
428
+ small: icons.Settings16,
429
+ normal: icons.Settings20,
430
+ large: icons.Settings32,
431
+ },
415
432
 
416
433
  "operation-search": {
417
434
  small: icons.Search16,
@@ -541,6 +558,17 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
541
558
  normal: icons.CheckboxIndeterminate20,
542
559
  large: icons.CheckboxIndeterminate32,
543
560
  },
561
+ "state-declined": {
562
+ small: icons.ThumbsDown16,
563
+ normal: icons.ThumbsDown20,
564
+ large: icons.ThumbsDown32
565
+ },
566
+ "state-confirmed": {
567
+ small: icons.ThumbsUp16,
568
+ normal: icons.ThumbsUp20,
569
+ large: icons.ThumbsUp32
570
+ },
571
+
544
572
 
545
573
  "artefact-project": {
546
574
  small: icons.Folder16,
@@ -708,6 +736,24 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
708
736
  large: icons.DocumentProtected32,
709
737
  },
710
738
 
739
+ "settings": {
740
+ small: icons.Settings16,
741
+ normal: icons.Settings20,
742
+ large: icons.Settings32
743
+ },
744
+
745
+ "favorite-empty": {
746
+ small: icons.Star16,
747
+ normal: icons.Star20,
748
+ large: icons.Star32
749
+ },
750
+
751
+ "favorite-filled": {
752
+ small: icons.StarFilled16,
753
+ normal: icons.StarFilled20,
754
+ large: icons.StarFilled32
755
+ },
756
+
711
757
  undefined: {
712
758
  small: icons.Undefined16,
713
759
  normal: icons.Undefined20,
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { LoremIpsum } from 'react-lorem-ipsum';
4
+
5
+ import { InteractionGate, Spinner, Link, Button, HtmlContentBlock } from "./../../index";
6
+
7
+ export default {
8
+ title: "Components/InteractionGate",
9
+ component: InteractionGate,
10
+ subcomponents: { Spinner },
11
+ argTypes: {
12
+ children: {
13
+ control: "none",
14
+ description: "Any sub lements, could contain elements that provide options for user interactions."
15
+ }
16
+ },
17
+ } as ComponentMeta<typeof InteractionGate>;
18
+
19
+ const Template: ComponentStory<typeof InteractionGate> = (args) => (
20
+ <InteractionGate {...args}></InteractionGate>
21
+ );
22
+
23
+ export const Default = Template.bind({});
24
+ Default.args = {
25
+ children: (
26
+ <HtmlContentBlock>
27
+ <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
28
+ <p><Link href="https://example.net">Link</Link></p>
29
+ <p><Button onClick={() => alert("click")}>Button</Button></p>
30
+ </HtmlContentBlock>
31
+ )
32
+ }
@@ -0,0 +1,65 @@
1
+ import React, { useRef, useEffect } from "react";
2
+ // FIXME: re-evaluate if polyfill is necessary
3
+ // we currently need a polyfill for inert because Firefox do not support it natively atm
4
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert#browser_compatibility
5
+ import "wicg-inert";
6
+ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
7
+ import Spinner, { SpinnerProps } from "./../Spinner/Spinner";
8
+
9
+ export interface InteractionGateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "inert"> {
10
+ /**
11
+ * Prevent interaction with sub elements and narrow them in their visibility.
12
+ */
13
+ inert?: boolean;
14
+ /**
15
+ * Displays a spinner centered over the sub element.
16
+ */
17
+ showSpinner?: boolean;
18
+ /**
19
+ * Configure the included `<Spinner />` element.
20
+ */
21
+ spinnerProps?: SpinnerProps;
22
+ }
23
+
24
+ /**
25
+ * Wrap content that need to be blocked from user interactions
26
+ * It also has options to display a spinner as overlay.
27
+ */
28
+ function InteractionGate({
29
+ children,
30
+ className,
31
+ inert = false,
32
+ showSpinner = false,
33
+ spinnerProps = {},
34
+ ...otherProps
35
+ }: InteractionGateProps) {
36
+ const domRef = useRef<HTMLDivElement>(null);
37
+
38
+ useEffect(() => {
39
+ // we currently cannot add inert property directly to the div because react types module seem not to know it
40
+ if (inert) {
41
+ domRef.current!.setAttribute('inert', '');
42
+ } else {
43
+ domRef.current!.removeAttribute('inert');
44
+ }
45
+ }, [inert]);
46
+
47
+ return (
48
+ <div className={`${eccgui}-interactiongate__wrapper`}>
49
+ <div
50
+ ref={domRef}
51
+ className={
52
+ `${eccgui}-interactiongate` +
53
+ (inert ? ` ${eccgui}-interactiongate--inert` : "") +
54
+ (className ? ` ${className}` : "")
55
+ }
56
+ {...otherProps}
57
+ >
58
+ {children}
59
+ </div>
60
+ {showSpinner && <Spinner showLocalBackdrop={true} {...spinnerProps} className={`${eccgui}-interactiongate__spinner`} />}
61
+ </div>
62
+ );
63
+ }
64
+
65
+ export default InteractionGate;
@@ -0,0 +1,11 @@
1
+ .#{eccgui}-interactiongate__wrapper {
2
+ position: relative;
3
+ }
4
+
5
+ .#{eccgui}-interactiongate--inert {
6
+ opacity: $eccgui-opacity-disabled;
7
+
8
+ & + .#{$eccgui}-spinner--localbackdrop {
9
+ background-color: transparent;
10
+ }
11
+ }
@@ -3,4 +3,13 @@
3
3
  .#{$prefix}--link {
4
4
  font-size: 1em;
5
5
  line-height: inherit;
6
+
7
+ &:focus {
8
+ outline: none;
9
+ outline-offset: 0;
10
+ }
11
+ &:focus-visible {
12
+ outline: rgba($eccgui-color-accent, $eccgui-opacity-muted) solid 2px;
13
+ outline-offset: 1px;
14
+ }
6
15
  }
@@ -53,7 +53,7 @@ export interface NotificationProps extends Omit<BlueprintToastProps, "message" |
53
53
  /**
54
54
  * Icon used as depiction that is displayed with the notification.
55
55
  */
56
- iconName?: ValidIconName;
56
+ iconName?: ValidIconName | null;
57
57
  }
58
58
 
59
59
  /**