@eccenca/gui-elements 25.0.0-bugfixcenterednodecontentmenuitemscmem7184.0 → 25.0.0-featurecolorwheelinputcmem7327.0

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 (96) hide show
  1. package/CHANGELOG.md +34 -4
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +17 -13
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/common/index.js +1 -0
  5. package/dist/cjs/common/index.js.map +1 -1
  6. package/dist/cjs/common/utils/colorHash.js +25 -11
  7. package/dist/cjs/common/utils/colorHash.js.map +1 -1
  8. package/dist/cjs/components/ContextOverlay/ContextOverlay.js +6 -6
  9. package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
  10. package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js +47 -0
  11. package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
  12. package/dist/cjs/components/Icon/canonicalIconNames.js +3 -0
  13. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  14. package/dist/cjs/components/Icon/transformIcon.js +14 -0
  15. package/dist/cjs/components/Icon/transformIcon.js.map +1 -0
  16. package/dist/cjs/components/MultiSelect/MultiSelect.js +2 -1
  17. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  18. package/dist/cjs/components/RadioButton/RadioButton.js +5 -2
  19. package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
  20. package/dist/cjs/components/VisualTour/VisualTour.js +24 -32
  21. package/dist/cjs/components/VisualTour/VisualTour.js.map +1 -1
  22. package/dist/cjs/components/index.js +1 -0
  23. package/dist/cjs/components/index.js.map +1 -1
  24. package/dist/cjs/extensions/codemirror/CodeMirror.js +10 -1
  25. package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
  26. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +1 -1
  27. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
  28. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +19 -14
  29. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  30. package/dist/esm/common/index.js +2 -1
  31. package/dist/esm/common/index.js.map +1 -1
  32. package/dist/esm/common/utils/colorHash.js +25 -12
  33. package/dist/esm/common/utils/colorHash.js.map +1 -1
  34. package/dist/esm/components/ContextOverlay/ContextOverlay.js +3 -3
  35. package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
  36. package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js +41 -0
  37. package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
  38. package/dist/esm/components/Icon/canonicalIconNames.js +3 -0
  39. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  40. package/dist/esm/components/Icon/transformIcon.js +21 -0
  41. package/dist/esm/components/Icon/transformIcon.js.map +1 -0
  42. package/dist/esm/components/MultiSelect/MultiSelect.js +3 -2
  43. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  44. package/dist/esm/components/RadioButton/RadioButton.js +6 -2
  45. package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
  46. package/dist/esm/components/VisualTour/VisualTour.js +25 -33
  47. package/dist/esm/components/VisualTour/VisualTour.js.map +1 -1
  48. package/dist/esm/components/index.js +1 -0
  49. package/dist/esm/components/index.js.map +1 -1
  50. package/dist/esm/extensions/codemirror/CodeMirror.js +10 -1
  51. package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
  52. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +1 -1
  53. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
  54. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +9 -0
  55. package/dist/types/common/index.d.ts +2 -1
  56. package/dist/types/common/utils/colorHash.d.ts +4 -3
  57. package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +7 -1
  58. package/dist/types/components/DecoupledOverlay/DecoupledOverlay.d.ts +20 -0
  59. package/dist/types/components/Icon/canonicalIconNames.d.ts +2 -0
  60. package/dist/types/components/Icon/transformIcon.d.ts +2 -0
  61. package/dist/types/components/MultiSelect/MultiSelect.d.ts +1 -1
  62. package/dist/types/components/RadioButton/RadioButton.d.ts +8 -2
  63. package/dist/types/components/index.d.ts +1 -0
  64. package/package.json +1 -1
  65. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +68 -35
  66. package/src/common/index.ts +2 -1
  67. package/src/common/utils/colorHash.ts +36 -18
  68. package/src/components/Application/_colors.scss +15 -0
  69. package/src/components/ColorField/ColorField.stories.tsx +69 -0
  70. package/src/components/ColorField/ColorField.tsx +200 -0
  71. package/src/components/ColorField/_colorfield.scss +56 -0
  72. package/src/components/ContextOverlay/ContextOverlay.tsx +20 -1
  73. package/src/components/DecoupledOverlay/DecoupledOverlay.stories.tsx +30 -0
  74. package/src/components/DecoupledOverlay/DecoupledOverlay.tsx +97 -0
  75. package/src/components/DecoupledOverlay/_decoupledoverlay.scss +46 -0
  76. package/src/components/Icon/canonicalIconNames.tsx +3 -0
  77. package/src/components/Icon/transformIcon.tsx +17 -0
  78. package/src/components/Link/Link.stories.tsx +30 -0
  79. package/src/components/Link/link.scss +28 -2
  80. package/src/components/MultiSelect/MultiSelect.tsx +12 -3
  81. package/src/components/RadioButton/RadioButton.tsx +15 -3
  82. package/src/components/RadioButton/radiobutton.scss +13 -0
  83. package/src/components/Tabs/stories/TabTitle.stories.tsx +7 -2
  84. package/src/components/Typography/_reset.scss +1 -0
  85. package/src/components/Typography/typography.scss +5 -0
  86. package/src/components/VisualTour/VisualTour.tsx +30 -50
  87. package/src/components/VisualTour/visualTour.scss +0 -34
  88. package/src/components/index.scss +2 -0
  89. package/src/components/index.ts +1 -0
  90. package/src/configuration/_customproperties.scss +32 -0
  91. package/src/configuration/stories/customproperties.stories.tsx +118 -0
  92. package/src/extensions/codemirror/CodeMirror.tsx +14 -6
  93. package/src/extensions/react-flow/_config.scss +3 -3
  94. package/src/extensions/react-flow/edges/EdgeLabel.tsx +5 -3
  95. package/src/extensions/react-flow/edges/_edges.scss +3 -2
  96. package/src/index.scss +1 -0
