@eccenca/gui-elements 23.0.0 → 23.1.0-easynav.1

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 (289) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +7 -0
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
  5. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  6. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -7
  7. package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
  8. package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js +200 -0
  9. package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
  10. package/dist/cjs/common/Intent/index.js +7 -3
  11. package/dist/cjs/common/Intent/index.js.map +1 -1
  12. package/dist/cjs/common/utils/characters.js +82 -0
  13. package/dist/cjs/common/utils/characters.js.map +1 -0
  14. package/dist/cjs/components/Application/ApplicationTitle.js +2 -2
  15. package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
  16. package/dist/cjs/components/Badge/Badge.js +44 -0
  17. package/dist/cjs/components/Badge/Badge.js.map +1 -0
  18. package/dist/cjs/components/Depiction/Depiction.js +111 -0
  19. package/dist/cjs/components/Depiction/Depiction.js.map +1 -0
  20. package/dist/cjs/components/Grid/Grid.js +7 -2
  21. package/dist/cjs/components/Grid/Grid.js.map +1 -1
  22. package/dist/cjs/components/Grid/GridColumn.js +6 -2
  23. package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
  24. package/dist/cjs/components/Grid/GridRow.js +3 -0
  25. package/dist/cjs/components/Grid/GridRow.js.map +1 -1
  26. package/dist/cjs/components/Icon/BaseIcon.js +38 -0
  27. package/dist/cjs/components/Icon/BaseIcon.js.map +1 -0
  28. package/dist/cjs/components/Icon/Icon.js +9 -24
  29. package/dist/cjs/components/Icon/Icon.js.map +1 -1
  30. package/dist/cjs/components/Icon/IconButton.js +8 -1
  31. package/dist/cjs/components/Icon/IconButton.js.map +1 -1
  32. package/dist/cjs/components/Icon/TestIcon.js +35 -0
  33. package/dist/cjs/components/Icon/TestIcon.js.map +1 -0
  34. package/dist/cjs/components/Icon/canonicalIconNames.js +123 -621
  35. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  36. package/dist/cjs/components/Icon/index.js +11 -0
  37. package/dist/cjs/components/Icon/index.js.map +1 -0
  38. package/dist/cjs/components/Menu/MenuItem.js +1 -1
  39. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  40. package/dist/cjs/components/MultiSelect/MultiSelect.js +56 -23
  41. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  42. package/dist/cjs/components/Notification/Notification.js +10 -2
  43. package/dist/cjs/components/Notification/Notification.js.map +1 -1
  44. package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +24 -0
  45. package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
  46. package/dist/cjs/components/Tag/Tag.js +6 -2
  47. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  48. package/dist/cjs/components/TextField/TextArea.js +4 -2
  49. package/dist/cjs/components/TextField/TextArea.js.map +1 -1
  50. package/dist/cjs/components/TextField/TextField.js +4 -2
  51. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  52. package/dist/cjs/components/TextField/useTextValidation.js +84 -0
  53. package/dist/cjs/components/TextField/useTextValidation.js.map +1 -0
  54. package/dist/cjs/components/Tree/Tree.js.map +1 -1
  55. package/dist/cjs/components/Typography/Highlighter.js.map +1 -1
  56. package/dist/cjs/components/Typography/OverflowText.js.map +1 -1
  57. package/dist/cjs/components/Typography/WhiteSpaceContainer.js +35 -12
  58. package/dist/cjs/components/Typography/WhiteSpaceContainer.js.map +1 -1
  59. package/dist/cjs/components/Typography/index.js +21 -0
  60. package/dist/cjs/components/Typography/index.js.map +1 -0
  61. package/dist/cjs/components/Workspace/WorkspaceContent.js +1 -1
  62. package/dist/cjs/components/Workspace/WorkspaceContent.js.map +1 -1
  63. package/dist/cjs/components/index.js +18 -0
  64. package/dist/cjs/components/index.js.map +1 -0
  65. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +58 -0
  66. package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
  67. package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +12 -3
  68. package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
  69. package/dist/cjs/extensions/react-flow/index.js +11 -0
  70. package/dist/cjs/extensions/react-flow/index.js.map +1 -1
  71. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +57 -30
  72. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  73. package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +3 -2
  74. package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
  75. package/dist/cjs/extensions/react-flow/versionsupport.js +20 -0
  76. package/dist/cjs/extensions/react-flow/versionsupport.js.map +1 -0
  77. package/dist/cjs/index.js +7 -17
  78. package/dist/cjs/index.js.map +1 -1
  79. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  80. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
  81. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  82. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -6
  83. package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
  84. package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js +194 -0
  85. package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
  86. package/dist/esm/common/Intent/index.js +5 -13
  87. package/dist/esm/common/Intent/index.js.map +1 -1
  88. package/dist/esm/common/utils/characters.js +96 -0
  89. package/dist/esm/common/utils/characters.js.map +1 -0
  90. package/dist/esm/components/Application/ApplicationTitle.js +2 -2
  91. package/dist/esm/components/Application/ApplicationTitle.js.map +1 -1
  92. package/dist/esm/components/Badge/Badge.js +48 -0
  93. package/dist/esm/components/Badge/Badge.js.map +1 -0
  94. package/dist/esm/components/Depiction/Depiction.js +96 -0
  95. package/dist/esm/components/Depiction/Depiction.js.map +1 -0
  96. package/dist/esm/components/Grid/Grid.js +7 -2
  97. package/dist/esm/components/Grid/Grid.js.map +1 -1
  98. package/dist/esm/components/Grid/GridColumn.js +6 -2
  99. package/dist/esm/components/Grid/GridColumn.js.map +1 -1
  100. package/dist/esm/components/Grid/GridRow.js +3 -0
  101. package/dist/esm/components/Grid/GridRow.js.map +1 -1
  102. package/dist/esm/components/Icon/BaseIcon.js +44 -0
  103. package/dist/esm/components/Icon/BaseIcon.js.map +1 -0
  104. package/dist/esm/components/Icon/Icon.js +9 -24
  105. package/dist/esm/components/Icon/Icon.js.map +1 -1
  106. package/dist/esm/components/Icon/IconButton.js +8 -1
  107. package/dist/esm/components/Icon/IconButton.js.map +1 -1
  108. package/dist/esm/components/Icon/TestIcon.js +41 -0
  109. package/dist/esm/components/Icon/TestIcon.js.map +1 -0
  110. package/dist/esm/components/Icon/canonicalIconNames.js +123 -621
  111. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  112. package/dist/esm/components/Icon/index.js +4 -0
  113. package/dist/esm/components/Icon/index.js.map +1 -0
  114. package/dist/esm/components/Menu/MenuItem.js +1 -1
  115. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  116. package/dist/esm/components/MultiSelect/MultiSelect.js +61 -44
  117. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  118. package/dist/esm/components/Notification/Notification.js +12 -4
  119. package/dist/esm/components/Notification/Notification.js.map +1 -1
  120. package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +24 -0
  121. package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
  122. package/dist/esm/components/Tag/Tag.js +6 -2
  123. package/dist/esm/components/Tag/Tag.js.map +1 -1
  124. package/dist/esm/components/TextField/TextArea.js +4 -2
  125. package/dist/esm/components/TextField/TextArea.js.map +1 -1
  126. package/dist/esm/components/TextField/TextField.js +4 -2
  127. package/dist/esm/components/TextField/TextField.js.map +1 -1
  128. package/dist/esm/components/TextField/useTextValidation.js +78 -0
  129. package/dist/esm/components/TextField/useTextValidation.js.map +1 -0
  130. package/dist/esm/components/Tree/Tree.js.map +1 -1
  131. package/dist/esm/components/Typography/Highlighter.js.map +1 -1
  132. package/dist/esm/components/Typography/OverflowText.js.map +1 -1
  133. package/dist/esm/components/Typography/WhiteSpaceContainer.js +16 -14
  134. package/dist/esm/components/Typography/WhiteSpaceContainer.js.map +1 -1
  135. package/dist/esm/components/Typography/index.js +12 -0
  136. package/dist/esm/components/Typography/index.js.map +1 -0
  137. package/dist/esm/components/Workspace/WorkspaceContent.js +1 -1
  138. package/dist/esm/components/Workspace/WorkspaceContent.js.map +1 -1
  139. package/dist/esm/components/index.js +6 -0
  140. package/dist/esm/components/index.js.map +1 -0
  141. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +47 -0
  142. package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
  143. package/dist/esm/extensions/react-flow/handles/HandleDefault.js +13 -4
  144. package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
  145. package/dist/esm/extensions/react-flow/index.js +1 -0
  146. package/dist/esm/extensions/react-flow/index.js.map +1 -1
  147. package/dist/esm/extensions/react-flow/nodes/NodeContent.js +67 -38
  148. package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  149. package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +3 -2
  150. package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
  151. package/dist/esm/extensions/react-flow/versionsupport.js +32 -0
  152. package/dist/esm/extensions/react-flow/versionsupport.js.map +1 -0
  153. package/dist/esm/index.js +5 -10
  154. package/dist/esm/index.js.map +1 -1
  155. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +2 -1
  156. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
  157. package/dist/types/cmem/react-flow/extensions/scrollOnDragHook.d.ts +22 -0
  158. package/dist/types/common/Intent/index.d.ts +4 -3
  159. package/dist/types/common/utils/characters.d.ts +19 -0
  160. package/dist/types/components/Badge/Badge.d.ts +42 -0
  161. package/dist/types/components/Depiction/Depiction.d.ts +71 -0
  162. package/dist/types/components/Grid/Grid.d.ts +21 -2
  163. package/dist/types/components/Grid/GridColumn.d.ts +21 -3
  164. package/dist/types/components/Grid/GridRow.d.ts +18 -2
  165. package/dist/types/components/Icon/BaseIcon.d.ts +45 -0
  166. package/dist/types/components/Icon/Icon.d.ts +7 -34
  167. package/dist/types/components/Icon/IconButton.d.ts +3 -2
  168. package/dist/types/components/Icon/TestIcon.d.ts +20 -0
  169. package/dist/types/components/Icon/canonicalIconNames.d.ts +9 -7
  170. package/dist/types/components/Icon/index.d.ts +4 -0
  171. package/dist/types/components/Menu/MenuItem.d.ts +2 -1
  172. package/dist/types/components/MultiSelect/MultiSelect.d.ts +3 -1
  173. package/dist/types/components/Notification/Notification.d.ts +13 -4
  174. package/dist/types/components/Tabs/Tab.d.ts +2 -0
  175. package/dist/types/components/Tag/Tag.d.ts +16 -3
  176. package/dist/types/components/TextField/TextArea.d.ts +7 -2
  177. package/dist/types/components/TextField/TextField.d.ts +6 -1
  178. package/dist/types/components/TextField/useTextValidation.d.ts +28 -0
  179. package/dist/types/components/Tree/Tree.d.ts +2 -1
  180. package/dist/types/components/Typography/Highlighter.d.ts +2 -2
  181. package/dist/types/components/Typography/OverflowText.d.ts +2 -2
  182. package/dist/types/components/Typography/WhiteSpaceContainer.d.ts +45 -4
  183. package/dist/types/components/Typography/index.d.ts +12 -0
  184. package/dist/types/components/index.d.ts +5 -0
  185. package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +32 -0
  186. package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +11 -3
  187. package/dist/types/extensions/react-flow/index.d.ts +1 -0
  188. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +31 -7
  189. package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -1
  190. package/dist/types/extensions/react-flow/versionsupport.d.ts +7 -0
  191. package/dist/types/index.d.ts +6 -11
  192. package/package.json +14 -16
  193. package/scripts/compile-sass.ts +9 -1
  194. package/src/_shame.scss +1 -1
  195. package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +6 -4
  196. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +3 -2
  197. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +26 -1
  198. package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -6
  199. package/src/cmem/react-flow/extensions/scrollOnDragHook.ts +247 -0
  200. package/src/common/Intent/index.ts +16 -12
  201. package/src/common/utils/characters.ts +111 -0
  202. package/src/components/Accordion/accordion.scss +4 -3
  203. package/src/components/Application/ApplicationTitle.tsx +2 -2
  204. package/src/components/Application/_config.scss +1 -1
  205. package/src/components/Application/_content.scss +1 -1
  206. package/src/components/Application/_header.scss +2 -2
  207. package/src/components/Application/_sidebar.scss +2 -9
  208. package/src/components/Application/_toolbar.scss +1 -1
  209. package/src/components/Application/application.scss +4 -4
  210. package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +13 -8
  211. package/src/components/Badge/Badge.stories.tsx +47 -0
  212. package/src/components/Badge/Badge.tsx +93 -0
  213. package/src/components/Badge/badge.scss +44 -0
  214. package/src/components/Depiction/Depiction.tsx +198 -0
  215. package/src/components/Depiction/depiction.scss +176 -0
  216. package/src/components/Depiction/stories/Depiction.stories.tsx +69 -0
  217. package/src/components/Depiction/stories/test-16to9.png +0 -0
  218. package/src/components/Depiction/stories/test-16to9.svg +41 -0
  219. package/src/components/Depiction/stories/test-16to9.tobase64.svg +41 -0
  220. package/src/components/Depiction/stories/test-16to9.tsx +44 -0
  221. package/src/components/Depiction/stories/test-9to16.png +0 -0
  222. package/src/components/Depiction/stories/test-9to16.svg +44 -0
  223. package/src/components/Depiction/stories/test-9to16.tobase64.svg +44 -0
  224. package/src/components/Depiction/stories/test-9to16.tsx +48 -0
  225. package/src/components/Grid/Grid.tsx +22 -4
  226. package/src/components/Grid/GridColumn.tsx +24 -7
  227. package/src/components/Grid/GridRow.tsx +18 -3
  228. package/src/components/Grid/grid.scss +14 -13
  229. package/src/components/Grid/stories/Grid.stories.tsx +27 -0
  230. package/src/components/Grid/stories/GridColumn.stories.tsx +66 -0
  231. package/src/components/Grid/stories/GridRow.stories.tsx +47 -0
  232. package/src/components/Icon/BaseIcon.tsx +84 -0
  233. package/src/components/Icon/Icon.tsx +23 -82
  234. package/src/components/Icon/IconButton.tsx +18 -14
  235. package/src/components/Icon/TestIcon.tsx +39 -0
  236. package/src/components/Icon/canonicalIconNames.tsx +132 -633
  237. package/src/components/Icon/index.ts +5 -0
  238. package/src/components/Icon/stories/Icon.stories.tsx +13 -0
  239. package/src/components/Icon/stories/IconButton.stories.tsx +14 -7
  240. package/src/components/Icon/stories/TestIcon.stories.tsx +28 -0
  241. package/src/components/Link/link.scss +2 -1
  242. package/src/components/Menu/MenuItem.tsx +14 -4
  243. package/src/components/Menu/Stories/MenuItem.stories.tsx +16 -2
  244. package/src/components/MultiSelect/MultiSelect.tsx +58 -27
  245. package/src/components/Notification/Notification.stories.tsx +4 -0
  246. package/src/components/Notification/Notification.tsx +26 -6
  247. package/src/components/OverviewItem/OverviewItemDepiction.tsx +31 -0
  248. package/src/components/OverviewItem/overviewitem.scss +2 -1
  249. package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +22 -1
  250. package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +8 -3
  251. package/src/components/Pagination/pagination.scss +3 -2
  252. package/src/components/SimpleTable/simpletable.scss +11 -12
  253. package/src/components/Tag/Tag.stories.tsx +7 -2
  254. package/src/components/Tag/Tag.tsx +24 -4
  255. package/src/components/Tag/tag.scss +84 -3
  256. package/src/components/TagInput/taginput.scss +6 -0
  257. package/src/components/TextField/TextArea.tsx +10 -1
  258. package/src/components/TextField/TextField.tsx +9 -0
  259. package/src/components/TextField/stories/SearchField.stories.tsx +1 -1
  260. package/src/components/TextField/textfield.scss +12 -0
  261. package/src/components/TextField/useTextValidation.ts +103 -0
  262. package/src/components/Tooltip/tooltip.scss +1 -1
  263. package/src/components/Tree/Tree.stories.tsx +7 -1
  264. package/src/components/Tree/Tree.tsx +2 -1
  265. package/src/components/Typography/Highlighter.tsx +2 -2
  266. package/src/components/Typography/OverflowText.tsx +2 -2
  267. package/src/components/Typography/WhiteSpaceContainer.tsx +69 -21
  268. package/src/components/Typography/index.ts +25 -0
  269. package/src/components/Typography/stories/WhiteSpaceContainer.stories.tsx +55 -0
  270. package/src/components/Typography/typography.scss +3 -2
  271. package/src/components/Workspace/WorkspaceContent.tsx +1 -1
  272. package/src/components/index.scss +5 -0
  273. package/src/components/index.ts +5 -0
  274. package/src/extensions/react-flow/_config.scss +1 -0
  275. package/src/extensions/react-flow/edges/EdgeLabel.tsx +83 -0
  276. package/src/extensions/react-flow/edges/_edges.scss +77 -0
  277. package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +39 -0
  278. package/src/extensions/react-flow/handles/HandleDefault.tsx +38 -10
  279. package/src/extensions/react-flow/index.ts +1 -0
  280. package/src/extensions/react-flow/nodes/NodeContent.tsx +134 -55
  281. package/src/extensions/react-flow/nodes/NodeDefault.tsx +4 -2
  282. package/src/extensions/react-flow/nodes/_nodes.scss +56 -17
  283. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +37 -1
  284. package/src/extensions/react-flow/versionsupport.ts +22 -0
  285. package/src/includes/carbon-components/_components.scss +11 -0
  286. package/src/includes/carbon-components/_requisits.scss +18 -0
  287. package/src/includes/carbon-components/_variables.scss +50 -53
  288. package/src/index.scss +4 -105
  289. package/src/index.ts +6 -16
