@eccenca/gui-elements 24.4.1-featurepreparefinalnextcmem6943.2 → 25.0.0-featureimproveprintstylescmem6985.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 (149) hide show
  1. package/CHANGELOG.md +74 -19
  2. package/dist/cjs/cmem/markdown/Markdown.js +1 -2
  3. package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
  4. package/dist/cjs/common/index.js +4 -0
  5. package/dist/cjs/common/index.js.map +1 -1
  6. package/dist/cjs/common/utils/reduceToText.js +94 -0
  7. package/dist/cjs/common/utils/reduceToText.js.map +1 -0
  8. package/dist/cjs/components/Application/ApplicationViewability.js +33 -0
  9. package/dist/cjs/components/Application/ApplicationViewability.js.map +1 -0
  10. package/dist/cjs/components/Application/index.js +1 -0
  11. package/dist/cjs/components/Application/index.js.map +1 -1
  12. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +1 -1
  13. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  14. package/dist/cjs/components/Button/Button.js +1 -1
  15. package/dist/cjs/components/Button/Button.js.map +1 -1
  16. package/dist/cjs/components/ContextOverlay/ContextMenu.js +2 -2
  17. package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
  18. package/dist/cjs/components/ContextOverlay/ContextOverlay.js +65 -18
  19. package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
  20. package/dist/cjs/components/Dialog/Modal.js +15 -3
  21. package/dist/cjs/components/Dialog/Modal.js.map +1 -1
  22. package/dist/cjs/components/Dialog/ModalContext.js +51 -0
  23. package/dist/cjs/components/Dialog/ModalContext.js.map +1 -0
  24. package/dist/cjs/components/Dialog/index.js +1 -0
  25. package/dist/cjs/components/Dialog/index.js.map +1 -1
  26. package/dist/cjs/components/Icon/canonicalIconNames.js +25 -2
  27. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  28. package/dist/cjs/components/Spinner/Spinner.js +2 -1
  29. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  30. package/dist/cjs/components/TextReducer/TextReducer.js +17 -63
  31. package/dist/cjs/components/TextReducer/TextReducer.js.map +1 -1
  32. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +2 -2
  33. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  34. package/dist/esm/cmem/markdown/Markdown.js +1 -2
  35. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  36. package/dist/esm/common/index.js +4 -0
  37. package/dist/esm/common/index.js.map +1 -1
  38. package/dist/esm/common/utils/reduceToText.js +75 -0
  39. package/dist/esm/common/utils/reduceToText.js.map +1 -0
  40. package/dist/esm/components/Application/ApplicationViewability.js +28 -0
  41. package/dist/esm/components/Application/ApplicationViewability.js.map +1 -0
  42. package/dist/esm/components/Application/index.js +1 -0
  43. package/dist/esm/components/Application/index.js.map +1 -1
  44. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +1 -1
  45. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  46. package/dist/esm/components/Button/Button.js +1 -1
  47. package/dist/esm/components/Button/Button.js.map +1 -1
  48. package/dist/esm/components/ContextOverlay/ContextMenu.js +2 -2
  49. package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
  50. package/dist/esm/components/ContextOverlay/ContextOverlay.js +69 -22
  51. package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
  52. package/dist/esm/components/Dialog/Modal.js +15 -3
  53. package/dist/esm/components/Dialog/Modal.js.map +1 -1
  54. package/dist/esm/components/Dialog/ModalContext.js +69 -0
  55. package/dist/esm/components/Dialog/ModalContext.js.map +1 -0
  56. package/dist/esm/components/Dialog/index.js +1 -0
  57. package/dist/esm/components/Dialog/index.js.map +1 -1
  58. package/dist/esm/components/Icon/canonicalIconNames.js +25 -2
  59. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  60. package/dist/esm/components/Spinner/Spinner.js +2 -1
  61. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  62. package/dist/esm/components/TextReducer/TextReducer.js +17 -41
  63. package/dist/esm/components/TextReducer/TextReducer.js.map +1 -1
  64. package/dist/esm/extensions/react-flow/nodes/NodeContent.js +2 -2
  65. package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  66. package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +1 -1
  67. package/dist/types/common/index.d.ts +3 -0
  68. package/dist/types/common/utils/reduceToText.d.ts +10 -0
  69. package/dist/types/components/Application/ApplicationViewability.d.ts +36 -0
  70. package/dist/types/components/Application/index.d.ts +1 -0
  71. package/dist/types/components/Button/Button.d.ts +14 -7
  72. package/dist/types/components/ContextOverlay/ContextMenu.d.ts +1 -1
  73. package/dist/types/components/Dialog/Modal.d.ts +9 -1
  74. package/dist/types/components/Dialog/ModalContext.d.ts +13 -0
  75. package/dist/types/components/Dialog/index.d.ts +1 -0
  76. package/dist/types/components/Icon/canonicalIconNames.d.ts +23 -0
  77. package/dist/types/components/Spinner/Spinner.d.ts +11 -4
  78. package/dist/types/components/Tabs/Tab.d.ts +2 -2
  79. package/dist/types/components/TextReducer/TextReducer.d.ts +13 -1
  80. package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +1 -1
  81. package/package.json +5 -3
  82. package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +1 -1
  83. package/src/cmem/markdown/Markdown.tsx +1 -2
  84. package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +1 -1
  85. package/src/cmem/react-flow/_minimap.scss +10 -0
  86. package/src/cmem/react-flow/configuration/_colors-graph.scss +12 -12
  87. package/src/cmem/react-flow/configuration/_colors-linking.scss +8 -8
  88. package/src/cmem/react-flow/configuration/_colors-workflow.scss +11 -11
  89. package/src/common/index.ts +6 -0
  90. package/src/common/scss/_color-functions.scss +5 -0
  91. package/src/common/utils/reduceToText.tsx +82 -0
  92. package/src/components/Application/ApplicationViewability.tsx +61 -0
  93. package/src/components/Application/_content.scss +7 -0
  94. package/src/components/Application/_header.scss +12 -3
  95. package/src/components/Application/_viewability.scss +13 -0
  96. package/src/components/Application/application.scss +1 -0
  97. package/src/components/Application/index.ts +1 -0
  98. package/src/components/Application/stories/ApplicationViewability.stories.tsx +37 -0
  99. package/src/components/Application/tests/ApplicationViewability.test.tsx +43 -0
  100. package/src/components/AutocompleteField/AutoCompleteField.tsx +1 -0
  101. package/src/components/Button/Button.stories.tsx +7 -1
  102. package/src/components/Button/Button.tsx +16 -9
  103. package/src/components/Button/button.scss +86 -24
  104. package/src/components/Card/card.scss +6 -0
  105. package/src/components/Chat/stories/ChatField.stories.tsx +6 -1
  106. package/src/components/Checkbox/checkbox.scss +14 -2
  107. package/src/components/ContentGroup/_contentgroup.scss +9 -0
  108. package/src/components/ContextOverlay/ContextMenu.tsx +4 -1
  109. package/src/components/ContextOverlay/ContextOverlay.tsx +77 -18
  110. package/src/components/ContextOverlay/tests/ContextMenu.test.tsx +43 -0
  111. package/src/components/ContextOverlay/tests/ContextOverlay.test.tsx +71 -0
  112. package/src/components/Depiction/depiction.scss +6 -0
  113. package/src/components/Dialog/Modal.tsx +28 -3
  114. package/src/components/Dialog/ModalContext.tsx +56 -0
  115. package/src/components/Dialog/index.ts +1 -0
  116. package/src/components/Dialog/stories/Modal.stories.tsx +10 -7
  117. package/src/components/Dialog/stories/ModalContext.stories.tsx +153 -0
  118. package/src/components/FlexibleLayout/flexiblelayout.scss +16 -0
  119. package/src/components/Grid/grid.scss +17 -0
  120. package/src/components/Grid/stories/Grid.stories.tsx +10 -7
  121. package/src/components/Grid/stories/GridRow.stories.tsx +13 -7
  122. package/src/components/Icon/canonicalIconNames.tsx +25 -2
  123. package/src/components/Icon/icon.scss +6 -0
  124. package/src/components/Icon/stories/Icon.stories.tsx +65 -5
  125. package/src/components/Icon/stories/IconButton.stories.tsx +2 -1
  126. package/src/components/Notification/Notification.stories.tsx +20 -6
  127. package/src/components/Notification/notification.scss +14 -3
  128. package/src/components/OverviewItem/overviewitem.scss +9 -0
  129. package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +7 -1
  130. package/src/components/PropertyValuePair/propertyvalue.scss +23 -1
  131. package/src/components/Select/Select.stories.tsx +1 -1
  132. package/src/components/Separation/separation.scss +6 -0
  133. package/src/components/Spinner/Spinner.tsx +13 -3
  134. package/src/components/Spinner/Stories/spinner.stories.tsx +1 -1
  135. package/src/components/Spinner/spinner.scss +5 -1
  136. package/src/components/Table/table.scss +22 -0
  137. package/src/components/Tag/tag.scss +95 -68
  138. package/src/components/TextField/textfield.scss +23 -15
  139. package/src/components/TextReducer/TextReducer.stories.tsx +2 -1
  140. package/src/components/TextReducer/TextReducer.test.tsx +44 -0
  141. package/src/components/TextReducer/TextReducer.tsx +17 -44
  142. package/src/components/VisualTour/stories/VisualTour.stories.tsx +1 -1
  143. package/src/configuration/_palettes.scss +2 -1
  144. package/src/extensions/react-flow/_config.scss +8 -3
  145. package/src/extensions/react-flow/_react-flow_v12.scss +10 -14
  146. package/src/extensions/react-flow/edges/EdgeLabel.tsx +1 -1
  147. package/src/extensions/react-flow/edges/_edges.scss +15 -7
  148. package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +5 -5
  149. package/src/extensions/react-flow/nodes/NodeContent.tsx +2 -2
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+
3
+ export interface ModalContextProps {
4
+ /** Set that a specific modal is currently being open (or closed) */
5
+ setModalOpen: (modalId: string, isOpen: boolean) => void;
6
+
7
+ /** The currently opened modals ordered by when they have been opened. Oldest coming first. */
8
+ openModalStack(): string[] | undefined;
9
+ }
10
+
11
+ /** Can be provided in the application to react to modal related changes. */
12
+ export const ModalContext = React.createContext<ModalContextProps>({
13
+ setModalOpen: () => {},
14
+ openModalStack: () => [],
15
+ });
16
+
17
+ /** Default implementation for modal context props.
18
+ * Tracks open modals in a stack representation.
19
+ **/
20
+ export const useModalContext = (): ModalContextProps => {
21
+ // A stack of modal IDs. These should reflect a stacked opening of modals on top of each other.
22
+ const currentOpenModalStack = React.useRef<string[]>([]);
23
+
24
+ const setOpenModalStack = ((stackUpdateFunction: (old: string[]) => string[]) => {
25
+ currentOpenModalStack.current = stackUpdateFunction([...currentOpenModalStack.current])
26
+ })
27
+
28
+ const setModalOpen = React.useCallback((modalId: string, isOpen: boolean) => {
29
+ setOpenModalStack(old => {
30
+ if (isOpen) {
31
+ return [...old, modalId];
32
+ } else {
33
+ const idx = old.findIndex((id) => modalId === id);
34
+ switch (idx) {
35
+ case -1:
36
+ // Trying to close modal that has not been registered as open!
37
+ return old;
38
+ case old.length - 1:
39
+ return old.slice(0, idx);
40
+ default:
41
+ // Modal in between is closed. Consider all modals after it also as closed.
42
+ return old.slice(0, idx);
43
+ }
44
+ }
45
+ });
46
+ }, []);
47
+
48
+ const openModalStack = React.useCallback(() => {
49
+ return currentOpenModalStack.current.length ? [...currentOpenModalStack.current] : undefined
50
+ }, [])
51
+
52
+ return {
53
+ openModalStack,
54
+ setModalOpen,
55
+ };
56
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./Modal";
2
2
  export * from "./SimpleDialog";
3
3
  export * from "./AlertDialog";
4
+ export * from "./ModalContext";
@@ -15,15 +15,18 @@ export default {
15
15
  control: false,
16
16
  },
17
17
  },
