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

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 (57) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
  3. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +2 -2
  4. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  5. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +13 -17
  6. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  7. package/dist/cjs/components/Icon/canonicalIconNames.js +22 -16
  8. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  9. package/dist/cjs/components/InteractionGate/InteractionGate.js +3 -2
  10. package/dist/cjs/components/InteractionGate/InteractionGate.js.map +1 -1
  11. package/dist/cjs/components/Tabs/TabPanel.js +29 -0
  12. package/dist/cjs/components/Tabs/TabPanel.js.map +1 -0
  13. package/dist/cjs/components/TextField/TextField.js +1 -1
  14. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  15. package/dist/cjs/index.js +4 -2
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  18. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +2 -2
  19. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  20. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +11 -15
  21. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  22. package/dist/esm/components/Icon/canonicalIconNames.js +22 -16
  23. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  24. package/dist/esm/components/InteractionGate/InteractionGate.js +3 -2
  25. package/dist/esm/components/InteractionGate/InteractionGate.js.map +1 -1
  26. package/dist/esm/components/Tabs/TabPanel.js +35 -0
  27. package/dist/esm/components/Tabs/TabPanel.js.map +1 -0
  28. package/dist/esm/components/TextField/TextField.js +1 -1
  29. package/dist/esm/components/TextField/TextField.js.map +1 -1
  30. package/dist/esm/index.js +2 -1
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +1 -0
  33. package/dist/types/cmem/markdown/Markdown.d.ts +16 -1
  34. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +1 -1
  35. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +3 -1
  36. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  37. package/dist/types/components/InteractionGate/InteractionGate.d.ts +6 -1
  38. package/dist/types/components/Tabs/TabPanel.d.ts +21 -0
  39. package/dist/types/index.d.ts +2 -1
  40. package/package.json +1 -1
  41. package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
  42. package/src/cmem/markdown/Markdown.stories.tsx +55 -0
  43. package/src/cmem/markdown/Markdown.tsx +16 -5
  44. package/src/cmem/react-flow/nodes/_stickynote.scss +1 -1
  45. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +2 -1
  46. package/src/components/AutocompleteField/AutoCompleteField.tsx +14 -10
  47. package/src/components/AutocompleteField/autocompletefield.scss +1 -1
  48. package/src/components/Icon/canonicalIconNames.tsx +123 -117
  49. package/src/components/InteractionGate/InteractionGate.tsx +12 -1
  50. package/src/components/InteractionGate/interactiongate.scss +1 -1
  51. package/src/components/Tabs/TabPanel.tsx +43 -0
  52. package/src/components/Tabs/stories/TabPanel.stories.tsx +21 -0
  53. package/src/components/Tabs/tabs.scss +1 -5
  54. package/src/components/TextField/TextField.tsx +1 -1
  55. package/src/components/Tooltip/tooltip.scss +4 -0
  56. package/src/components/Typography/typography.scss +3 -3
  57. package/src/index.ts +2 -0
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { Markdown } from "./../../../index";
4
+
5
+ export default {
6
+ title: "Cmem/Markdown",
7
+ component: Markdown,
8
+ argTypes: {
9
+ },
10
+ } as ComponentMeta<typeof Markdown>;
11
+
12
+ const Template: ComponentStory<typeof Markdown> = (args) => <Markdown {...args} />;
13
+
14
+ export const Default = Template.bind({});
15
+
16
+ Default.args = {
17
+ children: `
18
+ # This is a headline level 1
19
+
20
+ This is a paragraph.
21
+
22
+ * this is a unordered list
23
+ * with sub items
24
+ * with sub items
25
+ * another level
26
+ * another level
27
+ * sub item
28
+ * other list item
29
+ * a last one
30
+
31
+ 1. ordered list
32
+ 1. ordered sub items
33
+ 2. second line
34
+ 2. second item
35
+ * unordered sub items
36
+ * another line
37
+ 3. third item
38
+
39
+ This is a paragraph with a [text link](http://example.com/).
40
+
41
+ ## Headline level 2
42
+ ### Headline level 3
43
+ #### Headline level 4
44
+ ##### Headline level 5
45
+ ###### Headline level 6
46
+
47
+ This is a code block.
48
+
49
+ > This is a block quote.
50
+ >
51
+ > With 2 paragraphs.
52
+
53
+ A line with some <strong>HTML code</strong> inside.
54
+ `
55
+ };
@@ -10,15 +10,26 @@ import { PluggableList } from "react-markdown/lib/react-markdown";
10
10
 