@@ -0,0 +1,25 @@
1
+ import Highlighter, { HighlighterProps } from "./Highlighter";
2
+ import { extractSearchWords, matchesAllWords, createMultiWordRegex } from "./Highlighter";
3
+ import HtmlContentBlock, { HtmlContentBlockProps } from "./HtmlContentBlock";
4
+ import OverflowText, { OverflowTextProps } from "./OverflowText";
5
+ import WhiteSpaceContainer, { WhiteSpaceContainerProps } from "./WhiteSpaceContainer";
6
+
7
+ export type {
8
+ HighlighterProps,
9
+ HtmlContentBlockProps,
10
+ OverflowTextProps,
11
+ WhiteSpaceContainerProps
12
+ };
13
+
14
+ export {
15
+ Highlighter,
16
+ HtmlContentBlock,
17
+ OverflowText,
18
+ WhiteSpaceContainer,
19
+ };
20
+
21
+ export const HighlighterFunctions = {
22
+ extractSearchWords,
23
+ matchesAllWords,
24
+ createMultiWordRegex,
25
+ };
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { loremIpsum } from "react-lorem-ipsum";
4
+ import { WhiteSpaceContainer as WhiteSpaceContainerElement } from "../../../index";
5
+
6
+ const whiteSpaceSizeOptions = {
7
+ control: "select",
8
+ options: {
9
+ "not set": undefined,
10
+ "tiny": "tiny",
11
+ "small": "small",
12
+ "regular": "regular",
13
+ "large": "large",
14
+ "xlarge": "xlarge"
15
+ }
16
+ }
17
+
18
+ export default {
19
+ title: "Components/Typography",
20
+ component: WhiteSpaceContainerElement,
21
+ argTypes: {
22
+ children: { control: "none" },
23
+ marginTop: {...whiteSpaceSizeOptions},
24
+ marginRight: {...whiteSpaceSizeOptions},
25
+ marginBottom: {...whiteSpaceSizeOptions},
26
+ marginLeft: {...whiteSpaceSizeOptions},
27
+ paddingTop: {...whiteSpaceSizeOptions},
28
+ paddingRight: {...whiteSpaceSizeOptions},
29
+ paddingBottom: {...whiteSpaceSizeOptions},
30
+ paddingLeft: {...whiteSpaceSizeOptions},
31
+ },
32
+ } as ComponentMeta<typeof WhiteSpaceContainerElement>;
33
+
34
+ const Template: ComponentStory<typeof WhiteSpaceContainerElement> = (args) => (
35
+ <WhiteSpaceContainerElement {...args} style={{background: "#eee"}}/>
36
+ );
37
+
38
+ const testContent = loremIpsum({
39
+ p: 2,
40
+ avgSentencesPerParagraph: 4,
41
+ random: false
42
+ }).toString()
43
+
44
+ export const WhiteSpaceContainer = Template.bind({});
45
+ WhiteSpaceContainer.args = {
46
+ children: [
47
+ <p>{ testContent }</p>,
48
+ <p><strong>{ testContent.replaceAll(" ", "") }</strong></p>,
49
+ <p>{ testContent }</p>
50
+ ],
51
+ paddingTop: "tiny",
52
+ paddingRight: "small",
53
+ paddingBottom: "regular",
54
+ paddingLeft: "large",
55
+ }
@@ -205,7 +205,7 @@ table {
205
205
  .#{$eccgui}-typography__overflowtext--passdown * {
206
206
  overflow: hidden;
207
207
  text-overflow: ellipsis;
208
- word-wrap: normal;
208
+ overflow-wrap: normal;
209
209
  white-space: nowrap;
210
210
  // display: inherit;
211
211
  max-width: 100%;
@@ -254,7 +254,8 @@ table {
254
254
  }
255
255
 
256
256
  .#{$eccgui}-typography--forcelinebreak {
257
- word-break: break-all;
257
+ word-break: normal;
258
+ overflow-wrap: anywhere;
258
259
  }