18
+ decorators: [
19
+ (Story) => (
20
+ <OverlaysProvider>
21
+ <div style={{ height: "400px" }}>
22
+ <Story />
23
+ </div>
24
+ </OverlaysProvider>
25
+ ),
26
+ ],
18
27
  } as Meta<typeof Modal>;
19
28
 
20
- const Template: StoryFn<typeof Modal> = (args) => (
21
- <OverlaysProvider>
22
- <div style={{ height: "400px" }}>
23
- <Modal {...args} />
24
- </div>
25
- </OverlaysProvider>
26
- );
29
+ const Template: StoryFn<typeof Modal> = (args) => <Modal {...args} />;
27
30
 
28
31
  export const Default = Template.bind({});
29
32
  Default.args = {
@@ -0,0 +1,153 @@
1
+ import React from "react";
2
+ import { Classes, OverlaysProvider } from "@blueprintjs/core";
3
+ import { Meta } from "@storybook/react";
4
+
5
+ import {
6
+ Button,
7
+ Card,
8
+ CardContent,
9
+ Modal,
10
+ ModalContext,
11
+ ModalContextProps,
12
+ ModalSize,
13
+ Spacing,
14
+ useModalContext,
15
+ } from "./../../../../index";
16
+
17
+ /**
18
+ * `ModalContext` can be used as provider to track a stack of modals.
19
+ *
20
+ * ```(Javascript)
21
+ * import { ModalContext, SimpleDialog } from "@eccenca/gui-elements";
22
+ *
23
+ * const ContextTemplate = () => {
24
+ * const { setModalOpen, openModalStack } = useModalContext();
25
+ * return (
26
+ * <ModalContext.Provider value={{ setModalOpen, openModalStack }}>
27
+ * <SimpleDialog size="large" isOpen>
28
+ * <OtherModal />
29
+ * </SimpleDialog>
30
+ * </ModalContext.Provider>
31
+ * );
32
+ * };
33
+ *
34
+ * const OtherModal = () => {
35
+ * const modalContext = React.useContext(ModalContext);
36
+ * return (
37
+ * <SimpleDialog size="small">
38
+ * <ul>
39
+ * {(modalContext.openModalStack ?? []).map((modalId, idx) => (
40
+ * <li key={modalId}>
41
+ * {idx + 1}. {modalId}
42
+ * </li>
43
+ * ))}
44
+ * </ul>
45
+ * </SimpleDialog>
46
+ * );
47
+ * };
48
+ * ```
49
+ */
50
+ export default {
51
+ title: "Components/Dialog/ModalContext",
52
+ decorators: [
53
+ (Story) => (
54
+ <OverlaysProvider>
55
+ <div style={{ height: "70vh", position: "relative" }} id={"modalPortal"}>
56
+ <Story />
57
+ </div>
58
+ </OverlaysProvider>
59
+ ),
60
+ ],
61
+ } as Meta<ModalContextProps>;
62
+
63
+ export const Usage = () => {
64
+ const { setModalOpen, openModalStack } = useModalContext();
65
+
66
+ return (
67
+ <ModalContext.Provider value={{ setModalOpen, openModalStack }}>
68
+ <ExampleModal id="rootModal" size="large">
69
+ <MiddleModal />
70
+ </ExampleModal>
71
+ </ModalContext.Provider>
72
+ );
73
+ };
74
+
75
+ const ModalContent = ({ children }: React.HTMLAttributes<HTMLDivElement>) => {
76
+ return (
77
+ <Card style={{ height: "100%" }}>
78
+ <CardContent>{children}</CardContent>
79
+ </Card>
80
+ );
81
+ };
82
+
83
+ /** Component for nested modals. */
84
+ const ExampleModal = ({
85
+ id,
86
+ size,
87
+ children,
88
+ }: {
89
+ id?: string;
90
+ size: ModalSize;
91
+ children?: React.HTMLAttributes<HTMLDivElement>["children"];
92
+ }) => {
93
+ const [isOpen, setIsOpen] = React.useState(true);
94
+ const [portalElement, setPortalElement] = React.useState<HTMLElement | undefined>();
95
+
96
+ React.useEffect(() => {
97
+ setPortalElement(document.getElementById("modalPortal")!);
98
+ }, []);
99
+
100
+ return (
101
+ <Modal
102
+ modalId={id}
103
+ size={size}
104
+ isOpen={isOpen}
105
+ usePortal={true}
106
+ portalContainer={portalElement}
107
+ hasBackdrop={true}
108
+ onOpened={() => {
109
+ // workaround, Blueprint attach a class to body tht prevents scrolling, probably it is attached to the wrong portal
110
+ document.body.classList.remove(Classes.OVERLAY_OPEN);
111
+ }}
112
+ >
113
+ <ModalContent>
114
+ Modal with constant modal ID "{id}".
115
+ <Spacing />
116
+ <TrackingContent />
117
+ <Spacing />
118
+ {children}
119
+ <Spacing />
120
+ <Button key={"close"} onClick={() => setIsOpen(false)}>
121
+ Close
122
+ </Button>
123
+ </ModalContent>
124
+ </Modal>
125
+ );
126
+ };
127
+
128
+ const InnerModal = () => {
129
+ return <ExampleModal id="innerModal" size="small" />;
130
+ };
131
+
132
+ const MiddleModal = () => {
133
+ return (
134
+ <ExampleModal id="middleModal" size="regular">
135
+ <InnerModal />
136
+ </ExampleModal>
137
+ );
138
+ };
139
+
140
+ /** Shows the current stack of open modals. */
141
+ const TrackingContent = () => {
142
+ const modalContext = React.useContext(ModalContext);
143
+
144
+ return (
145
+ <ul>
146
+ {(modalContext.openModalStack() ?? []).map((modalId, idx) => (
147
+ <li key={modalId}>
148
+ {idx + 1}. {modalId}
149
+ </li>
150
+ ))}
151
+ </ul>
152
+ );
153
+ };
@@ -46,3 +46,19 @@
46
46
  flex-basis: auto;
47
47
  }