11
11
  export interface MarkdownParserProps {
12
12
  children: string;
13
- // allow HTML as partial content, otherwise escape HTML tags (pls use with caution)
13
+ /**
14
+ * Allow HTML as partial content, otherwise escape HTML tags.
15
+ * Use with caution!
16
+ */
14
17
  allowHtml?: boolean;
15
- // return an object that only contains simple text without any HTML
18
+ /**
19
+ * Return an object that only contains simple text without any HTML.
20
+ */
16
21
  removeMarkup?: boolean;
17
- // If defined, only elements from this list will be rendered. This overwrites the removeMarkup parameter if both are set.
22
+ /**
23
+ * If defined, only elements from this list will be rendered.
24
+ * This overwrites the removeMarkup parameter if both are set.
25
+ */
18
26
  allowedElements?: string[];
19
- // do not wrap it in a content block element
27
+ /**
28
+ * Do not wrap it in a content block element.
29
+ */
20
30
  inheritBlock?: boolean;
21
- /** Additional reHype plugins to execute.
31
+ /**
32
+ * Additional reHype plugins to execute.
22
33
  * @see https://github.com/remarkjs/react-markdown#architecture
23
34
  */
24
35
  reHypePlugins?: PluggableList;
@@ -17,7 +17,7 @@
17
17
  .#{$eccgui}-graphviz__node__content {
18
18
  color: currentColor;
19
19
  background: transparent;
20
- padding: $eccgui-size-block-whitespace / 2;
20
+ padding: $eccgui-size-block-whitespace * 0.5;
21
21
  }
22
22
  }
23
23
  }