259
260
 
260
261
  .#{$eccgui}-typography--preventlinebreak {
@@ -12,7 +12,7 @@ function WorkspaceContent({ children, className = '', ...restProps }: any) {
12
12
  className={`${eccgui}-workspace__content ` + className}
13
13
  fullWidth={true}
14
14
  >
15
- <GridRow>
15
+ <GridRow dontWrapColumns={false}>
16
16
  { children }
17
17
  </GridRow>
18
18
  </Grid>
@@ -0,0 +1,5 @@
1
+ @import "./Badge/badge";
2
+ @import "./Depiction/depiction";
3
+ @import "./Icon/icon";
4
+ @import "./Tree/tree";
5
+ @import "./Typography/typography";
@@ -0,0 +1,5 @@
1
+ export * from "./Badge/Badge";
2
+ export * from "./Depiction/Depiction";
3
+ export * from "./Icon";
4
+ export * from "./Tree/Tree";
5
+ export * from "./Typography";
@@ -1,4 +1,5 @@
1
1
  $reactflow-node-basesize: $button-height !default;
2
+ $reactflow-node-largesize: mini-units(6) !default;
2
3
  $reactflow-node-border-color: $eccgui-color-workspace-text !default;
3
4
  $reactflow-node-background-color: $button-background-color !default;
4
5
  $reactflow-node-color: $eccgui-color-workspace-text !default;
@@ -0,0 +1,83 @@
1
+ import React, { memo } from "react";
2
+ import { Icon, Depiction, DepictionProps, OverflowText } from "../../../index";
3
+ import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
4
+ import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
5
+ import { IntentTypes, intentClassName } from "../../../common/Intent";
6
+
7
+ export interface EdgeLabelProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ /**
9
+ * Depiction element displayed left from the label.
10
+ */
11
+ depiction?: ValidIconName | React.ReactElement<DepictionProps>;
12
+ /**
13
+ * Label of the edge.
14
+ * Cannot overflow the parent container.
15
+ */
16
+ text: string | JSX.Element;
17
+ /**
18
+ * One or multiple other elements displayed right from label.
19
+ */
20
+ actions?: JSX.Element | JSX.Element[];
21
+ /**
22
+ * The element is increased in its size.
23
+ */
24
+ large?: boolean;
25
+ /**
26
+ * Stretches the label component to the full available width.
27
+ */
28
+ fullWidth?: boolean;
29
+ /**
30
+ * Add a info state to the label, visualized by color.
31
+ */
32
+ intent?: IntentTypes;
33
+ }
34
+
35
+ export const EdgeLabel = memo(({
36
+ depiction,
37
+ text,
38
+ actions,
39
+ large,
40
+ fullWidth,
41
+ intent,
42
+ ...otherDivProps
43
+ } : EdgeLabelProps) => {
44
+
45
+ const depEl = (!!depiction && typeof depiction === "string")
46
+ ? <Depiction image={<Icon name={depiction as ValidIconName} />} />
47
+ : depiction;
48
+
49
+ return (
50
+ <div
51
+ className={
52
+ `${eccgui}-graphviz__edge-label` +
53
+ (large ? ` ${eccgui}-graphviz__edge-label--large` : "") +
54
+ (fullWidth ? ` ${eccgui}-graphviz__edge-label--fullwidth` : "") +
55
+ (!!intent ? ` ${intentClassName(intent)}` : '')
56
+ }
57
+ {...otherDivProps}
58
+ >
59
+ {!!depEl && (
60
+ <div className={`${eccgui}-graphviz__edge-label__depiction`}>
61
+ {
62
+ React.cloneElement(depEl, {
63
+ padding: "tiny",
64
+ ratio: "1:1",
65
+ resizing: "contain",
66
+ forceInlineSvg: true,
67
+ border: false,
68
+ backgroundColor: undefined,
69
+ })
70
+ }
71
+ </div>
72
+ )}
73
+ <div className={`${eccgui}-graphviz__edge-label__text`}>
74
+ { typeof text === "string" ? <OverflowText>{ text }</OverflowText> : text }
75
+ </div>
76
+ {!!actions && (
77
+ <div className={`${eccgui}-graphviz__edge-label__aux`}>
78
+ { actions }
79
+ </div>
80
+ )}
81
+ </div>
82
+ )
83
+ });
@@ -154,3 +154,80 @@ path.react-flow__edge-path-glow {
154
154
  transform: scale(1.75, 0.75);
155
155
  }