48
48
  }
49
+
50
+ @media print {
51
+ .#{$eccgui}-flexible__container,
52
+ .#{$eccgui}-flexible__item {
53
+ position: relative;
54
+ display: block;
55
+ width: auto;
56
+ height: auto;
57
+ padding: 0;
58
+ margin: 0;
59
+
60
+ &:is(.#{$eccgui}-flexible__item) {
61
+ margin-bottom: $eccgui-size-block-whitespace;
62
+ }
63
+ }
64
+ }
@@ -86,3 +86,20 @@ $grid-gutter: rem($eccgui-size-grid-gutter);
86
86
  flex-wrap: nowrap;
87
87
  }
88
88
  }
89
+
90
+ @media print {
91
+ .#{$eccgui}-grid,
92
+ .#{$eccgui}-grid__row,
93
+ .#{$eccgui}-grid__column {
94
+ position: relative;
95
+ display: block;
96
+ width: auto;
97
+ height: auto;
98
+ padding: 0;
99
+ margin: 0;
100
+
101
+ &:is(.#{$eccgui}-grid__column) {
102
+ margin-bottom: $eccgui-size-block-whitespace;
103
+ }
104
+ }
105
+ }
@@ -11,19 +11,22 @@ export default {
11
11
  subcomponents: { GridRow, GridColumn },
12
12
  argTypes: {
13
13
  children: {
14
- control: "none",
14
+ control: false,
15
15
  },
16
16
  },
17
+ decorators: [
18
+ (Story) => (
19
+ <div style={{ minHeight: "30vh", position: "relative" }}>
20
+ <Story />
21
+ </div>
22
+ ),
23
+ ],
17
24
  } as Meta<typeof Grid>;