@@ -7,7 +7,7 @@ import {
7
7
  Utils as BlueprintUtils,
8
8
  } from "@blueprintjs/core";
9
9
 
10
- import { CLASSPREFIX as eccgui } from "../../configuration/constants";
10
+ import { CLASSPREFIX as eccgui, WhiteSpaceContainer, WhiteSpaceContainerProps } from "../../index";
11
11
 
12
12
  export interface ContextOverlayProps extends Omit<BlueprintPopoverProps, "position"> {
13
13
  /**
@@ -24,6 +24,11 @@ export interface ContextOverlayProps extends Omit<BlueprintPopoverProps, "positi
24
24
  * Currently experimental.
25
25
  */
26
26
  usePlaceholder?: boolean;
27
+ /**
28
+ * Adds white space to each side of the overlay content.
29
+ * For more control use `WhiteSpaceContainer` directly as wrapper for the content children.
30
+ */
31
+ paddingSize?: WhiteSpaceContainerProps["paddingTop"];
27
32
  }
28
33
 
29
34
  /**
@@ -36,6 +41,8 @@ export const ContextOverlay = ({
36
41
  preventTopPosition,
37
42
  className = "",
38
43
  usePlaceholder = false,
44
+ paddingSize,
45
+ content,
39
46
  ...otherPopoverProps
40
47
  }: ContextOverlayProps) => {
41
48
  const placeholderRef = React.useRef<HTMLElement>(null);
@@ -169,6 +176,18 @@ export const ContextOverlay = ({
169
176
  ) : (
170
177
  <BlueprintPopover
171
178
  placement="bottom"
179
+ content={content ? (
180
+ paddingSize ? (
181
+ <WhiteSpaceContainer
182
+ paddingTop={paddingSize}
183
+ paddingRight={paddingSize}
184
+ paddingBottom={paddingSize}
185
+ paddingLeft={paddingSize}
186
+ >
187
+ {content}
188
+ </WhiteSpaceContainer>
189
+ ) : content
190
+ ) : undefined}
172
191
  {...otherPopoverProps}
173
192
  className={targetClassName}
174
193
  portalClassName={portalClassNameFinal.trim() ?? undefined}
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { Meta, StoryFn } from "@storybook/react";
3
+
4
+ import { DecoupledOverlay, DecoupledOverlayProps, Tag, WhiteSpaceContainer } from "../../../index";
5
+
6
+ export default {
7
+ title: "Components/DecoupledOverlay",
8
+ component: DecoupledOverlay,
9
+ argTypes: {},
10
+ } as Meta<typeof DecoupledOverlay>;
11
+
12
+ const Template: StoryFn<typeof DecoupledOverlay> = (args: DecoupledOverlayProps) => {
13
+ return (
14
+ <>
15
+ <Tag id={"decoupledTarget"}>Decoupled target</Tag>
16
+ <DecoupledOverlay {...args} />
17
+ </>
18
+ );
19
+ };
20
+
21
+ export const Default = Template.bind({});
22
+
23
+ Default.args = {
24
+ children: (
25
+ <WhiteSpaceContainer marginTop={"small"} marginRight={"small"} marginBottom={"small"} marginLeft={"small"}>
26
+ Decoupled overlay
27
+ </WhiteSpaceContainer>
28
+ ),
29
+ targetSelectorOrElement: "#decoupledTarget",
30
+ };
@@ -0,0 +1,97 @@
1
+ import React from "react";
2
+ import { createPortal } from "react-dom";
3
+ import { Classes as BlueprintClasses } from "@blueprintjs/core";
4
+ import { createPopper } from "@popperjs/core";
5
+
6
+ import { CLASSPREFIX as eccgui, ContextOverlayProps, TestableComponent, TooltipSize, WhiteSpaceContainer } from "../../index";
7
+
8
+ export interface DecoupledOverlayProps
9
+ extends React.HTMLAttributes<HTMLDivElement>,
10
+ TestableComponent,
11
+ Pick<ContextOverlayProps, "usePortal" | "portalContainer" | "placement" | "minimal" | "paddingSize"> {
12
+ /**
13
+ * Element that should be used. The step content is displayed as a tooltip instead of a modal.
14
+ * In case of an array, the first match is highlighted. */
15
+ targetSelectorOrElement: string | Element;
16
+ /**
17
+ * The size of the overlay.
18
+ * */
19
+ size?: TooltipSize;
20
+ }
21
+
22
+ /**
23
+ * Use an overlay popover without the necessity to use a target that need to be rendered in place.
24
+ * The target is referenced by a selector string or element object.
25
+ * It can exist somewhere in the DOM, but it must exist when the overlay is rendered.
26
+ * It is always displayed, close it by removement.
27
+ */
28
+ export const DecoupledOverlay = ({
29
+ targetSelectorOrElement,
30
+ usePortal = true,
31
+ portalContainer = document.body,
32
+ minimal = false,
33
+ placement = "auto",
34
+ size = "large",
35
+ paddingSize,
36
+ children,
37
+ }: DecoupledOverlayProps) => {
38
+ const overlayRef = React.useCallback(
39
+ (overlay: HTMLDivElement | null) => {
40
+ const target =
41
+ typeof targetSelectorOrElement === "string"
42
+ ? document.querySelector(targetSelectorOrElement)
43
+ : targetSelectorOrElement;
44
+ if (overlay && target) {
45
+ createPopper(target, overlay, {
46
+ placement: placement,
47
+ modifiers: [
48
+ {
49
+ name: "offset",
50
+ options: {
51
+ offset: [0, 15],
52
+ },
53
+ },
54
+ ],
55
+ });
56
+ }
57
+ },
58
+ [targetSelectorOrElement]
59
+ );
60
+
61
+ const overlay = (
62
+ <div
63
+ className={
64
+ `${eccgui}-decoupled-overlay` +
65
+ ` ${eccgui}-decoupled-overlay--${size}` +
66
+ ` ${BlueprintClasses.POPOVER}` +
67
+ (minimal ? ` ${BlueprintClasses.MINIMAL}` : "")
68
+ }
69
+ role="tooltip"
70
+ ref={overlayRef}
71
+ >
72
+ {!minimal && (
73
+ <div
74
+ className={`${eccgui}-decoupled-overlay__arrow ${BlueprintClasses.POPOVER_ARROW}`}
75
+ data-popper-arrow
76
+ aria-hidden
77
+ />
78
+ )}
79
+ <div className={`${BlueprintClasses.POPOVER_CONTENT} ${eccgui}-decoupled-overlay__content`}>
80
+ {paddingSize ? (
81
+ <WhiteSpaceContainer
82
+ paddingTop={paddingSize}
83
+ paddingRight={paddingSize}
84
+ paddingBottom={paddingSize}
85
+ paddingLeft={paddingSize}
86
+ >
87
+ {children}
88
+ </WhiteSpaceContainer>
89
+ ) : children}
90
+ </div>
91
+ </div>
92
+ );
93
+
94
+ return usePortal ? createPortal(overlay, portalContainer) : overlay;
95
+ };
96
+
97
+ export default DecoupledOverlay;
@@ -0,0 +1,46 @@
1
+ .#{$eccgui}-decoupled-overlay__arrow {
2
+ &::before {
3
+ background: $card-background-color;
4
+ }
5
+
6
+ .#{$eccgui}-decoupled-overlay[data-popper-placement="top"] & {
7
+ bottom: -0.5 * $eccgui-size-block-whitespace;
8
+ }
9
+ .#{$eccgui}-decoupled-overlay[data-popper-placement="right"] & {
10
+ left: -0.5 * $eccgui-size-block-whitespace;
11
+ }
12
+ .#{$eccgui}-decoupled-overlay[data-popper-placement="bottom"] & {
13
+ top: -0.5 * $eccgui-size-block-whitespace;
14
+ }
15
+ .#{$eccgui}-decoupled-overlay[data-popper-placement="left"] & {
16
+ right: -0.5 * $eccgui-size-block-whitespace;
17
+ }
18
+ }
19
+
20
+ .#{$eccgui}-decoupled-overlay {
21
+ &.#{$prefix-blueprintjs}-popover {
22
+ z-index: 8001;
23
+ }
24
+
25
+ &--small {
26
+ @extend .#{$eccgui}-tooltip--small;
27
+ }
28
+
29
+ &--medium {
30
+ @extend .#{$eccgui}-tooltip--medium;
31
+ }
32
+
33
+ &--large {
34
+ @extend .#{$eccgui}-tooltip--large;
35
+ }
36
+
37
+ &:has(.#{$eccgui}-decoupled-overlay__arrow) {
38
+ .#{$eccgui}-decoupled-overlay__content {
39
+ min-height: 30px; // height of blueprint arrow
40
+ }
41
+ }
42
+ }
43
+
44
+ .#{$eccgui}-decoupled-overlay__content {
45
+ padding: 0.1px; // force margins of children to stay inside
46
+ }
@@ -1,5 +1,6 @@
1
1
  import * as icons from "@carbon/react/icons";