156
156
  }
157
+
158
+ // Custom label
159
+
160
+ .#{$eccgui}-graphviz__edge-label {
161
+ border: 0.5*$reactflow-node-border-width solid $reactflow-node-border-color;
162
+ border-radius: $reactflow-node-border-radius;
163
+ background: #fff; // TODO color
164
+ color: $reactflow-node-color;
165
+ display: inline-flex;
166
+ align-items: center;
167
+ width: auto;
168
+ max-width: 20rem;
169
+ height: 0.5 * $reactflow-node-largesize;
170
+ font-size: $reactflow-node-font-size;
171
+
172
+ &.#{$eccgui}-intent--primary {
173
+ color: $eccgui-color-primary;
174
+ border-color: $eccgui-color-primary;
175
+ }
176
+ &.#{$eccgui}-intent--accent {
177
+ color: $eccgui-color-accent;
178
+ border-color: $eccgui-color-accent;
179
+ }
180
+ &.#{$eccgui}-intent--success {
181
+ color: $eccgui-color-success-text;
182
+ border-color: $eccgui-color-success-text;
183
+ }
184
+ &.#{$eccgui}-intent--info {
185
+ color: $eccgui-color-info-text;
186
+ border-color: $eccgui-color-info-text;
187
+ }
188
+ &.#{$eccgui}-intent--warning {
189
+ color: $eccgui-color-warning-text;
190
+ border-color: $eccgui-color-warning-text;
191
+ }
192
+ &.#{$eccgui}-intent--danger {
193
+ color: $eccgui-color-danger-text;
194
+ border-color: $eccgui-color-danger-text;
195
+ }
196
+ }
197
+ .#{$eccgui}-graphviz__edge-label--large {
198
+ height: $reactflow-node-largesize;
199
+ }
200
+ .#{$eccgui}-graphviz__edge-label--fullwidth {
201
+ max-width: none;
202
+ width: 100%;
203
+ }
204
+ .#{$eccgui}-graphviz__edge-label__depiction {
205
+ margin: $eccgui-size-block-whitespace * 0.25;
206
+ flex-grow: 0;
207
+ flex-shrink: 0;
208
+ .#{$eccgui}-depiction__image {
209
+ height: calc(#{0.5 * $reactflow-node-largesize} - #{$eccgui-size-block-whitespace * 0.25});
210
+
211
+ .#{$eccgui}-graphviz__edge-label--large & {
212
+ height: calc(#{$reactflow-node-largesize} - #{$eccgui-size-block-whitespace * 0.25});
213
+ }
214
+ }
215
+ }
216
+ .#{$eccgui}-graphviz__edge-label__text {
217
+ margin: $eccgui-size-block-whitespace * 0.25;
218
+ flex-grow: 1;
219
+ flex-shrink: 1;
220
+ white-space: nowrap;
221
+ overflow: hidden;
222
+ text-overflow: ellipsis;
223
+ text-align: center;
224
+
225
+ .#{$eccgui}-graphviz__edge-label--fullwidth & {
226
+ text-align: left;
227
+ }
228
+ }
229
+ .#{$eccgui}-graphviz__edge-label__aux {
230
+ margin: $eccgui-size-block-whitespace * 0.25;
231
+ flex-grow: 0;
232
+ flex-shrink: 0;
233
+ }
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { loremIpsum } from 'react-lorem-ipsum';
4
+ import { EdgeLabel, IconButton, Badge } from "./../../../../../index";
5
+ import canonicalIcons from "./../../../../components/Icon/canonicalIconNames";
6
+ import { helpersArgTypes } from "../../../../../.storybook/helpers";
7
+
8
+ export default {
9
+ title: "Extensions/React Flow/Custom EdgeLabel",
10
+ component: EdgeLabel,
11
+ argTypes: {
12
+ depiction: {
13
+ control: "select",
14
+ options: [...(Object.keys(canonicalIcons))],
15
+ },
16
+ actions: {
17
+ control: "select",
18
+ options: ["Not set", "Icon button", "Icon button small", "Info badge"],
19
+ mapping: {
20
+ "Not set": undefined,
21
+ "Icon button": <IconButton name="item-info" text="Icon button" onClick={()=>alert("Click info")} />,
22
+ "Icon button small": <IconButton small name="item-info" text="Icon button" onClick={()=>alert("Click info")} />,
23
+ "Info badge": <Badge intent="info">Info</Badge>,
24
+ },
25
+ },
26
+ intent: {
27
+ ...helpersArgTypes.exampleIntent,
28
+ },
29
+ },
30
+ } as ComponentMeta<typeof EdgeLabel>;
31
+
32
+ const Template: ComponentStory<typeof EdgeLabel> = (args) => (
33
+ <EdgeLabel {...args} />
34
+ );
35
+
36
+ export const Default = Template.bind({});
37
+ Default.args = {
38
+ text: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 8, random: false }).toString(),
39
+ };
@@ -1,29 +1,57 @@
1
1
  import React, {memo} from 'react';