18
25
 
19
- const Template: StoryFn<typeof Grid> = (args) => (
20
- <div style={{ minHeight: "30vh", position: "relative" }}>
21
- <Grid {...args} />
22
- </div>
23
- );
26
+ const Template: StoryFn<typeof Grid> = (args) => <Grid {...args} />;
24
27
 
25
28
  export const Default = Template.bind({});
26
29
  Default.args = {
27
- children: <GridRow {...RowExample.args} verticalStretched />,
30
+ children: [<GridRow {...RowExample.args} verticalStretched />, <GridRow {...RowExample.args} verticalStretched />],
28
31
  verticalStretchable: true,
29
32
  };
@@ -10,21 +10,27 @@ export default {
10
10
  component: GridRow,
11
11
  argTypes: {
12
12
  children: {
13
- control: "none",
13
+ control: false,
14
14
  },
15
15
  },
16
16
  } as Meta<typeof GridRow>;
17
17
 
18
- const Template: StoryFn<typeof GridRow> = (args) => (
19
- <Grid style={{ minHeight: "30vh" }} verticalStretchable>
20
- <GridRow {...args} />
21
- </Grid>
22
- );
18
+ const Template: StoryFn<typeof GridRow> = (args) => <GridRow {...args} />;
23
19
 
24
20
  export const Default = Template.bind({});