2
2
  import { CarbonIconType as IconType } from "@carbon/react/icons";
3
+ import { transform} from "./transformIcon";
3
4
 
4
5
  const canonicalIcons = {
5
6
  "application-activities": icons.Activity,
@@ -172,8 +173,10 @@ const canonicalIcons = {
172
173
  "state-checked": icons.CheckboxChecked,
173
174
  "state-checkedsimple": icons.Checkmark,
174
175
  "state-confirmed": icons.ThumbsUp,
176
+ "state-confirmed-all": icons.ThumbsUpDouble,
175
177
  "state-danger": icons.ErrorFilled,
176
178
  "state-declined": icons.ThumbsDown,
179
+ "state-declined-all": transform(icons.ThumbsUpDouble, 0, false, true),
177
180
  "state-flagged": icons.Flag,
178
181
  "state-info": icons.InformationFilled,
179
182
  "state-locked": icons.Locked,
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { CarbonIconType, CarbonIconProps } from "@carbon/react/icons";
3
+
4
+ export const transform = (IconSymbol: CarbonIconType, rotate: number = 0, flipH: boolean = false, flipV: boolean = false) : CarbonIconType => {
5
+ return React.forwardRef((props: CarbonIconProps, ref: React.ForwardedRef<React.ReactSVGElement>) => {
6
+ return (
7
+ <IconSymbol
8
+ {...props}
9
+ ref={ref}
10
+ transform={
11
+ `scale(${flipH ? "-1" : "1"}, ${flipV ? "-1" : "1"}) rotate(${rotate})`
12
+ }
13
+ />
14
+ );
15
+ })
16
+ }
17
+
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { Meta, StoryFn } from "@storybook/react";
3
+
4
+ import { Link } from "../../../index";
5
+
6
+ export default {
7
+ title: "Components/Link",
8
+ component: Link,
9
+ argTypes: {
10
+ target: {
11
+ control: "select",
12
+ options: ["_self", "_blank", "_parent", "_top"],
13
+ },
14
+ },
15
+ } as Meta<typeof Link>;
16
+
17
+ const Template: StoryFn<typeof Link> = (args) => <Link {...args} />;
18
+
19
+ export const Default = Template.bind({});
20
+ Default.args = {
21
+ children: "Example link",
22
+ href: "https://example.com/",
23
+ };
24
+
25
+ export const Disabled = Template.bind({});
26
+ Disabled.args = {
27
+ children: "Disabled link",
28
+ href: "https://example.com/",
29
+ disabled: true,
30
+ };
@@ -2,8 +2,34 @@
2
2
  @include link.link;
3
3
 
4
4
  .#{$prefix}--link {
5
- font-size: 1em;
6
- line-height: inherit;
5
+ &,
6
+ &:hover {
7
+ // default case: use font size from context
8
+ font-size: inherit;
9
+ line-height: inherit;
10
+ }
11
+
12
+ &.#{$prefix}--link--sm {
13
+ &,
14
+ &:hover {
15
+ font-size: $eccgui-size-typo-caption;
16
+ line-height: $eccgui-size-typo-caption-lineheight;
17
+ }
18
+ }
19
+ &.#{$prefix}--link--md {
20
+ &,
21
+ &:hover {
22
+ font-size: $eccgui-size-typo-text;
23
+ line-height: $eccgui-size-typo-text-lineheight;
24
+ }
25
+ }
26
+ &.#{$prefix}--link--lg {
27
+ &,
28
+ &:hover {
29
+ font-size: $eccgui-size-typo-subtitle;
30
+ line-height: $eccgui-size-typo-subtitle-lineheight;
31
+ }
32
+ }
7
33
 
