@eccenca/gui-elements 25.1.0-rc.4 → 25.2.0-rc.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 (32) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +9 -5
  3. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  4. package/dist/cjs/components/Icon/canonicalIconNames.js +8 -1
  5. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  6. package/dist/cjs/extensions/codemirror/CodeMirror.js +16 -4
  7. package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
  8. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +9 -5
  9. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  10. package/dist/esm/components/Icon/canonicalIconNames.js +8 -1
  11. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  12. package/dist/esm/extensions/codemirror/CodeMirror.js +16 -4
  13. package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
  14. package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +4 -1
  15. package/dist/types/components/Icon/canonicalIconNames.d.ts +8 -1
  16. package/package.json +20 -13
  17. package/src/cmem/markdown/markdown.scss +1 -1
  18. package/src/components/AutoSuggestion/AutoSuggestion.tsx +14 -7
  19. package/src/components/Breadcrumb/breadcrumb.scss +2 -2
  20. package/src/components/Button/button.scss +2 -0
  21. package/src/components/CodeAutocompleteField/CodeAutocompleteField.stories.tsx +7 -1
  22. package/src/components/Form/form.scss +2 -2
  23. package/src/components/Icon/canonicalIconNames.tsx +10 -2
  24. package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
  25. package/src/components/Pagination/pagination.scss +55 -5
  26. package/src/components/Tabs/tabs.scss +2 -2
  27. package/src/components/Toolbar/toolbar.scss +1 -2
  28. package/src/components/Typography/_reset.scss +1 -0
  29. package/src/extensions/codemirror/CodeMirror.tsx +20 -4
  30. package/src/extensions/react-flow/_react-flow_v12.scss +1 -1
  31. package/src/extensions/react-flow/handles/_handles.scss +3 -3
  32. package/src/includes/carbon-components/_requisits.scss +3 -1
@@ -28,6 +28,7 @@ button {
28
28
 
29
29
  svg {
30
30
  padding: 0;
31
+
31
32
  // forgotten in reset import but necessary to fix problems when used together with MDL resets
32
33
  margin: 0;
33
34
  font: inherit;
@@ -326,6 +326,20 @@ export const CodeEditor = ({
326
326
  ];
327
327
  }
328
328
 
329
+ const syncIntentClass = React.useCallback((editorView: EditorView | undefined, nextIntent?: CodeEditorProps["intent"]) => {
330
+ if (!editorView?.dom) {
331
+ return;
332
+ }
333
+
334
+ Array.from(editorView.dom.classList)
335
+ .filter((className) => className.startsWith(`${eccgui}-intent--`))
336
+ .forEach((className) => editorView.dom.classList.remove(className));
337
+
338
+ if (nextIntent) {
339
+ editorView.dom.classList.add(`${eccgui}-intent--${nextIntent}`);
340
+ }
341
+ }, []);
342
+
329
343
  React.useEffect(() => {
330
344
  const domEventHandlers = {
331
345
  ...addHandlersFor(!!onScroll, "scroll", onScroll),
@@ -360,7 +374,7 @@ export const CodeEditor = ({
360
374
  onSelection(v.state.selection.ranges.filter((r) => !r.empty).map(({ from, to }) => ({ from, to })));
361
375
 
362
376
  if (onFocusChange && currentIntent.current && !v.view.dom.classList?.contains(`${eccgui}-intent--${currentIntent.current}`)) {
363
- v.view.dom.classList.add(`${eccgui}-intent--${currentIntent.current}`);
377
+ syncIntentClass(v.view, currentIntent.current);
364
378
  }
365
379
 
366
380
  if (onCursorChange) {
@@ -410,9 +424,7 @@ export const CodeEditor = ({
410
424
  view.dom.classList.add(`${eccgui}-disabled`);
411
425
  }
412
426
 
413
- if (currentIntent.current) {
414
- view.dom.className += ` ${eccgui}-intent--${currentIntent.current}`;
415
- }
427
+ syncIntentClass(view, currentIntent.current);
416
428
 
417
429
  if (autoFocus) {
418
430
  view.focus();
@@ -472,6 +484,10 @@ export const CodeEditor = ({
472
484
  }
473
485
  }, [disabled])
474
486
 
487
+ React.useEffect(() => {
488
+ syncIntentClass(view, intent);
489
+ }, [intent, view, syncIntentClass]);
490
+
475
491
  React.useEffect(() => {
476
492
  setEditorAppearance({
477
493
  ...editorAppearance,
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  .react-flow {
9
- direction: ltr;
10
9
  z-index: 0;
10
+ direction: ltr;
11
11
  }
12
12
 
13
13
  .react-flow__pane {
@@ -62,10 +62,10 @@ div.react-flow__handle {
62
62
  inset: 0;
63
63
  display: none;
64
64
  cursor: pointer;
65
- content: " ";
66
- border-radius: 100%;
67
65
  outline: dotted $eccgui-size-flow-handle-border currentcolor;
68
66
  outline-offset: $eccgui-size-flow-handle * 0.75 + $eccgui-size-flow-handle-border * 0.5;
67
+ content: " ";
68
+ border-radius: 100%;
69
69
 
70
70
  .react-flow__node:hover & {
71
71
  display: block;
@@ -207,9 +207,9 @@ div.react-flow__handle-bottom {
207
207
  .#{$eccgui}-graphviz__node--hidehandles {
208
208
  & ~ .react-flow__handle:not(.connectable) {
209
209
  z-index: -1;
210
+ visibility: hidden;
210
211
  width: 1px;
211
212
  height: 1px;
212
- visibility: hidden;
213
213
  border: none;
214
214
 
215
215
  &.react-flow__handle-top {
@@ -8,11 +8,13 @@
8
8
  $use-flexbox-grid: $use-flexbox-grid
9
9
  );
10
10
  @use "~@carbon/react/scss/utilities/_visually-hidden";
11
- // we replicate the function here because the distinct import is not ossible via @carbon/react
11
+
12
+ // we replicate the function here because the distinct import is not possible via @carbon/react
12
13
  // @import "~@carbon/styles/scss/components/ui-shell/functions";
13
14
  @function mini-units($count) {
14
15
  @return 0.5rem * $count;
15
16
  }
17
+
16
18
  @import "~@carbon/react/scss/feature-flags";
17
19
  @import "~@carbon/react/scss/colors";
18
20
  @import "~@carbon/react/scss/theme";