25
21
  Default.args = {
26
- children: <GridColumn {...ColumnExample.args} verticalAlign="center" />,
22
+ children: [
23
+ <GridColumn {...ColumnExample.args} verticalAlign="center" key="col1" />,
24
+ <GridColumn {...ColumnExample.args} verticalAlign="center" key="col1" />,
25
+ ],
27
26
  };
27
+ Default.decorators = [
28
+ (Story) => (
29
+ <Grid style={{ minHeight: "30vh" }} verticalStretchable>
30
+ <Story />
31
+ </Grid>
32
+ ),
33
+ ];
28
34
 
29
35
  const TemplateStretched: StoryFn<typeof GridRow> = (args) => (
30
36
  <Grid style={{ minHeight: "50vh" }} verticalStretchable>
@@ -25,6 +25,17 @@ const canonicalIcons = {
25
25
  "artefact-task-concatenatetofile": icons.DocumentExport,
26
26
  "artefact-task-sqlupdatequeryoperator": icons.Sql,
27
27
  "artefact-task-customsqlexecution": icons.Sql,
28
+ "artefact-task-multitablemerge": icons.JoinFull,
29
+ "artefact-task-jsonparseroperator": icons.JsonReference,
30
+ "artefact-task-searchaddresses": icons.SearchLocate,
31
+ "artefact-task-sparkfunction": icons.Flash,
32
+ "artefact-task-eccencadataplatformgraphstorefileuploadoperator": icons.Upload,
33
+ "artefact-task-xsltoperator": icons.TransformCode,
34
+ "artefact-task-distinctby": icons.Filter,
35
+ "artefact-task-template": icons.Template,
36
+ "artefact-task-merge": icons.Connect,
37
+ "artefact-task-scheduler": icons.EventSchedule,
38
+ "artefact-task-sendemail": icons.Email,
28
39
  "artefact-dataset-csv": icons.Csv,
29
40
  "artefact-dataset-eccencadataplatform": icons.DataVis_1,
30
41
  "artefact-dataset-excel": icons.Xls,
@@ -77,6 +88,7 @@ const canonicalIcons = {
77
88
  "item-execution": icons.Run,
78
89
  "item-info": icons.Information,
79
90
  "item-launch": icons.Launch,
91
+ "item-legend": icons.Legend,
80
92
  "item-moremenu": icons.OverflowMenuVertical,
81
93
  "item-question": icons.Help,
82
94
  "item-reload": icons.Renew,
@@ -94,8 +106,8 @@ const canonicalIcons = {
94
106
  "item-hidedetails": icons.ViewOff,
95
107
  "item-image": icons.Image,
96
108
 
97
- "list-sortasc": icons.ArrowDown,
98
- "list-sortdesc": icons.ArrowUp,
109
+ "list-sortasc": icons.ArrowUp,
110
+ "list-sortdesc": icons.ArrowDown,
99
111
  "list-sort": icons.ArrowsVertical,
100
112
 
101
113
  "module-accesscontrol": icons.UserAdmin,
@@ -147,6 +159,7 @@ const canonicalIcons = {
147
159
  "operation-logout": icons.Logout,
148
160
  "operation-magic": icons.MagicWand,
149
161
  "operation-merge": icons.DirectionMerge,
162
+ "operation-tour": icons.Tour,
150
163
  "operation-redo": icons.Redo,
151
164
  "operation-search": icons.Search,
152
165
  "operation-send": icons.Send,
@@ -161,9 +174,13 @@ const canonicalIcons = {
161
174
  "state-confirmed": icons.ThumbsUp,
162
175
  "state-danger": icons.ErrorFilled,
163
176
  "state-declined": icons.ThumbsDown,
177
+ "state-flagged": icons.Flag,
164
178
  "state-info": icons.InformationFilled,
165
179
  "state-locked": icons.Locked,
166
180
  "state-partlychecked": icons.CheckboxIndeterminate,
181
+ "state-progress": icons.InProgress,
182
+ "state-progress-error": icons.InProgressError,
183
+ "state-progress-warning": icons.InProgressWarning,
167
184
  "state-protected": icons.DocumentProtected,
168
185
  "state-success": icons.CheckmarkFilled,
169
186
  "state-unchecked": icons.Checkbox,
@@ -171,13 +188,19 @@ const canonicalIcons = {
171
188
  "state-warning": icons.WarningAltFilled,
172
189
 
173
190
  "toggler-caret": icons.CaretSort,
191
+ "toggler-carettop": icons.CaretUp,
174
192
  "toggler-caretright": icons.CaretRight,
175
193
  "toggler-caretdown": icons.CaretDown,
194
+ "toggler-caretleft": icons.CaretLeft,
176
195
  "toggler-maximize": icons.Maximize,
177
196
  "toggler-minimize": icons.Minimize,
197
+ "toggler-micon": icons.Microphone,
198
+ "toggler-micoff": icons.MicrophoneOff,
178
199
  "toggler-moveleft": icons.ChevronLeft,
179
200
  "toggler-moveright": icons.ChevronRight,
180
201
  "toggler-list": icons.List,
202
+ "toggler-radio": icons.RadioButton,
203
+ "toggler-radio-checked": icons.RadioButtonChecked,
181
204
  "toggler-rowexpand": icons.RowExpand,
182
205
  "toggler-rowcollapse": icons.RowCollapse,
183
206
  "toggler-showless": icons.ChevronUp,
@@ -1,6 +1,12 @@
1
1
  .#{$eccgui}-icon {
2
2
  vertical-align: text-bottom;
3
3
 
4
+ &.#{$eccgui}-intent--primary {
5
+ color: $eccgui-color-primary;
6
+ }
7
+ &.#{$eccgui}-intent--accent {
8
+ color: $eccgui-color-accent;
9
+ }
4
10
  &.#{$eccgui}-intent--info {
5
11
  color: $eccgui-color-info-text;
6
12
  }
@@ -2,7 +2,18 @@ import React from "react";
2
2
  import { OverlaysProvider } from "@blueprintjs/core";
3
3
  import { Meta, StoryFn } from "@storybook/react";
4
4
 
5
- import { Button, Icon } from "../../../../index";
5
+ import {
6
+ Card,
7
+ FlexibleLayoutContainer,
8
+ FlexibleLayoutItem,
9
+ Icon,
10
+ OverflowText,
11
+ OverviewItem,
12
+ OverviewItemDepiction,
13
+ OverviewItemDescription,
14
+ OverviewItemLine,
15
+ TitleSubsection,
16
+ } from "../../../../index";
6
17
  import { Definitions } from "../../../common/Intent";
7
18
  import BaseIcon from "../BaseIcon";
8
19
 
@@ -19,7 +30,8 @@ export default {
19
30
  },
20
31
  intent: {
21
32
  control: "select",
22
- options: { ...Definitions },
33
+ options: [...Object.keys(Definitions)],
34
+ mapping: { ...Definitions },
23
35
  },
24
36
  },
25
37
  } as Meta<typeof Icon>;
@@ -49,12 +61,60 @@ IconSizes.args = {
49
61
  name: "undefined",
50
62
  };
51
63
 
64
+ /**
65
+ * Available icons by their canonical names.
66
+ * If you need another icon then use `<TestIcon /`> component.
67
+ */
52
68
  export const IconsOverview = () => {
69
+ let section = "";
70
+ let separation = <></>;
53
71
  return (
54
72
  <OverlaysProvider>
55
- {Object.keys(canonicalIcons).map((iconName) => {
56
- return <Button icon={iconName as ValidIconName} outlined large tooltip={iconName} key={iconName} />;
57
- })}
73
+ <FlexibleLayoutContainer
74
+ noEqualItemSpace
75
+ gapSize="small"
76
+ style={{ flexWrap: "wrap", justifyContent: "flex-start" }}
77
+ >
78
+ {Object.keys(canonicalIcons)
79
+ .sort()
80
+ .map((iconName) => {
81
+ if (
82
+ section !==
83
+ iconName.substring(0, iconName.indexOf("-") > 0 ? iconName.indexOf("-") : iconName.length)
84
+ ) {
85
+ section = iconName.substring(
86
+ 0,
87
+ iconName.indexOf("-") > 0 ? iconName.indexOf("-") : iconName.length
88
+ );
89
+ separation = (
90
+ <FlexibleLayoutItem style={{ width: "100%", padding: "1rem 0 0.5rem 0" }}>
91
+ <TitleSubsection>{section}</TitleSubsection>
92
+ </FlexibleLayoutItem>
93
+ );
94
+ } else {
95
+ separation = <></>;
96
+ }
97
+ return (
98
+ <React.Fragment key={iconName}>
99
+ {separation}
100
+ <FlexibleLayoutItem growFactor={0} style={{ width: "20rem" }}>
101
+ <Card>
102
+ <OverviewItem>
103
+ <OverviewItemDepiction keepColors>
104
+ <Icon name={iconName as ValidIconName} />
105
+ </OverviewItemDepiction>
106
+ <OverviewItemDescription>
107
+ <OverviewItemLine small>
108
+ <OverflowText>{iconName}</OverflowText>
109
+ </OverviewItemLine>
110
+ </OverviewItemDescription>
111
+ </OverviewItem>
112
+ </Card>
113
+ </FlexibleLayoutItem>
114
+ </React.Fragment>
115
+ );
116
+ })}
117
+ </FlexibleLayoutContainer>
58
118
  </OverlaysProvider>
59
119
  );
60
120
  };
@@ -5,13 +5,13 @@ import { Meta, StoryFn } from "@storybook/react";
5
5
 
6
6
  import { IconButton, TestIcon } from "../../../../index";
7
7
 
8
+ import buttonStory from "./../../Button/Button.stories";
8
9
  import canonicalIcons from "./../canonicalIconNames";
9
10
 
10
11
  export default {
11
12
  title: "Components/IconButton",
12
13
  component: IconButton,
13
14
  argTypes: {
14
- text: { control: "text" },
15
15
  name: {
16
16
  control: "select",
17
17
  options: ["Test icon", ...Object.keys(canonicalIcons)],
@@ -20,6 +20,7 @@ export default {
20
20
  ...Object.keys(canonicalIcons),
21
21
  },
22
22
  },
23
+ intent: buttonStory.argTypes?.intent,
23
24
  },
24
25
  } as Meta<typeof IconButton>;
25
26
 
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { LoremIpsum } from "react-lorem-ipsum";
2
+ import { LoremIpsum, loremIpsum } from "react-lorem-ipsum";
3
3
  import { Meta, StoryFn } from "@storybook/react";
4
4
 
5
5
  import { helpersArgTypes } from "../../../.storybook/helpers";
6
- import { Button, HtmlContentBlock, Notification, Spacing } from "../../../index";
6
+ import { Button, HtmlContentBlock, Markdown, Notification, Spacing } from "../../../index";
7
7
 
8
8
  export default {
9
9
  title: "Components/Notification",
@@ -33,12 +33,26 @@ ExampleWithMessage.args = {
33
33
  export const ExampleWithChildren = TemplateFull.bind({});
34
34
  ExampleWithChildren.args = {
35
35
  children: (
36
- <HtmlContentBlock>
37
- <LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />
38
- <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
39
- </HtmlContentBlock>
36
+ <>
37
+ <HtmlContentBlock>
38
+ <LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />
39
+ <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
40
+ </HtmlContentBlock>
41
+ <br />
42
+ <Markdown
43
+ htmlContentBlockProps={{
44
+ style: {
45
+ maxHeight: "25vh",
46
+ overflow: "auto",
47
+ },
48
+ }}
49
+ >
50
+ {"```\n" + loremIpsum({ random: false }) + "\n```"}
51
+ </Markdown>
52
+ </>
40
53
  ),
41
54
  onDismiss: false, // workaround for undefined function in Storybook
55
+ actions: [<></>],
42
56
  };
43
57
 
44
58
  export const ExampleNeutralMessage = TemplateFull.bind({});
@@ -3,6 +3,10 @@
3
3
  @use "sass:math";
4
4
  @import "~@blueprintjs/core/src/components/toast/toast";
5
5
 
6
+ .#{$ns}-toast-message {
7
+ min-width: 0;
8
+ }
9
+
6
10
  .#{$eccgui}-notification {
7
11
  width: 100%;
8
12
  min-width: math.div(4, 16) * 100vw;
@@ -69,20 +73,27 @@
69
73
  display: flex;
70
74
  align-items: baseline;
71
75
  justify-content: space-between;
72
- margin: -10px; // TODO: use blueprint var ofr toast padding here
76
+ margin: -0.5 * $toast-margin;
73
77
  }
74
78
 
75
79
  .#{$eccgui}-notification__messagebody {
76
80
  flex-grow: 1;
77
81
  flex-shrink: 1;
78
- padding: 10px; // TODO: use blueprint var ofr toast padding here
82
+ min-width: 0;
83
+ padding: 0.5 * $toast-margin;
79
84
  }
80
85
 
81
86
  .#{$eccgui}-notification__actions {
82
87
  flex-grow: 0;
83
88
  flex-shrink: 0;
84
89
 
85
- .#{$ns}-button:not([class*="intent"]) {
90
+ .#{$ns}-button:not([class*="intent"]):not(:disabled) {
86
91
  color: inherit;
87
92
  }