8
34
  &:focus {
9
35
  outline: none;
@@ -10,7 +10,15 @@ import { removeExtraSpaces } from "../../common/utils/stringUtils";
10
10
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
11
11
  import { TestableComponent } from "../interfaces";
12
12
 
13
- import { ContextOverlayProps, Highlighter, IconButton, MenuItem, OverflowText, Spinner } from "./../../index";
13
+ import {
14
+ ContextOverlayProps,
15
+ Highlighter,
16
+ highlighterUtils,
17
+ IconButton,
18
+ MenuItem,
19
+ OverflowText,
20
+ Spinner
21
+ } from "./../../index";
14
22
 
15
23
  export interface MultiSuggestFieldSelectionProps<T> {
16
24
  newlySelected?: T;
@@ -53,7 +61,7 @@ interface MultiSuggestFieldCommonProps<T>
53
61
  /**
54
62
  * prop to listen for query changes, when text is entered in the multi-select input
55
63
  */
56
- runOnQueryChange?: (query: string) => Promise<T[] | undefined>;
64
+ runOnQueryChange?: (query: string) => Promise<T[] | undefined> | (T[] | undefined);
57
65
  /**
58
66
  * Whether the component should take up the full width of its container.
59
67
  * This overrides `tagInputProps.fill`.
@@ -265,7 +273,8 @@ export function MultiSuggestField<T>({
265
273
  };
266
274
 
267
275
  const defaultFilterPredicate = (item: T, query: string) => {
268
- return itemLabel(item).toLowerCase().includes(query);
276
+ const searchWords = highlighterUtils.extractSearchWords(query, true)
277
+ return highlighterUtils.matchesAllWords(itemLabel(item).toLowerCase(), searchWords)
269
278
  };
270
279
 
271
280
  /**
@@ -1,13 +1,25 @@
1
1
  import React from "react";
2
2
  import { Radio as BlueprintRadioButton, RadioProps as BlueprintRadioProps } from "@blueprintjs/core";
3
+ import classNames from "classnames";
3
4
 
4
5
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
5
6
 
6
- export type RadioButtonProps = BlueprintRadioProps;
7
+ export interface RadioButtonProps extends BlueprintRadioProps {
8
+ /**
9
+ * Hide the indicator.
10
+ * The element cannot be identified as radio input then but a click on the children can be easily processed via `onChange` event.
11
+ */
12
+ hideIndicator?: boolean;
13
+ }
7
14
 
8
- export const RadioButton = ({ children, className = "", ...restProps }: RadioButtonProps) => {
15
+ export const RadioButton = ({ children, className = "", hideIndicator = false, ...restProps }: RadioButtonProps) => {
9
16
  return (
10
- <BlueprintRadioButton {...restProps} className={`${eccgui}-radiobutton ` + className}>
17
+ <BlueprintRadioButton
18
+ {...restProps}
19
+ className={classNames(`${eccgui}-radiobutton`, className, {
20
+ [`${eccgui}-radiobutton--hidden-indicator`]: hideIndicator,
21
+ })}
22
+ >
11
23
  {children}
12
24
  </BlueprintRadioButton>
13
25
  );
@@ -29,3 +29,16 @@
29
29
  }
30
30
  }
31
31
  }
