@eccenca/gui-elements 24.4.1-featurepreparefinalnextcmem6943.2 → 25.0.0-bugfixcenterednodecontentmenuitemscmem7184.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.
- package/CHANGELOG.md +93 -19
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js +1 -0
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +34 -11
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/markdown/Markdown.js +1 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +1 -1
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/index.js +4 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/reduceToText.js +94 -0
- package/dist/cjs/common/utils/reduceToText.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationViewability.js +33 -0
- package/dist/cjs/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/cjs/components/Application/index.js +1 -0
- package/dist/cjs/components/Application/index.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +2 -2
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js +65 -18
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +15 -3
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/ModalContext.js +51 -0
- package/dist/cjs/components/Dialog/ModalContext.js.map +1 -0
- package/dist/cjs/components/Dialog/index.js +1 -0
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +25 -2
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +2 -1
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/TextReducer/TextReducer.js +17 -63
- package/dist/cjs/components/TextReducer/TextReducer.js.map +1 -1
- package/dist/cjs/components/Typography/InlineText.js +29 -0
- package/dist/cjs/components/Typography/InlineText.js.map +1 -0
- package/dist/cjs/components/Typography/index.js +1 -0
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +2 -2
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js +2 -2
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +2 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js +1 -0
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +32 -9
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -2
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/esm/common/Intent/index.js +1 -1
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/index.js +4 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/reduceToText.js +75 -0
- package/dist/esm/common/utils/reduceToText.js.map +1 -0
- package/dist/esm/components/Application/ApplicationViewability.js +28 -0
- package/dist/esm/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/esm/components/Application/index.js +1 -0
- package/dist/esm/components/Application/index.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +2 -2
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextOverlay.js +69 -22
- package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/esm/components/Dialog/Modal.js +15 -3
- package/dist/esm/components/Dialog/Modal.js.map +1 -1
- package/dist/esm/components/Dialog/ModalContext.js +69 -0
- package/dist/esm/components/Dialog/ModalContext.js.map +1 -0
- package/dist/esm/components/Dialog/index.js +1 -0
- package/dist/esm/components/Dialog/index.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +25 -2
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +2 -1
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/TextReducer/TextReducer.js +17 -41
- package/dist/esm/components/TextReducer/TextReducer.js.map +1 -1
- package/dist/esm/components/Typography/InlineText.js +33 -0
- package/dist/esm/components/Typography/InlineText.js.map +1 -0
- package/dist/esm/components/Typography/index.js +1 -0
- package/dist/esm/components/Typography/index.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +3 -3
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js +3 -3
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +2 -2
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/types/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +26 -10
- package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +1 -1
- package/dist/types/common/index.d.ts +3 -0
- package/dist/types/common/utils/reduceToText.d.ts +10 -0
- package/dist/types/components/Application/ApplicationViewability.d.ts +36 -0
- package/dist/types/components/Application/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +14 -7
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +1 -1
- package/dist/types/components/Dialog/Modal.d.ts +9 -1
- package/dist/types/components/Dialog/ModalContext.d.ts +13 -0
- package/dist/types/components/Dialog/index.d.ts +1 -0
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +23 -0
- package/dist/types/components/Spinner/Spinner.d.ts +11 -4
- package/dist/types/components/Structure/TitleSubsection.d.ts +1 -1
- package/dist/types/components/Tabs/Tab.d.ts +4 -4
- package/dist/types/components/TextReducer/TextReducer.d.ts +13 -1
- package/dist/types/components/Typography/InlineText.d.ts +13 -0
- package/dist/types/components/Typography/index.d.ts +1 -0
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +1 -1
- package/dist/types/extensions/codemirror/tests/codemirrorTestHelper.d.ts +1 -1
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +1 -1
- package/package.json +54 -53
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +1 -1
- package/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +1 -1
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +65 -17
- package/src/cmem/ContentBlobToggler/stories/StringPreviewContentBlobToggler.stories.tsx +27 -0
- package/src/cmem/ContentBlobToggler/tests/StringPreviewContentBlobToggler.test.tsx +98 -0
- package/src/cmem/markdown/Markdown.tsx +1 -2
- package/src/cmem/react-flow/ReactFlow/ReactFlowV12.tsx +1 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +1 -1
- package/src/cmem/react-flow/_minimap.scss +10 -0
- package/src/cmem/react-flow/configuration/_colors-graph.scss +12 -12
- package/src/cmem/react-flow/configuration/_colors-linking.scss +8 -8
- package/src/cmem/react-flow/configuration/_colors-workflow.scss +11 -11
- package/src/common/Intent/index.ts +2 -1
- package/src/common/index.ts +6 -0
- package/src/common/scss/_color-functions.scss +5 -0
- package/src/common/utils/reduceToText.tsx +82 -0
- package/src/components/Application/ApplicationViewability.tsx +61 -0
- package/src/components/Application/_content.scss +7 -0
- package/src/components/Application/_header.scss +12 -3
- package/src/components/Application/_viewability.scss +13 -0
- package/src/components/Application/application.scss +1 -0
- package/src/components/Application/index.ts +1 -0
- package/src/components/Application/stories/ApplicationViewability.stories.tsx +37 -0
- package/src/components/Application/tests/ApplicationViewability.test.tsx +43 -0
- package/src/components/AutoSuggestion/tests/ExtendedCodeEditor.test.tsx +1 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +1 -0
- package/src/components/Button/Button.stories.tsx +7 -1
- package/src/components/Button/Button.tsx +16 -9
- package/src/components/Button/button.scss +86 -24
- package/src/components/Card/card.scss +6 -0
- package/src/components/Chat/stories/ChatField.stories.tsx +6 -1
- package/src/components/Checkbox/checkbox.scss +14 -2
- package/src/components/ContentGroup/_contentgroup.scss +9 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +4 -1
- package/src/components/ContextOverlay/ContextOverlay.tsx +77 -18
- package/src/components/ContextOverlay/tests/ContextMenu.test.tsx +43 -0
- package/src/components/ContextOverlay/tests/ContextOverlay.test.tsx +71 -0
- package/src/components/Depiction/depiction.scss +6 -0
- package/src/components/Dialog/Modal.tsx +28 -3
- package/src/components/Dialog/ModalContext.tsx +56 -0
- package/src/components/Dialog/index.ts +1 -0
- package/src/components/Dialog/stories/Modal.stories.tsx +10 -7
- package/src/components/Dialog/stories/ModalContext.stories.tsx +153 -0
- package/src/components/FlexibleLayout/flexiblelayout.scss +16 -0
- package/src/components/Grid/grid.scss +17 -0
- package/src/components/Grid/stories/Grid.stories.tsx +10 -7
- package/src/components/Grid/stories/GridRow.stories.tsx +13 -7
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +25 -2
- package/src/components/Icon/icon.scss +6 -0
- package/src/components/Icon/stories/Icon.stories.tsx +65 -5
- package/src/components/Icon/stories/IconButton.stories.tsx +2 -1
- package/src/components/Notification/Notification.stories.tsx +20 -6
- package/src/components/Notification/notification.scss +14 -3
- package/src/components/OverviewItem/overviewitem.scss +9 -0
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +28 -0
- package/src/components/OverviewItem/stories/OverviewItemActions.stories.tsx +2 -2
- package/src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx +1 -1
- package/src/components/OverviewItem/stories/OverviewItemLine.stories.tsx +1 -1
- package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +7 -1
- package/src/components/PropertyValuePair/propertyvalue.scss +23 -1
- package/src/components/Select/Select.stories.tsx +1 -1
- package/src/components/Separation/separation.scss +6 -0
- package/src/components/Spinner/Spinner.tsx +13 -3
- package/src/components/Spinner/Stories/spinner.stories.tsx +1 -1
- package/src/components/Spinner/spinner.scss +5 -1
- package/src/components/Table/table.scss +22 -0
- package/src/components/Tag/stories/TagList.stories.tsx +2 -2
- package/src/components/Tag/tag.scss +105 -74
- package/src/components/TextField/textfield.scss +23 -15
- package/src/components/TextReducer/TextReducer.stories.tsx +2 -1
- package/src/components/TextReducer/TextReducer.test.tsx +44 -0
- package/src/components/TextReducer/TextReducer.tsx +17 -44
- package/src/components/Typography/InlineText.tsx +24 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/stories/InlineText.stories.tsx +27 -0
- package/src/components/Typography/typography.scss +23 -2
- package/src/components/VisualTour/stories/VisualTour.stories.tsx +1 -1
- package/src/configuration/_palettes.scss +2 -1
- package/src/extensions/codemirror/CodeMirror.tsx +4 -4
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +1 -2
- package/src/extensions/codemirror/tests/codemirrorTestHelper.ts +3 -3
- package/src/extensions/react-flow/_config.scss +8 -3
- package/src/extensions/react-flow/_react-flow_v12.scss +10 -14
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +1 -1
- package/src/extensions/react-flow/edges/EdgeNew.tsx +2 -1
- package/src/extensions/react-flow/edges/_edges.scss +15 -7
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +5 -5
- package/src/extensions/react-flow/handles/HandleDefault.tsx +2 -2
- package/src/extensions/react-flow/minimap/MiniMap.tsx +2 -1
- package/src/extensions/react-flow/minimap/MiniMapV12.tsx +1 -1
- package/src/extensions/react-flow/nodes/NodeContent.tsx +2 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +4 -3
- package/src/extensions/react-flow/nodes/nodeUtils.tsx +1 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +2 -2
|
@@ -7,19 +7,21 @@ $eccgui-size-margin-tag: $eccgui-size-inline-whitespace * 0.5 !default;
|
|
|
7
7
|
$eccgui-color-tag-background-emphasized: $eccgui-color-workspace-text !default;
|
|
8
8
|
|
|
9
9
|
// lib vars
|
|
10
|
-
$tag-default-color: $eccgui-color-tag-background-emphasized;
|
|
10
|
+
$tag-default-color: $eccgui-color-tag-background-emphasized;
|
|
11
|
+
|
|
11
12
|
// $dark-tag-default-color: $gray5 !default;
|
|
12
|
-
$tag-height: $eccgui-size-typo-tag * $eccgui-size-typo-tag-lineheight;
|
|
13
|
-
$tag-line-height: $eccgui-size-typo-tag;
|
|
14
|
-
$tag-padding-top: ($tag-height - $tag-line-height) * 0.5;
|
|
15
|
-
$tag-padding: $tag-padding-top * 2;
|
|
16
|
-
$tag-margin: 0;
|
|
17
|
-
$tag-height-small: $eccgui-size-typo-tag;
|
|
18
|
-
$tag-line-height-small: $tag-height-small;
|
|
19
|
-
$tag-padding-small: $tag-padding-top * 0.5;
|
|
20
|
-
$tag-height-large: $eccgui-size-typo-tag-large * $eccgui-size-typo-tag-large-lineheight;
|
|
21
|
-
$tag-line-height-large: $eccgui-size-typo-tag-large;
|
|
22
|
-
$tag-padding-large: ($tag-height-large - $tag-line-height-large);
|
|
13
|
+
$tag-height: $eccgui-size-typo-tag * $eccgui-size-typo-tag-lineheight;
|
|
14
|
+
$tag-line-height: $eccgui-size-typo-tag;
|
|
15
|
+
$tag-padding-top: ($tag-height - $tag-line-height) * 0.5;
|
|
16
|
+
$tag-padding: $tag-padding-top * 2;
|
|
17
|
+
$tag-margin: 0;
|
|
18
|
+
$tag-height-small: $eccgui-size-typo-tag;
|
|
19
|
+
$tag-line-height-small: $tag-height-small;
|
|
20
|
+
$tag-padding-small: $tag-padding-top * 0.5;
|
|
21
|
+
$tag-height-large: $eccgui-size-typo-tag-large * $eccgui-size-typo-tag-large-lineheight;
|
|
22
|
+
$tag-line-height-large: $eccgui-size-typo-tag-large;
|
|
23
|
+
$tag-padding-large: ($tag-height-large - $tag-line-height-large);
|
|
24
|
+
|
|
23
25
|
// $tag-icon-spacing: ($tag-height - 12px) * 0.5 !default;
|
|
24
26
|
// $tag-icon-spacing-large: ($tag-height-large - $pt-icon-size-standard) * 0.5 !default;
|
|
25
27
|
$tag-round-adjustment: 0 !default;
|
|
@@ -28,12 +30,15 @@ $tag-round-adjustment: 0 !default;
|
|
|
28
30
|
@import "~@blueprintjs/core/src/components/tag/tag";
|
|
29
31
|
|
|
30
32
|
.#{$eccgui}-tag__item {
|
|
33
|
+
--eccgui-tag-border-width: 1px;
|
|
34
|
+
|
|
31
35
|
flex-grow: 0;
|
|
32
36
|
flex-shrink: 0;
|
|
33
37
|
min-width: calc(#{$tag-height} - 2px);
|
|
34
38
|
min-height: calc(#{$tag-height} - 2px);
|
|
35
39
|
max-height: calc(#{$tag-height} - 2px);
|
|
36
40
|
padding: 0 $tag-padding-top;
|
|
41
|
+
line-height: calc(#{$tag-height} - 2px);
|
|
37
42
|
|
|
38
43
|
&.#{$ns}-round {
|
|
39
44
|
border-radius: $tag-height * 0.5;
|
|
@@ -53,11 +58,12 @@ $tag-round-adjustment: 0 !default;
|
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
&.#{$eccgui}-tag--small {
|
|
56
|
-
min-width: calc(#{$tag-height-small} + #{$tag-padding-small}
|
|
57
|
-
min-height: calc(#{$tag-height-small} + #{$tag-padding-small}
|
|
58
|
-
max-height: calc(#{$tag-height-small} + #{$tag-padding-small}
|
|
61
|
+
min-width: calc(#{$tag-height-small} + #{$tag-padding-small});
|
|
62
|
+
min-height: calc(#{$tag-height-small} + #{$tag-padding-small});
|
|
63
|
+
max-height: calc(#{$tag-height-small} + #{$tag-padding-small});
|
|
59
64
|
padding: 0 $tag-padding-small;
|
|
60
|
-
|
|
65
|
+
font-size: calc(#{$eccgui-size-typo-tag} - 1px);
|
|
66
|
+
line-height: calc(#{$tag-height-small} + #{$tag-padding-small});
|
|
61
67
|
|
|
62
68
|
&.#{$ns}-round {
|
|
63
69
|
border-radius: $tag-height-small * 0.5;
|
|
@@ -73,7 +79,7 @@ $tag-round-adjustment: 0 !default;
|
|
|
73
79
|
min-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
|
|
74
80
|
max-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
|
|
75
81
|
font-size: $eccgui-size-typo-tag-large;
|
|
76
|
-
line-height: calc(#{$tag-height-large} - 2px);
|
|
82
|
+
line-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
|
|
77
83
|
|
|
78
84
|
&.#{$ns}-round {
|
|
79
85
|
border-radius: $tag-height-large * 0.5;
|
|
@@ -136,113 +142,138 @@ $tag-round-adjustment: 0 !default;
|
|
|
136
142
|
|
|
137
143
|
.#{$ns}-tag {
|
|
138
144
|
border-style: solid;
|
|
139
|
-
border-width:
|
|
145
|
+
border-width: var(--eccgui-tag-border-width);
|
|
140
146
|
|
|
141
147
|
&:not([class*="#{$ns}-intent-"]) {
|
|
148
|
+
--eccgui-tag-bg: #{$tag-default-color};
|
|
149
|
+
--eccgui-tag-border: #{$tag-default-color};
|
|
150
|
+
--eccgui-tag-text: #{eccgui-color-var("identity", "text", "100")};
|
|
151
|
+
--eccgui-tag-emfactor: 100%;
|
|
152
|
+
|
|
153
|
+
color: var(--eccgui-tag-text);
|
|
154
|
+
background-color: eccgui-color-mix(
|
|
155
|
+
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
|
|
156
|
+
eccgui-color-var("identity", "background", "100")
|
|
157
|
+
);
|
|
158
|
+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
|
|
159
|
+
|
|
142
160
|
&.#{$eccgui}-tag--strongeremphasis {
|
|
143
|
-
|
|
144
|
-
border-color: $tag-default-color;
|
|
161
|
+
--eccgui-tag-emfactor: 95%;
|
|
145
162
|
}
|
|
146
163
|
&.#{$eccgui}-tag--strongemphasis {
|
|
147
|
-
|
|
148
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.875);
|
|
164
|
+
--eccgui-tag-emfactor: 90%;
|
|
149
165
|
}
|
|
150
166
|
&.#{$eccgui}-tag--normalemphasis {
|
|
151
|
-
|
|
152
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.75);
|
|
167
|
+
--eccgui-tag-emfactor: 85%;
|
|
153
168
|
}
|
|
154
169
|
&.#{$eccgui}-tag--weakemphasis {
|
|
155
|
-
|
|
156
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.625);
|
|
170
|
+
--eccgui-tag-emfactor: 80%;
|
|
157
171
|
}
|
|
158
172
|
&.#{$eccgui}-tag--weakeremphasis {
|
|
159
|
-
|
|
160
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.5);
|
|
173
|
+
--eccgui-tag-emfactor: 75%;
|
|
161
174
|
}
|
|
162
175
|
|
|
163
176
|
&.#{$eccgui}-intent--primary {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
177
|
+
--eccgui-tag-bg: #{$eccgui-color-primary};
|
|
178
|
+
--eccgui-tag-border: #{$eccgui-color-primary};
|
|
179
|
+
--eccgui-tag-text: #{$eccgui-color-primary-contrast};
|
|
167
180
|
}
|
|
168
181
|
&.#{$eccgui}-intent--accent {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
182
|
+
--eccgui-tag-bg: #{$eccgui-color-accent};
|
|
183
|
+
--eccgui-tag-border: #{$eccgui-color-accent};
|
|
184
|
+
--eccgui-tag-text: #{$eccgui-color-accent-contrast};
|
|
172
185
|
}
|
|
173
186
|
&.#{$eccgui}-intent--info {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
187
|
+
--eccgui-tag-bg: #{$eccgui-color-info-text};
|
|
188
|
+
--eccgui-tag-border: #{$eccgui-color-info-text};
|
|
189
|
+
--eccgui-tag-text: #{$eccgui-color-info-background};
|
|
177
190
|
}
|
|
178
191
|
&.#{$eccgui}-intent--success {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
192
|
+
--eccgui-tag-bg: #{$eccgui-color-success-text};
|
|
193
|
+
--eccgui-tag-border: #{$eccgui-color-success-text};
|
|
194
|
+
--eccgui-tag-text: #{$eccgui-color-success-background};
|
|
182
195
|
}
|
|
183
196
|
&.#{$eccgui}-intent--warning {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
197
|
+
--eccgui-tag-bg: #{$eccgui-color-warning-text};
|
|
198
|
+
--eccgui-tag-border: #{$eccgui-color-warning-text};
|
|
199
|
+
--eccgui-tag-text: #{$eccgui-color-warning-background};
|
|
187
200
|
}
|
|
188
201
|
&.#{$eccgui}-intent--danger {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
202
|
+
--eccgui-tag-bg: #{$eccgui-color-danger-text};
|
|
203
|
+
--eccgui-tag-border: #{$eccgui-color-danger-text};
|
|
204
|
+
--eccgui-tag-text: #{$eccgui-color-danger-background};
|
|
192
205
|
}
|
|
193
206
|
|
|
194
207
|
&.#{$ns}-minimal,
|
|
195
208
|
&.#{$ns}-minimal.#{$ns}-interactive {
|
|
209
|
+
--eccgui-tag-bg: #{eccgui-color-var("identity", "background", "500")};
|
|
210
|
+
--eccgui-tag-border: #{$tag-default-color};
|
|
211
|
+
--eccgui-tag-text: #{$tag-default-color};
|
|
212
|
+
|
|
213
|
+
color: var(--eccgui-tag-text);
|
|
214
|
+
background-color: eccgui-color-mix(
|
|
215
|
+
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
|
|
216
|
+
eccgui-color-var("identity", "background", "100")
|
|
217
|
+
);
|
|
218
|
+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
|
|
219
|
+
|
|
196
220
|
&.#{$eccgui}-tag--strongeremphasis {
|
|
197
|
-
|
|
198
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.3);
|
|
221
|
+
--eccgui-tag-emfactor: 100%;
|
|
199
222
|
}
|
|
200
223
|
&.#{$eccgui}-tag--strongemphasis {
|
|
201
|
-
|
|
202
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.225);
|
|
224
|
+
--eccgui-tag-emfactor: 90%;
|
|
203
225
|
}
|
|
204
226
|
&.#{$eccgui}-tag--normalemphasis {
|
|
205
|
-
|
|
206
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.15);
|
|
227
|
+
--eccgui-tag-emfactor: 80%;
|
|
207
228
|
}
|
|
208
229
|
&.#{$eccgui}-tag--weakemphasis {
|
|
209
|
-
|
|
210
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.075);
|
|
230
|
+
--eccgui-tag-emfactor: 70%;
|
|
211
231
|
}
|
|
212
232
|
&.#{$eccgui}-tag--weakeremphasis {
|
|
213
|
-
|
|
214
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.15);
|
|
233
|
+
--eccgui-tag-emfactor: 60%;
|
|
215
234
|
}
|
|
235
|
+
|
|
236
|
+
&[class*="#{$eccgui}-intent--"] {
|
|
237
|
+
color: eccgui-color-rgba(var(--eccgui-tag-text), var(--eccgui-tag-emfactor));
|
|
238
|
+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
|
|
239
|
+
}
|
|
240
|
+
|
|
216
241
|
&.#{$eccgui}-intent--primary {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
242
|
+
--eccgui-tag-text: #{$eccgui-color-primary};
|
|
243
|
+
--eccgui-tag-border: #{$eccgui-color-primary};
|
|
244
|
+
--eccgui-tag-bg: #{$eccgui-color-primary-contrast};
|
|
220
245
|
}
|
|
221
246
|
&.#{$eccgui}-intent--accent {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
247
|
+
--eccgui-tag-text: #{$eccgui-color-accent};
|
|
248
|
+
--eccgui-tag-border: #{$eccgui-color-accent};
|
|
249
|
+
--eccgui-tag-bg: #{$eccgui-color-accent-contrast};
|
|
225
250
|
}
|
|
226
251
|
&.#{$eccgui}-intent--info {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
252
|
+
--eccgui-tag-text: #{$eccgui-color-info-text};
|
|
253
|
+
--eccgui-tag-border: #{$eccgui-color-info-text};
|
|
254
|
+
--eccgui-tag-bg: #{$eccgui-color-info-background};
|
|
230
255
|
}
|
|
231
256
|
&.#{$eccgui}-intent--success {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
257
|
+
--eccgui-tag-text: #{$eccgui-color-success-text};
|
|
258
|
+
--eccgui-tag-border: #{$eccgui-color-success-text};
|
|
259
|
+
--eccgui-tag-bg: #{$eccgui-color-success-background};
|
|
235
260
|
}
|
|
236
261
|
&.#{$eccgui}-intent--warning {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
262
|
+
--eccgui-tag-text: #{$eccgui-color-warning-text};
|
|
263
|
+
--eccgui-tag-border: #{$eccgui-color-warning-text};
|
|
264
|
+
--eccgui-tag-bg: #{$eccgui-color-warning-background};
|
|
240
265
|
}
|
|
241
266
|
&.#{$eccgui}-intent--danger {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
267
|
+
--eccgui-tag-text: #{$eccgui-color-danger-text};
|
|
268
|
+
--eccgui-tag-border: #{$eccgui-color-danger-text};
|
|
269
|
+
--eccgui-tag-bg: #{$eccgui-color-danger-background};
|
|
245
270
|
}
|
|
246
271
|
}
|
|
247
272
|
}
|
|
248
273
|
}
|
|
274
|
+
|
|
275
|
+
@media print {
|
|
276
|
+
.#{$eccgui}-tag__item {
|
|
277
|
+
print-color-adjust: exact;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -10,7 +10,8 @@ $eccgui-size-textfield-padding-horizontal-regular: $eccgui-size-inline-whitespac
|
|
|
10
10
|
$eccgui-size-textfield-padding-horizontal-small: $eccgui-size-inline-whitespace * 0.5 !default;
|
|
11
11
|
$eccgui-typo-textfield-fontweight: $eccgui-font-weight-regular !default;
|
|
12
12
|
$eccgui-color-textfield-text: $eccgui-color-workspace-text !default;
|
|
13
|
-
$eccgui-color-textfield-background:
|
|
13
|
+
$eccgui-color-textfield-background: eccgui-color-var("identity", "background", 100) !default;
|
|
14
|
+
|
|
14
15
|
// lib vars
|
|
15
16
|
$pt-input-height: $eccgui-size-textfield-height-regular; // !default;
|
|
16
17
|
$pt-input-height-large: $eccgui-size-textfield-height-large; // !default;
|
|
@@ -191,33 +192,40 @@ $eccgui-map-intent-bgcolors: (
|
|
|
191
192
|
position: absolute;
|
|
192
193
|
top: 0;
|
|
193
194
|
left: 0;
|
|
195
|
+
margin-top: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
196
|
+
margin-right: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
197
|
+
|
|
198
|
+
.#{$ns}-input.#{$ns}-small ~ & {
|
|
199
|
+
margin-top: -0.5 * $eccgui-size-textfield-padding-horizontal-small;
|
|
200
|
+
margin-right: -0.5 * $eccgui-size-textfield-padding-horizontal-small;
|
|
201
|
+
}
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
.#{$eccgui}-textarea__options {
|
|
197
205
|
position: absolute;
|
|
198
206
|
top: 0;
|
|
199
207
|
right: 0;
|
|
208
|
+
margin-top: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
209
|
+
margin-right: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
210
|
+
text-align: right;
|
|
200
211
|
filter: grayscale(1);
|
|
201
212
|
|
|
213
|
+
.#{$ns}-input.#{$ns}-small ~ & {
|
|
214
|
+
margin-top: -0.5 * $eccgui-size-textfield-padding-horizontal-small;
|
|
215
|
+
margin-right: -0.5 * $eccgui-size-textfield-padding-horizontal-small;
|
|
216
|
+
}
|
|
217
|
+
|
|
202
218
|
&:hover,
|
|
203
219
|
.#{$eccgui}-textarea:focus ~ & {
|
|
204
220
|
filter: none;
|
|
205
221
|
}
|
|
206
222
|
|
|
207
|
-
& > .#{$eccgui}-button
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.#{$ns}-input.#{$ns}-small ~ & > .#{$eccgui}-button--icon {
|
|
216
|
-
margin-top: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
217
|
-
|
|
218
|
-
&:last-of-type {
|
|
219
|
-
margin-right: -1 * $eccgui-size-textfield-padding-horizontal-small;
|
|
220
|
-
}
|
|
223
|
+
& > .#{$eccgui}-button,
|
|
224
|
+
& > .#{$eccgui}-icon,
|
|
225
|
+
& > .#{$eccgui}-contextoverlay,
|
|
226
|
+
& > .#{$eccgui}-tooltip__wrapper {
|
|
227
|
+
display: inline-block;
|
|
228
|
+
vertical-align: middle;
|
|
221
229
|
}
|
|
222
230
|
}
|
|
223
231
|
|
|
@@ -18,8 +18,9 @@ Default.args = {
|
|
|
18
18
|
<LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />,
|
|
19
19
|
"Simple text with URL http://example.com/ that should not get parsed.",
|
|
20
20
|
"a < b to test equations in text like b > a.",
|
|
21
|
+
`Something with a "quote" in it.`,
|
|
21
22
|
<>
|
|
22
|
-
<Markdown>{`* This\n* is\n* a\n* list\n\nwritten in Markdown.`}</Markdown>
|
|
23
|
+
<Markdown>{`* This\n* is\n* a\n* list\n\nwritten in Markdown\n* containing a few HTML 'entities' & "quotes".`}</Markdown>
|
|
23
24
|
<HtmlContentBlock>
|
|
24
25
|
<h1>Block with sub elements</h1>
|
|
25
26
|
<LoremIpsum p={3} avgSentencesPerParagraph={3} random={false} />
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, RenderResult } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
5
|
+
|
|
6
|
+
import { Markdown, TextReducer } from "./../../";
|
|
7
|
+
import { Default as TextReducerStory } from "./TextReducer.stories";
|
|
8
|
+
|
|
9
|
+
describe("TextReducer", () => {
|
|
10
|
+
const textMustExist = (queryByText: RenderResult["queryByText"], text: string) => {
|
|
11
|
+
expect(queryByText(text, { exact: false })).not.toBeNull();
|
|
12
|
+
};
|
|
13
|
+
const textMustNotExist = (queryByText: RenderResult["queryByText"], text: string) => {
|
|
14
|
+
expect(queryByText(text, { exact: false })).toBeNull();
|
|
15
|
+
};
|
|
16
|
+
it("should display encoded HTML entities by default if they are used in the transformed markup", () => {
|
|
17
|
+
const { queryByText } = render(<TextReducer {...TextReducerStory.args} />);
|
|
18
|
+
textMustExist(queryByText, "'entities' & "quotes"");
|
|
19
|
+
textMustNotExist(queryByText, `'entities' & "quotes"`);
|
|
20
|
+
});
|
|
21
|
+
it("should not display encoded HTML entities if `decodeHtmlEntities` is enabled", () => {
|
|
22
|
+
const { queryByText } = render(<TextReducer {...TextReducerStory.args} decodeHtmlEntities />);
|
|
23
|
+
textMustNotExist(queryByText, "'entities' & "quotes"");
|
|
24
|
+
textMustExist(queryByText, `'entities' & "quotes"`);
|
|
25
|
+
});
|
|
26
|
+
it("should only decode if correct encoded HTML entities are found (strict mode)", () => {
|
|
27
|
+
const { queryByText } = render(
|
|
28
|
+
<TextReducer decodeHtmlEntities>
|
|
29
|
+
<Markdown>&</Markdown>& foo&bar
|
|
30
|
+
</TextReducer>
|
|
31
|
+
);
|
|
32
|
+
textMustExist(queryByText, "& & foo&bar");
|
|
33
|
+
textMustNotExist(queryByText, "& & foo&bar");
|
|
34
|
+
});
|
|
35
|
+
it("should allow decoding non-strict encoded HTML entities", () => {
|
|
36
|
+
const { queryByText } = render(
|
|
37
|
+
<TextReducer decodeHtmlEntities decodeHtmlEntitiesOptions={{ strict: false }}>
|
|
38
|
+
<Markdown>&</Markdown>& foo&bar
|
|
39
|
+
</TextReducer>
|
|
40
|
+
);
|
|
41
|
+
textMustNotExist(queryByText, "& & foo&bar");
|
|
42
|
+
textMustExist(queryByText, "& & foo&bar");
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { renderToString } from "react-dom/server";
|
|
3
|
-
import * as ReactIs from "react-is";
|
|
4
2
|
|
|
3
|
+
import { DecodeHtmlEntitiesOptions, utils } from "../../common";
|
|
5
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
6
5
|
|
|
7
6
|
import { OverflowText, OverflowTextProps } from "./../Typography";
|
|
@@ -25,6 +24,17 @@ export interface TextReducerProps extends Pick<React.HTMLAttributes<HTMLElement>
|
|
|
25
24
|
* Specify more `OverflowText` properties used when `useOverflowTextWrapper` is set to `true`.
|
|
26
25
|
*/
|
|
27
26
|
overflowTextProps?: Omit<OverflowTextProps, "passDown">;
|
|
27
|
+
/**
|
|
28
|
+
* If you transform HTML markup to text then the result could contain HTML entity encoded strings.
|
|
29
|
+
* By enabling this option they are decoded back to it's original char.
|
|
30
|
+
*/
|
|
31
|
+
decodeHtmlEntities?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Set the options used to decode the HTML entities, if `decodeHtmlEntities` is enabled.
|
|
34
|
+
* Internally we use `he` library, see their [documentation on decode options](https://www.npmjs.com/package/he#hedecodehtml-options).
|
|
35
|
+
* If not set we use `{ isAttributeValue: true, strict: true }` as default value.
|
|
36
|
+
*/
|
|
37
|
+
decodeHtmlEntitiesOptions?: DecodeHtmlEntitiesOptions;
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
/**
|
|
@@ -33,52 +43,15 @@ export interface TextReducerProps extends Pick<React.HTMLAttributes<HTMLElement>
|
|
|
33
43
|
*/
|
|
34
44
|
export const TextReducer = ({
|
|
35
45
|
children,
|
|
36
|
-
maxNodes,
|
|
37
|
-
maxLength,
|
|
38
46
|
useOverflowTextWrapper,
|
|
39
47
|
overflowTextProps,
|
|
48
|
+
...reduceToTextOptions
|
|
40
49
|
}: TextReducerProps) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (typeof maxNodes !== "undefined" && nodesCount >= maxNodes) {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (children instanceof Array) {
|
|
49
|
-
return children
|
|
50
|
-
.slice(0, maxNodes)
|
|
51
|
-
.map((child: React.ReactNode) => {
|
|
52
|
-
return onlyText(child, maxNodes);
|
|
53
|
-
})
|
|
54
|
-
.join(" ");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return React.Children.toArray(children)
|
|
58
|
-
.slice(0, maxNodes)
|
|
59
|
-
.map((child) => {
|
|
60
|
-
if (ReactIs.isFragment(child)) {
|
|
61
|
-
return onlyText(child.props?.children, maxNodes);
|
|
62
|
-
}
|
|
63
|
-
if (typeof child === "string") {
|
|
64
|
-
return child;
|
|
65
|
-
}
|
|
66
|
-
if (typeof child === "number") {
|
|
67
|
-
return child.toString();
|
|
68
|
-
}
|
|
69
|
-
if (ReactIs.isElement(child)) {
|
|
70
|
-
// for some reasons `renderToString` returns empty string if not wrappe in a `span`
|
|
71
|
-
return renderToString(<span>{child}</span>);
|
|
72
|
-
}
|
|
73
|
-
return "";
|
|
74
|
-
})
|
|
75
|
-
.join(" ")
|
|
76
|
-
.replaceAll("\n", " ");
|
|
77
|
-
};
|
|
50
|
+
if (typeof children === "undefined") {
|
|
51
|
+
return <></>;
|
|
52
|
+
}
|
|
78
53
|
|
|
79
|
-
const shrinkedContent =
|
|
80
|
-
.replaceAll(/<[^\s][^>]*>/g, "")
|
|
81
|
-
.slice(0, maxLength);
|
|
54
|
+
const shrinkedContent = utils.reduceToText(children, reduceToTextOptions);
|
|
82
55
|
|
|
83
56
|
return useOverflowTextWrapper ? (
|
|
84
57
|
<OverflowText
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
import { TestableComponent } from "../interfaces";
|
|
5
|
+
|
|
6
|
+
export interface InlineTextProps extends React.HTMLAttributes<HTMLElement>, TestableComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Additional CSS class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Forces all children to be displayed as inline content.
|
|
15
|
+
*/
|
|
16
|
+
export const InlineText = ({ className = "", children, ...otherProps }: InlineTextProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<div {...otherProps} className={`${eccgui}-typography__inlinetext` + (className ? " " + className : "")}>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default InlineText;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { InlineText } from "../InlineText";
|
|
5
|
+
|
|
6
|
+
import overflowTextConfig from "./OverflowText.stories";
|
|
7
|
+
|
|
8
|
+
const config = {
|
|
9
|
+
title: "Components/Typography/InlineText",
|
|
10
|
+
component: InlineText,
|
|
11
|
+
argTypes: {
|
|
12
|
+
children: overflowTextConfig.argTypes?.children,
|
|
13
|
+
},
|
|
14
|
+
} as Meta<typeof InlineText>;
|
|
15
|
+
export default config;
|
|
16
|
+
|
|
17
|
+
const Template: StoryFn<typeof InlineText> = (args) => <InlineText {...args} />;
|
|
18
|
+
|
|
19
|
+
export const Default = Template.bind({});
|
|
20
|
+
Default.args = {
|
|
21
|
+
children: (
|
|
22
|
+
<div>
|
|
23
|
+
<div>Block line 1.</div>
|
|
24
|
+
<div>Block line 2.</div>
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
};
|
|
@@ -68,6 +68,11 @@ mark {
|
|
|
68
68
|
line-height: $eccgui-size-typo-caption-lineheight;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
.#{$eccgui}-typography__contentblock.#{$eccgui}-typography--large {
|
|
72
|
+
font-size: $eccgui-size-typo-subtitle;
|
|
73
|
+
line-height: $eccgui-size-typo-subtitle-lineheight;
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
h1 {
|
|
72
77
|
.#{$eccgui}-typography__contentblock &,
|
|
73
78
|
&.#{$eccgui}-typography__text {
|
|
@@ -223,9 +228,9 @@ table {
|
|
|
223
228
|
max-width: 100%;
|
|
224
229
|
overflow: hidden;
|
|
225
230
|
text-overflow: ellipsis;
|
|
231
|
+
vertical-align: middle;
|
|
226
232
|
overflow-wrap: normal;
|
|
227
233
|
white-space: nowrap;
|
|
228
|
-
vertical-align: middle;
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
.#{$eccgui}-typography__overflowtext--inline {
|
|
@@ -241,8 +246,8 @@ table {
|
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
.#{$eccgui}-typography__overflowtext--ellipsis-reverse {
|
|
244
|
-
text-align: left;
|
|
245
249
|
text-overflow: ellipsis;
|
|
250
|
+
text-align: left;
|
|
246
251
|
direction: rtl;
|
|
247
252
|
unicode-bidi: embed;
|
|
248
253
|
|
|
@@ -263,6 +268,22 @@ table {
|
|
|
263
268
|
}
|
|
264
269
|
}
|
|
265
270
|
|
|
271
|
+
// InlineText
|
|
272
|
+
|
|
273
|
+
.#{$eccgui}-typography__inlinetext {
|
|
274
|
+
display: inline;
|
|
275
|
+
|
|
276
|
+
* {
|
|
277
|
+
display: inline;
|
|
278
|
+
|
|
279
|
+
& + * {
|
|
280
|
+
&::before {
|
|
281
|
+
content: " ";
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
266
287
|
// helpers
|
|
267
288
|
|
|
268
289
|
.#{$eccgui}-typography--nooverflow {
|
|
@@ -35,7 +35,7 @@ const Template: StoryFn<typeof VisualTour> = (args: VisualTourProps) => {
|
|
|
35
35
|
<ToolbarSection id={"buttonSection"}>
|
|
36
36
|
<Button id={"actionA"}>Action A</Button>
|
|
37
37
|
<Button id={"actionB"}>Action B</Button>
|
|
38
|
-
<Button id={"startTour"}
|
|
38
|
+
<Button id={"startTour"} elevated onClick={() => setIsOpen(true)}>
|
|
39
39
|
Start tour!
|
|
40
40
|
</Button>
|
|
41
41
|
</ToolbarSection>
|
|
@@ -13,7 +13,7 @@ $eccgui-color-palette-light: (
|
|
|
13
13
|
),
|
|
14
14
|
"semantic": (
|
|
15
15
|
"info": eccgui-create-color-tints(#e5f4fb #aecfe3 #77aaca #4086b2 #096199),
|
|
16
|
-
"success": eccgui-create-color-tints(#e8f5e9 #
|
|
16
|
+
"success": eccgui-create-color-tints(#e8f5e9 #b1d4b7 #7ab286 #429154 #0b6f22),
|
|
17
17
|
"warning": eccgui-create-color-tints(#fff3e0 #fad2b3 #f5b287 #f0915a #eb702d),
|
|
18
18
|
"danger": eccgui-create-color-tints(#fff5f6 #edbfc0 #db8989 #c95253 #b71c1c),
|
|
19
19
|
),
|
|
@@ -24,6 +24,7 @@ $eccgui-color-palette-light: (
|
|
|
24
24
|
"pink": eccgui-create-color-tints(#fde4f1 #e6b4ce #d08aae #bb5f8e #711c4d),
|
|
25
25
|
"violet": eccgui-create-color-tints(#f4e3f4 #d8b0d8 #b377b3 #904490 #6e1f6e),
|
|
26
26
|
"indigo": eccgui-create-color-tints(#efe4fb #b89ee0 #8f72c5 #6547aa #3b1e8f),
|
|
27
|
+
"petrol": eccgui-create-color-tints(#e7eef2 #b0c8d4 #7aa2b5 #437c97 #0c5678),
|
|
27
28
|
"cyan": eccgui-create-color-tints(#dff9fc #86d6e5 #5abfd4 #2da9c4 #006a8f),
|
|
28
29
|
"teal": eccgui-create-color-tints(#dff4ef #a3ddd3 #6dc0b2 #479d8d #104c42),
|
|
29
30
|
"lime": eccgui-create-color-tints(#e4f3ea #d2edd6 #9dcd99 #688a55 #5a7b2c),
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useMemo, useRef } from "react";
|
|
2
2
|
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
|
|
3
3
|
import { defaultHighlightStyle, foldKeymap } from "@codemirror/language";
|
|
4
|
-
import { EditorState, Extension
|
|
4
|
+
import { Compartment,EditorState, Extension } from "@codemirror/state";
|
|
5
5
|
import { DOMEventHandlers, EditorView, KeyBinding, keymap, Rect, ViewUpdate } from "@codemirror/view";
|
|
6
6
|
import { minimalSetup } from "codemirror";
|
|
7
7
|
|
|
8
|
+
import { Markdown } from "../../cmem/markdown/Markdown";
|
|
8
9
|
import { IntentTypes } from "../../common/Intent";
|
|
9
10
|
import { markField } from "../../components/AutoSuggestion/extensions/markText";
|
|
10
11
|
import { TestableComponent } from "../../components/interfaces";
|
|
11
|
-
import { MarkdownToolbar } from "./toolbars/markdown.toolbar";
|
|
12
|
-
import { Markdown } from "../../cmem/markdown/Markdown";
|
|
13
12
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
14
13
|
|
|
15
14
|
//hooks
|
|
@@ -31,9 +30,10 @@ import {
|
|
|
31
30
|
adaptedLineNumbers,
|
|
32
31
|
adaptedLintGutter,
|
|
33
32
|
adaptedPlaceholder,
|
|
34
|
-
compartment,
|
|
35
33
|
adaptedSyntaxHighlighting,
|
|
34
|
+
compartment,
|
|
36
35
|
} from "./tests/codemirrorTestHelper";
|
|
36
|
+
import { MarkdownToolbar } from "./toolbars/markdown.toolbar";
|
|
37
37
|
import { ExtensionCreator } from "./types";
|
|
38
38
|
|
|
39
39
|
export interface CodeEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "translate" | "onChange" | "onKeyDown" | "onMouseDown" | "onScroll">, TestableComponent {
|