@@ -79,6 +79,7 @@ export const AutoSuggestionList = ({
79
79
  left,
80
80
  currentlyFocusedIndex,
81
81
  itemToHighlight,
82
+ style,
82
83
  ...otherDivProps
83
84
  }: IDropdownProps) => {
84
85
  const [hoveredItem, setHoveredItem] = React.useState<
@@ -136,7 +137,7 @@ export const AutoSuggestionList = ({
136
137
  <div
137
138
  {...otherDivProps}
138
139
  className={`${eccgui}-autosuggestion__dropdown`}
139
- style={{ left }}
140
+ style={{ ...style, left }}
140
141
  ref={dropdownRef}
141
142
  >
142
143
  {loading ? (
@@ -128,6 +128,9 @@ export interface IAutoCompleteFieldProps<T extends any, UPDATE_VALUE extends any
128
128
  showNewItemOptionFirst?: boolean
129
129
  };
130
130
 
131
+ /** Dropdown is only rendered when the query has a value (input field is not empty). */
132
+ onlyDropdownWithQuery?: boolean;
133
+
131
134
  /** If true the input field will be disabled. */
132
135
  disabled?: boolean;
133
136
 
@@ -149,17 +152,15 @@ AutoCompleteField.defaultProps = {
149
152
 
150
153
  /** Style object to be used in menu option items. */
151
154
  export interface IElementWidth {
152
- width: string
155
+ minWidth: string;
156
+ //width: string
153
157
  maxWidth: string
154
158
  }
155
159
 
156
160
  /** Hook that returns the element width of the given ref.*/
157
161
  const elementWidth = (elRef: IRefObject<HTMLInputElement> | null): IElementWidth => {
158
- if(elRef && elRef.current) {
159
- return { width: elRef.current.offsetWidth + "px", maxWidth: "90vw" }
160
- } else {
161
- return { width: "40rem", maxWidth: "90vw" }
162
- }
162
+ const minWidth = (elRef && elRef.current) ? elRef.current.offsetWidth + "px" : "20rem";
163
+ return { minWidth, maxWidth: "90vw" };
163
164
  }
164
165
 
165
166
  /** Auto-complete input widget. */
@@ -168,6 +169,7 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
168
169
  reset,
169
170
  noResultText,
170
171
  disabled,
172
+ onlyDropdownWithQuery = false,
171
173
  itemValueSelector,
172
174
  itemRenderer,
173
175
  onSearch,
@@ -194,6 +196,7 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
194
196
  const [filtered, setFiltered] = useState<T[]>([]);
195
197
 
196
198
  const BlueprintSuggestAutocomplete = Suggest.ofType<T>();
199
+ const readOnly = !!otherProps.inputProps?.readOnly
197
200
 
198
201
  // Sets the query to the item value if it has a valid string value
199
202
  const setQueryToSelectedValue = (item?: T) => {
@@ -223,7 +226,7 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
223
226
  );
224
227
 
225
228
  useEffect(() => {
226
- if (!disabled && !otherProps.inputProps?.readOnly && hasFocus) {
229
+ if (!disabled && !readOnly && hasFocus) {
227
230
  setListLoading(true);
228
231
  const timeout: number = window.setTimeout(async () => {
229
232
  fetchQueryResults(query);
@@ -351,7 +354,7 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
351
354
  return <Notification danger={true} message={requestError} />
352
355
  }
353
356
  // Optional clear button to reset the selected value
354
- const clearButton = !disabled && reset &&
357
+ const clearButton = !readOnly && !disabled && reset &&
355
358
  selectedItem != null &&
356
359
  reset.resettableValue(selectedItem) ? (
357
360
  <IconButton
@@ -370,9 +373,9 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
370
373
  onBlur: handleOnFocusOut,
371
374
  onFocus: handleOnFocusIn,
372
375
  ...otherProps.inputProps,
373
- title: (selectedItem !== undefined && (!!otherProps.inputProps?.readOnly || disabled)) ? itemValueString(selectedItem) : otherProps.inputProps?.title,
376
+ title: (selectedItem !== undefined && (readOnly || disabled)) ? itemValueString(selectedItem) : otherProps.inputProps?.title,
374
377
  };
375
- const preventOverlayOnReadonly = !!otherProps.inputProps?.readOnly ? { isOpen: false } : {}
378
+ const preventOverlayOnReadonly = readOnly ? { isOpen: false } : {}
376
379
  const updatedContextOverlayProps: Partial<Omit<ContextOverlayProps, "content" | "children">> = {
377
380
  minimal: true,
378
381
  placement: "bottom-start",
@@ -407,6 +410,7 @@ export function AutoCompleteField<T extends any, UPDATE_VALUE extends any>(props
407
410
  disabled={disabled}
408
411
  // Need to display error messages in list
409
412
  items={requestError ? [requestError as T] : filtered}
413
+ initialContent={onlyDropdownWithQuery ? null : undefined}
410
414
  inputValueRenderer={selectedItem !== undefined ? itemValueRenderer : () => ""}
411
415
  itemRenderer={requestError ? requestErrorRenderer : optionRenderer}
412
416
  itemsEqual={areEqualItems}
@@ -1,5 +1,5 @@
1
1
  .#{$eccgui}-autocompletefield__options {
2
- .#{$ns}-select-popover {
2
+ .#{$ns}-popover2-content {
3
3
  .#{$ns}-menu {
4
4
  max-height: 45vh;
5
5
  overflow: auto;
@@ -2,127 +2,128 @@ import * as icons from "@carbon/icons-react";
2
2
 
3
3
  /** Valid icon names. */
4
4
  export type ValidIconName =
5
+ | "application-activities"
5
6
  | "application-dataintegration"
7
+ | "application-explore"
6
8
  | "application-homepage"
7
- | "application-useraccount"
8
- | "application-warning"
9
+ | "application-legacygui"
9
10
  | "application-mapping"
10
- | "application-explore"
11
- | "application-vocabularies"
12
11
  | "application-queries"
13
- | "application-legacygui"
14
- | "application-activities"
15
- | "module-timetracker"
16
- | "module-accesscontrol"
17
- | "module-annotation"
18
- | "module-dashboard"
19
- | "module-search"
20
- | "module-visualization"
21
- | "module-reports"
22
- | "module-thesauri"
23
- | "module-linkedrules"
24
- | "module-integrations"
25
- | "module-gdprsearch"
26
- | "toggler-showmore"
27
- | "toggler-showless"
28
- | "toggler-moveright"
29
- | "toggler-moveleft"
30
- | "toggler-maximize"
31
- | "toggler-minimize"
32
- | "toggler-tree"
33
- | "navigation-back"
34
- | "navigation-forth"
35
- | "navigation-close"
36
- | "navigation-jump"
37
- | "navigation-last"
38
- | "navigation-previous"
39
- | "navigation-next"
40
- | "navigation-first"
41
- | "item-moremenu"
42
- | "item-vertmenu"
43
- | "item-viewdetails"
12
+ | "application-useraccount"
13
+ | "application-vocabularies"
14
+ | "application-warning"
15
+ | "artefact-commit"
16
+ | "artefact-customtask"
17
+ | "artefact-dataset"
18
+ | "artefact-dataset-csv"
19
+ | "artefact-dataset-eccencadataplatform"
20
+ | "artefact-dataset-excel"
21
+ | "artefact-dataset-file"
22
+ | "artefact-dataset-jdbc"
23
+ | "artefact-dataset-json"
24
+ | "artefact-dataset-multicsv"
25
+ | "artefact-dataset-neo4j"
26
+ | "artefact-dataset-sparkview"
27
+ | "artefact-dataset-sparqlendpoint"
28
+ | "artefact-dataset-sqlendpoint"
29
+ | "artefact-dataset-xml"
30
+ | "artefact-deprecated"
31
+ | "artefact-embedded"
32
+ | "artefact-errorlog"
33
+ | "artefact-file"
34
+ | "artefact-linking"
35
+ | "artefact-project"
36
+ | "artefact-rawdata"
37
+ | "artefact-remote"
38
+ | "artefact-report"
39
+ | "artefact-task"
40
+ | "artefact-transform"
41
+ | "artefact-uncategorized"
42
+ | "artefact-workflow"
43
+ | "data-sourcepath"
44
+ | "data-targetpath"
45
+ | "item-add-artefact"
44
46
  | "item-clone"
47
+ | "item-comment"
48
+ | "item-copy"
49
+ | "item-download"
50
+ | "item-draggable"
45
51
  | "item-edit"
46
52
  | "item-evaluation"
47
53
  | "item-execution"
48
54
  | "item-info"
49
- | "item-remove"
50
- | "item-add-artefact"
51
55
  | "item-launch"
52
- | "item-download"
56
+ | "item-moremenu"
53
57
  | "item-question"
54
- | "item-comment"
55
- | "item-copy"
56
- | "item-save"
57
- | "item-start"
58
- | "item-stop"
59
58
  | "item-reload"
59
+ | "item-remove"
60
60
  | "item-reset"
61
- | "item-shuffle"
62
- | "item-draggable"
61
+ | "item-save"
63
62
  | "item-settings"
64
- | "operation-search"
63
+ | "item-shuffle"
64
+ | "item-start"
65
+ | "item-stop"
66
+ | "item-upload"
67
+ | "item-vertmenu"
68
+ | "item-viewdetails"
69
+ | "list-sort"
70
+ | "list-sortasc"
71
+ | "list-sortdesc"
72
+ | "module-accesscontrol"
73
+ | "module-annotation"
74
+ | "module-dashboard"
75
+ | "module-gdprsearch"
76
+ | "module-integrations"
77
+ | "module-linkedrules"
78
+ | "module-reports"
79
+ | "module-search"
80
+ | "module-thesauri"
81
+ | "module-timetracker"
82
+ | "module-visualization"
83
+ | "navigation-back"
84
+ | "navigation-close"
85
+ | "navigation-first"
86
+ | "navigation-forth"
87
+ | "navigation-jump"
88
+ | "navigation-last"
89
+ | "navigation-next"
90
+ | "navigation-previous"
91
+ | "operation-aggregation"
92
+ | "operation-autolayout"
65
93
  | "operation-clear"
66
- | "operation-undo"
67
- | "operation-redo"
68
- | "operation-logout"
94
+ | "operation-commit"
95
+ | "operation-comparison"
69
96
  | "operation-filter"
70
97
  | "operation-filteredit"
71
- | "operation-comparison"
72
- | "operation-transform"
73
- | "operation-aggregation"
74
- | "operation-commit"
98
+ | "operation-link"
99
+ | "operation-logout"
100
+ | "operation-redo"
101
+ | "operation-search"
75
102
  | "operation-sharelink"
76
- | "data-sourcepath"
77
- | "data-targetpath"
78
- | "list-sort"
79
- | "list-sortasc"
80
- | "list-sortdesc"
81
- | "state-info"
82
- | "state-success"
83
- | "state-warning"
84
- | "state-danger"
85
- | "state-unchecked"
103
+ | "operation-transform"
104
+ | "operation-undo"
105
+ | "operation-unlink"
86
106
  | "state-checked"
87
107
  | "state-checkedsimple"
88
- | "state-partlychecked"
89
- | "state-declined"
90
108
  | "state-confirmed"
91
- | "artefact-project"
92
- | "artefact-workflow"
93
- | "artefact-dataset"
94
- | "artefact-dataset-csv"
95
- | "artefact-dataset-multicsv"
96
- | "artefact-dataset-sparkview"
97
- | "artefact-dataset-sqlendpoint"
98
- | "artefact-dataset-jdbc"
99
- | "artefact-dataset-xml"
100
- | "artefact-dataset-json"
101
- | "artefact-dataset-excel"
102
- | "artefact-dataset-file"
103
- | "artefact-dataset-eccencadataplatform"
104
- | "artefact-dataset-sparqlendpoint"
105
- | "artefact-dataset-neo4j"
106
- | "artefact-transform"
107
- | "artefact-linking"
108
- | "artefact-task"
109
- | "artefact-customtask"
110
- | "artefact-file"
111
- | "artefact-embedded"
112
- | "artefact-remote"
113
- | "artefact-deprecated"
114
- | "artefact-uncategorized"
115
- | "artefact-rawdata"
116
- | "artefact-report"
117
- | "activity-error-report"
118
- | "select-caret"
119
- | "linked-item"
120
- | "operation-auto-graph-layout"
121
- | "unlinked-item"
122
- | "write-protected"
123
- | "settings"
124
- | "favorite-empty"
125
- | "favorite-filled"
109
+ | "state-danger"
110
+ | "state-declined"
111
+ | "state-info"
112
+ | "state-partlychecked"
113
+ | "state-protected"
114
+ | "state-success"
115
+ | "state-unchecked"
116
+ | "state-warning"
117
+ | "toggler-caret"
118
+ | "toggler-maximize"
119
+ | "toggler-minimize"
120
+ | "toggler-moveleft"
121
+ | "toggler-moveright"
122
+ | "toggler-showless"
123
+ | "toggler-showmore"
124
+ | "toggler-star-empty"
125
+ | "toggler-star-filled"
126
+ | "toggler-tree"
126
127
  | "undefined"
127
128
  | "Undefined";
128
129
 
@@ -374,6 +375,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
374
375
  normal: icons.Download20,
375
376
  large: icons.Download32,
376
377
  },
378
+ "item-upload": {
379
+ small: icons.Upload16,
380
+ normal: icons.Upload20,
381
+ large: icons.Upload32,
382
+ },
377
383
  "item-question": {
378
384
  small: icons.Help16,
379
385
  normal: icons.Help20,
@@ -700,55 +706,55 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
700
706
  normal: icons.Report20,
701
707
  large: icons.Report32,
702
708
  },
709
+ "artefact-commit": {
710
+ small: icons.Commit16,
711
+ normal: icons.Commit20,
712
+ large: icons.Commit32
713
+ },
703
714
 
704
- "activity-error-report": {
705
- small: icons.Error16,
706
- normal: icons.Error20,
707
- large: icons.Error32,
715
+ "artefact-errorlog": {
716
+ // FIXME: we may check for a better icon
717
+ small: icons.WarningOther16,
718
+ normal: icons.WarningOther20,
719
+ large: icons.WarningOther32,
708
720
  },
709
721
 
710
- "select-caret": {
722
+ "toggler-caret": {
711
723
  small: icons.CaretSort16,
712
724
  normal: icons.CaretSort20,
713
725
  large: icons.CaretSort32,
714
726
  },
715
727
 
716
- "linked-item": {
728
+ "operation-link": {
717
729
  small: icons.Link16,
718
730
  normal: icons.Link20,
719
731
  large: icons.Link32,
720
732
  },
721
- "unlinked-item": {
733
+ "operation-unlink": {
722
734
  small: icons.Unlink16,
723
735
  normal: icons.Unlink20,
724
736
  large: icons.Unlink32,
725
737
  },
726
738
 
727
- "operation-auto-graph-layout": {
739
+ "operation-autolayout": {
728
740
  small: icons.ChartNetwork16,
729
741
  normal: icons.ChartNetwork20,
730
742
  large: icons.ChartNetwork32,
731
743
  },
732
744
 
733
- "write-protected": {
745
+ "state-protected": {
734
746
  small: icons.DocumentProtected16,
735
747
  normal: icons.DocumentProtected20,
736
748
  large: icons.DocumentProtected32,
737
749
  },
738
750
 
739
- "settings": {
740
- small: icons.Settings16,
741
- normal: icons.Settings20,
742
- large: icons.Settings32
743
- },
744
-
745
- "favorite-empty": {
751
+ "toggler-star-empty": {
746
752
  small: icons.Star16,
747
753
  normal: icons.Star20,
748
754
  large: icons.Star32
749
755
  },
750
756
 
751
- "favorite-filled": {
757
+ "toggler-star-filled": {
752
758
  small: icons.StarFilled16,
753
759
  normal: icons.StarFilled20,
754
760
  large: icons.StarFilled32
@@ -19,6 +19,11 @@ export interface InteractionGateProps extends Omit<React.HTMLAttributes<HTMLDivE
19
19
  * Configure the included `<Spinner />` element.
20
20
  */
21
21
  spinnerProps?: SpinnerProps;
22
+ /**
23
+ * Do not use own wrapper element to set the position of the spinner element, if used.
24
+ * Use the positioning of the parent container.
25
+ */
26
+ useParentPositioning?: boolean;
22
27
  }
23
28
 
24
29
  /**
@@ -31,6 +36,7 @@ function InteractionGate({
31
36
  inert = false,
32
37
  showSpinner = false,
33
38
  spinnerProps = {},
39
+ useParentPositioning = false,
34
40
  ...otherProps
35
41
  }: InteractionGateProps) {
36
42
  const domRef = useRef<HTMLDivElement>(null);
@@ -45,7 +51,12 @@ function InteractionGate({
45
51
  }, [inert]);
46
52
 
47
53
  return (
48
- <div className={`${eccgui}-interactiongate__wrapper`}>
54
+ <div
55
+ className={
56
+ `${eccgui}-interactiongate__wrapper` +
57
+ (useParentPositioning ? ` ${eccgui}-interactiongate__wrapper--tunnelpositioning` : "")
58
+ }
59
+ >
49
60
  <div
50
61
  ref={domRef}
51
62
  className={
@@ -1,4 +1,4 @@
1
- .#{eccgui}-interactiongate__wrapper {
1
+ .#{eccgui}-interactiongate__wrapper:not(.#{eccgui}-interactiongate__wrapper--tunnelpositioning) {
2
2
  position: relative;
3
3
  }
4
4
 
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import { Classes } from "@blueprintjs/core";
3
+ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
4
+
5
+ export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ /**
7
+ * Addicional CSS class name.
8
+ */
9
+ className?: string,
10
+ /**
11
+ * `id` of the tab element that is connected to this panel content.
12
+ */
13
+ labelledBy?: string,
14
+ /**
15
+ * Tab panel is not displayed.
16
+ */
17
+ hidden?: boolean,
18
+ }
19
+
20
+ /**
21
+ * Element to display the content related to a tab.
22
+ * This could be used if `<Tabs />` is used in uncontrolled mode.
23
+ */
24
+ function TabPanel({
25
+ children,
26
+ className = "",
27
+ labelledBy,
28
+ hidden = false,
29
+ ...otherDivProps
30
+ }: TabPanelProps) {
31
+ return (
32
+ <div
33
+ {...otherDivProps}
34
+ className={`${Classes.TAB_PANEL} ${eccgui}-tab__panel ${className}`}
35
+ aria-labelledby={labelledBy}
36
+ aria-hidden={hidden}
37
+ >
38
+ { children }
39
+ </div>
40
+ )
41
+ }
42
+
43
+ export default TabPanel;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { LoremIpsum } from 'react-lorem-ipsum';
4
+ import { TabPanel } from "./../../../";
5
+
6
+ export default {
7
+ title: "Components/Tabs",
8
+ component: TabPanel,
9
+ argTypes: {
10
+ },
11
+ } as ComponentMeta<typeof TabPanel>;
12
+
13
+ const TemplateFull: ComponentStory<typeof TabPanel> = (args) => (
14
+ <TabPanel {...args} />
15
+ );
16
+
17
+ export const TabPanelElement = TemplateFull.bind({});
18
+ TabPanelElement.args = {
19
+ children: <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />,
20
+ hidden: false
21
+ };
@@ -63,10 +63,6 @@ $tab-indicator-width: 3px !default;
63
63
  }
64
64
  }
65
65
 
66
- .#{$ns}-tab-indicator-wrapper {
67
- //top: $tab-indicator-width;
68
- }
69
-
70
- .#{$ns}-tab-panel {
66
+ .#{$eccgui}-tab__panel, .#{$ns}-tab-panel {
71
67
  margin-top: $eccgui-size-block-whitespace;
72
68
  }
@@ -69,7 +69,7 @@ function TextField({
69
69
  break;
70
70
  }
71
71
 
72
- if ((!!otherProps.readOnly || !!otherProps.disabled) && !!otherProps.value && !otherProps.title) {
72
+ if ((otherProps.readOnly || otherProps.disabled) && !!otherProps.value && !otherProps.title) {
73
73
  otherProps["title"] = otherProps.value;
74
74
  }
75
75
 
@@ -29,6 +29,10 @@ $tooltip2-padding-horizontal: $eccgui-size-block-whitespace * 0.5; // !default;
29
29
  max-width: $eccgui-size-tooltip-width * 2;
30
30
  }
31
31
 
32
+ .#{$eccgui}-tooltip__wrapper:not(.#{$ns}-tooltip2-indicator) {
33
+ cursor: inherit;
34
+ }
35
+
32
36
  .#{$eccgui}-tooltip__content {
33
37
  a {
34
38
  color: inherit;