88
93
  }
94
+
95
+ @media print {
96
+ .#{$eccgui}-notification__actions {
97
+ display: none;
98
+ }
99
+ }
@@ -197,3 +197,12 @@ $eccgui-size-overviewitem-line-typo-large-lineheight: $eccgui-size-typo-subtitle
197
197
  display: flex;
198
198
  }
199
199
  }
200
+
201
+ @media print {
202
+ .#{$eccgui}-overviewitem__actions {
203
+ display: none;
204
+ }
205
+ .#{$eccgui}-overviewitem__depiction {
206
+ print-color-adjust: exact;
207
+ }
208
+ }
@@ -1,11 +1,17 @@
1
1
  import React from "react";
2
2
  import { Meta, StoryFn } from "@storybook/react";
3
3
 
4
+ import { helpersArgTypes } from "../../../../.storybook/helpers";
4
5
  import { ProgressBar } from "../../../../index";
5
6
  export default {
6
7
  title: "Components/ProgressBar",
7
8
  component: ProgressBar,
8
- argTypes: {},
9
+ argTypes: {
10
+ intent: {
11
+ ...helpersArgTypes.exampleIntent,
12
+ options: ["UNDEFINED", "primary", "success", "warning", "danger"],
13
+ },
14
+ },
9
15
  } as Meta<typeof ProgressBar>;
10
16
 
11
17
  const ProgressBarExample: StoryFn<typeof ProgressBar> = (args) => <ProgressBar {...args}></ProgressBar>;