32
+
33
+ .#{$eccgui}-radiobutton--hidden-indicator {
34
+ &:not(.#{$ns}-align-right) {
35
+ padding-inline-start: 0;
36
+ }
37
+ &:not(.#{$ns}-align-left) {
38
+ padding-inline-end: 0;
39
+ }
40
+
41
+ input ~ .#{$ns}-control-indicator {
42
+ visibility: hidden;
43
+ }
44
+ }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Meta, StoryFn } from "@storybook/react";
3
3
 
4
- import { Tabs, TabTitle as TabTitleOrg } from "./../../../";
4
+ import { Tabs, TabTitle as TabTitleOrg, TabTitleProps } from "./../../../";
5
5
 
6
6
  export default {
7
7
  title: "Components/Tabs/TabTitle",
@@ -9,7 +9,7 @@ export default {
9
9
  argTypes: {},
10
10
  } as Meta<typeof TabTitleOrg>;
11
11
 
12
- const TabTitle = (args) => {
12
+ const TabTitle = (args: React.JSX.IntrinsicAttributes & TabTitleProps) => {
13
13
  return (
14
14
  <Tabs
15
15
  id="titledemo"
@@ -31,3 +31,8 @@ TabTitleElement.args = {
31
31
  titlePrefix: "[",
32
32
  titleSuffix: <span>]</span>,
33
33
  };
34
+
35
+ export const TabTitleSymbolElement = TemplateFull.bind({});
36
+ TabTitleSymbolElement.args = {
37
+ text: "★",
38
+ };
@@ -7,6 +7,7 @@ select,
7
7
  input,
8
8
  textarea {
9
9
  font-family: inherit;
10
+ font-size-adjust: inherit;
10
11
  border-radius: 0;
11
12
  }
12
13
 
@@ -17,6 +17,11 @@ body {
17
17
  text-rendering: optimizelegibility;
18
18
  -webkit-font-smoothing: antialiased;
19
19
  -moz-osx-font-smoothing: grayscale;
20
+ // User-facing text may contain Unicode symbols (e.g. "★") that fall outside the primary font stack.
21
+ // Browsers pick different system fallback fonts for such characters, causing glyphs to render at
22
+ // different optical sizes (smaller in Firefox). font-size-adjust normalises the fallback font size
23
+ // by matching the primary font's x-height, reducing the visual size discrepancy across browsers.
24
+ font-size-adjust: from-font;
20
25
  }
21
26
 
22
27
  code {
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
2
  import { createPortal } from "react-dom";
3
- import { Classes as BlueprintClasses } from "@blueprintjs/core";
4
- import { createPopper } from "@popperjs/core";
5
3
 
6
4
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
7
5
  import {
@@ -14,6 +12,7 @@ import {
14
12
  CardHeader,
15
13
  CardOptions,
16
14
  CardTitle,
15
+ DecoupledOverlay,
17
16
  IconButton,
18
17
  Markdown,
19
18
  ModalSize,
@@ -130,7 +129,7 @@ export const VisualTour = ({
130
129
  <Button
131
130
  key={"next"}
132
131
  variant="outlined"
133
- intent={"primary"}
132
+ elevated
134
133
  onClick={() => {
135
134
  setCurrentStepIndex(currentStepIndex + 1);
136
135
  }}
@@ -144,7 +143,7 @@ export const VisualTour = ({
144
143
  text={closeLabel}
145
144
  onClick={closeTour}
146
145
  variant="outlined"
147
- intent={"primary"}
146
+ elevated
148
147
  rightIcon={"navigation-close"}
149
148
  />
150
149
  ),
@@ -292,25 +291,6 @@ interface StepPopoverProps {
292
291
 
293
292
  /** Popover that is displayed and points at the highlighted element. */
294
293
  const StepPopover = ({ highlightedElement, step, titleOption, actionButtons }: StepPopoverProps) => {
295
- const tooltipRef = React.useCallback(
296
- (tooltip: HTMLDivElement | null) => {
297
- if (tooltip) {
298
- createPopper(highlightedElement, tooltip, {
299
- placement: "auto",
300
- modifiers: [
301
- {
302
- name: "offset",
303
- options: {
304
- offset: [0, 15],
305
- },
306
- },
307
- ],
308
- });
309
- }
310
- },
311
- [highlightedElement]
312
- );
313
-
314
294
  const backdropRef = React.useCallback(
315
295
  (backdrop: HTMLDivElement | null) => {
316
296
  const highlightStencil = () => {
@@ -340,39 +320,39 @@ const StepPopover = ({ highlightedElement, step, titleOption, actionButtons }: S
340
320
  [highlightedElement]
341
321
  );
342
322
 
323
+ // map to only tooltip size because the `DecoupledOverlay` only supports them
324
+ let overlaySize: TooltipSize = "large";
325
+ switch (step.size) {
326
+ case "tiny":
327
+ overlaySize = "small";
328
+ break;
329
+ case "regular":
330
+ overlaySize = "medium";
331
+ break;
332
+ case "xlarge":
333
+ case "fullscreen":
334
+ overlaySize = "large";
335
+ break;
336
+ }
337
+
343
338
  return createPortal(
344
339
  <div className={`${eccgui}-visual-tour`}>
345
340
  <div className={`${eccgui}-visual-tour__focushelper`} ref={backdropRef} />
346
341
  <div>
347
342
  <div className={`${eccgui}-visual-tour__backdrop`} />
348
343
  </div>
349
- <div
350
- className={
351
- `${eccgui}-visual-tour__overlay` +
352
- ` ${eccgui}-visual-tour__overlay--${step.size ?? "large"}` +
353
- ` ${BlueprintClasses.POPOVER}`
354
- }
355
- role="tooltip"
356
- ref={tooltipRef}
357
- >
358
- <div
359
- className={`${eccgui}-visual-tour__arrow ${BlueprintClasses.POPOVER_ARROW}`}
360
- data-popper-arrow
361
- aria-hidden
362
- />
363
- <div className={`${BlueprintClasses.POPOVER_CONTENT} ${eccgui}-visual-tour__overlay__content`}>
364
- <Card isOnlyLayout elevation={-1} whitespaceAmount="small">
365
- <CardHeader>
366
- <CardTitle>{step.title}</CardTitle>
367
- <CardOptions>{titleOption}</CardOptions>
368
- </CardHeader>
369
- <CardContent>
370
- <StepContent step={step} />
371
- </CardContent>
372
- <CardActions inverseDirection>{actionButtons}</CardActions>
373
- </Card>
374
- </div>
375
- </div>
344
+ <DecoupledOverlay targetSelectorOrElement={highlightedElement} size={overlaySize} usePortal={false}>
345
+ <Card isOnlyLayout elevation={-1} whitespaceAmount="small">
346
+ <CardHeader>
347
+ <CardTitle>{step.title}</CardTitle>
348
+ <CardOptions>{titleOption}</CardOptions>
349
+ </CardHeader>
350
+ <CardContent>
351
+ <StepContent step={step} />
352
+ </CardContent>
353
+ <CardActions inverseDirection>{actionButtons}</CardActions>
354
+ </Card>
355
+ </DecoupledOverlay>
376
356
  </div>,
377
357
  document.body
378
358
  );
@@ -31,40 +31,6 @@
31
31
  opacity: 0;
32
32
  }
33
33
 
34
- .#{$eccgui}-visual-tour__arrow {
35
- &::before {
36
- background: $card-background-color;
37
- }
38
-
39
- .#{$eccgui}-visual-tour__overlay[data-popper-placement="top"] & {
40
- bottom: -0.5 * $eccgui-size-block-whitespace;
41
- }
42
- .#{$eccgui}-visual-tour__overlay[data-popper-placement="right"] & {
43
- left: -0.5 * $eccgui-size-block-whitespace;
44
- }
45
- .#{$eccgui}-visual-tour__overlay[data-popper-placement="bottom"] & {
46
- top: -0.5 * $eccgui-size-block-whitespace;
47
- }
48
- .#{$eccgui}-visual-tour__overlay[data-popper-placement="left"] & {
49
- right: -0.5 * $eccgui-size-block-whitespace;
50
- }
51
- }
52
-
53
- .#{$eccgui}-visual-tour__overlay {
54
- z-index: 8002; // 2 over application header
55
- &--small {
56
- @extend .#{$eccgui}-tooltip--small;
57
- }
58
-
59
- &--medium {
60
- @extend .#{$eccgui}-tooltip--medium;
61
- }
62
-
63
- &--large {
64
- @extend .#{$eccgui}-tooltip--large;
65
- }
66
- }
67
-
68
34
  .#{$eccgui}-card__content {
69
35
  .#{$eccgui}-visual-tour__overlay__content & {
70
36
  max-height: 45vh;
@@ -5,6 +5,7 @@
5
5
  @import "./Card/card";
6
6
  @import "./Chat/chat";
7
7
  @import "./Checkbox/checkbox";
8
+ @import "./DecoupledOverlay/decoupledoverlay";
8
9
  @import "./Depiction/depiction";
9
10
  @import "./Dialog/dialog";
10
11
  @import "./FlexibleLayout/flexiblelayout";
@@ -32,6 +33,7 @@
32
33
  @import "./Tabs/tabs";
33
34
  @import "./Tag/tag";
34
35
  @import "./TextField/textfield";
36
+ @import "./ColorField/colorfield";
35
37
  @import "./TagInput/taginput";
36
38
  @import "./Toolbar/toolbar";
37
39
  @import "./Tooltip/tooltip";
@@ -9,6 +9,7 @@ export * from "./Checkbox/Checkbox";
9
9
  export * from "./CodeAutocompleteField";
10
10
  export * from "./ContentGroup/ContentGroup";
11
11
  export * from "./ContextOverlay";
12
+ export * from "./DecoupledOverlay/DecoupledOverlay";
12
13
  export * from "./Depiction/Depiction";
13
14
  export * from "./Dialog";
14
15
  export * from "./FlexibleLayout";