2
2
  import {
3
- HandleProps as ReactFlowHandleProps,
4
- Handle,
3
+ HandleProps as ReactFlowHandleLegacyProps,
4
+ Handle as HandleLegacy,
5
5
  } from "react-flow-renderer";
6
+ import {
7
+ HandleProps as ReactFlowHandleNextProps,
8
+ Handle as HandleNext,
9
+ } from "react-flow-renderer-lts";
6
10
  import { HandleContent, HandleContentProps } from "./HandleContent";
11
+ import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
7
12
 
8
- export interface HandleProps extends ReactFlowHandleProps {
13
+ interface HandleExtensionProps extends ReacFlowVersionSupportProps {
9
14
  data?: HandleContentProps;
10
15
  tooltip?: string;
11
16
  children?: JSX.Element | string;
17
+ onClick?: () => void;
18
+ }
19
+
20
+ export interface HandleProps extends HandleExtensionProps, ReactFlowHandleLegacyProps {
21
+ }
22
+
23
+ export interface HandleNextProps extends HandleExtensionProps, ReactFlowHandleNextProps {
12
24
  }
13
25
 
14
26
  export const HandleDefault = memo(({
27
+ flowVersion = useReactFlowVersion(),
15
28
  data,
16
29
  tooltip,
17
30
  children,
18
31
  ...handleProps
19
- }: HandleProps) => {
32
+ }: HandleProps | HandleNextProps) => {
20
33
  const tooltipTitle = !!tooltip ? { title: tooltip } : {};
21
34
 
22
- return (
23
- <Handle {...handleProps} {...tooltipTitle}>
24
- <HandleContent {...data}>
25
- { children }
26
- </HandleContent>
27
- </Handle>
35
+ const handleContent = (
36
+ <HandleContent {...data}>
37
+ { children }
38
+ </HandleContent>
28
39
  );
40
+
41
+ switch (flowVersion) {
42
+ case "legacy":
43
+ return (
44
+ <HandleLegacy {...handleProps} {...tooltipTitle}>
45
+ { handleContent }
46
+ </HandleLegacy>
47
+ );
48
+ case "next":
49
+ return (
50
+ <HandleNext {...handleProps} {...tooltipTitle}>
51
+ { handleContent }
52
+ </HandleNext>
53
+ );
54
+ default:
55
+ return <></>;
56
+ }
29
57
  });
@@ -7,6 +7,7 @@ export { EdgeDefault } from "./edges/EdgeDefault";
7
7
  export { EdgeStep } from "./edges/EdgeStep";
8
8
  export { EdgeTools } from "./edges/EdgeTools";
9
9
  export { edgeTypes } from "./edges/edgeTypes";
10
+ export * from "./edges/EdgeLabel";
10
11
  export { MarkerArrowClosedInverse } from "./markers/MarkerArrowClosedInverse";
11
12
  export { ReactFlowMarkers } from "./markers/ReactFlowMarkers";
12
13
  export { MiniMap } from "./minimap/MiniMap";