@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.
- package/CHANGELOG.md +74 -19
- package/dist/cjs/cmem/markdown/Markdown.js +1 -2
- package/dist/cjs/cmem/markdown/Markdown.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/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/extensions/react-flow/nodes/NodeContent.js +2 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.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/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/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/extensions/react-flow/nodes/NodeContent.js +2 -2
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- 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/canonicalIconNames.d.ts +23 -0
- package/dist/types/components/Spinner/Spinner.d.ts +11 -4
- package/dist/types/components/Tabs/Tab.d.ts +2 -2
- package/dist/types/components/TextReducer/TextReducer.d.ts +13 -1
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +1 -1
- package/package.json +5 -3
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +1 -1
- package/src/cmem/markdown/Markdown.tsx +1 -2
- 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/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/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/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/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/tag.scss +95 -68
- 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/VisualTour/stories/VisualTour.stories.tsx +1 -1
- package/src/configuration/_palettes.scss +2 -1
- 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/_edges.scss +15 -7
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +5 -5
- package/src/extensions/react-flow/nodes/NodeContent.tsx +2 -2
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.#{$eccgui}-propertyvalue__pair {
|
|
8
|
+
clear: both;
|
|
8
9
|
display: block;
|
|
9
10
|
width: 100%;
|
|
10
|
-
clear: both;
|
|
11
11
|
|
|
12
12
|
&.#{$eccgui}-propertyvalue__pair--hasdivider {
|
|
13
13
|
&:not(:last-child) {
|
|
@@ -94,3 +94,25 @@
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
@media print {
|
|
99
|
+
.#{$eccgui}-propertyvalue__pair,
|
|
100
|
+
.#{$eccgui}-propertyvalue__property,
|
|
101
|
+
.#{$eccgui}-propertyvalue__value {
|
|
102
|
+
position: relative;
|
|
103
|
+
float: none !important;
|
|
104
|
+
display: block;
|
|
105
|
+
width: auto;
|
|
106
|
+
height: auto;
|
|
107
|
+
min-height: 0 !important;
|
|
108
|
+
padding: 0;
|
|
109
|
+
margin: 0 !important;
|
|
110
|
+
|
|
111
|
+
&:is(.#{$eccgui}-propertyvalue__property) {
|
|
112
|
+
margin-bottom: 0.25 * $eccgui-size-block-whitespace !important;
|
|
113
|
+
}
|
|
114
|
+
&:is(.#{$eccgui}-propertyvalue__pair) {
|
|
115
|
+
margin-bottom: 0.5 * $eccgui-size-block-whitespace !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -53,7 +53,7 @@ export const ControlledTarget = Template.bind({});
|
|
|
53
53
|
ControlledTarget.args = {
|
|
54
54
|
...Default.args,
|
|
55
55
|
fill: false,
|
|
56
|
-
children: <Button text="Controlled select target"
|
|
56
|
+
children: <Button text="Controlled select target" elevated />,
|
|
57
57
|
onActiveItemChange: fn(),
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -9,10 +9,11 @@ import Color from "color";
|
|
|
9
9
|
|
|
10
10
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
11
11
|
|
|
12
|
+
import { ButtonProps } from "./../Button/Button";
|
|
13
|
+
|
|
12
14
|
type SpinnerPosition = "local" | "inline" | "global";
|
|
13
15
|
type SpinnerSize = "tiny" | "small" | "medium" | "large" | "xlarge" | "inherit";
|
|
14
16
|
type SpinnerStroke = "thin" | "medium" | "bold";
|
|
15
|
-
type Intent = "primary" | "success" | "warning" | "danger";
|
|
16
17
|
|
|
17
18
|
/** A spinner that is either displayed globally or locally. */
|
|
18
19
|
export interface SpinnerProps extends Omit<BlueprintSpinnerProps, "size" | "intent" | "color"> {
|
|
@@ -22,9 +23,16 @@ export interface SpinnerProps extends Omit<BlueprintSpinnerProps, "size" | "inte
|
|
|
22
23
|
*/
|
|
23
24
|
color?: Color | string | "inherit";
|
|
24
25
|
/**
|
|
25
|
-
* Intent state of the
|
|
26
|
+
* Intent state of the spinner.
|
|
27
|
+
* When used the spinner is colored.
|
|
28
|
+
* Property overwrites `elevated` setting.
|
|
29
|
+
*/
|
|
30
|
+
intent?: ButtonProps["intent"];
|
|
31
|
+
/**
|
|
32
|
+
* Highlight the spinner.
|
|
33
|
+
* It is displayed with accent color intent.
|
|
26
34
|
*/
|
|
27
|
-
|
|
35
|
+
elevated?: boolean;
|
|
28
36
|
/**
|
|
29
37
|
* Additional CSS class names.
|
|
30
38
|
*/
|
|
@@ -67,6 +75,7 @@ export const Spinner = ({
|
|
|
67
75
|
className = "",
|
|
68
76
|
color = "inherit",
|
|
69
77
|
intent,
|
|
78
|
+
elevated,
|
|
70
79
|
position = "local",
|
|
71
80
|
size,
|
|
72
81
|
stroke,
|
|
@@ -119,6 +128,7 @@ export const Spinner = ({
|
|
|
119
128
|
className={
|
|
120
129
|
`${eccgui}-spinner` +
|
|
121
130
|
` ${eccgui}-spinner--position-${position}` +
|
|
131
|
+
(elevated ? ` ${eccgui}-spinner--intent-accent` : "") +
|
|
122
132
|
(intent ? ` ${eccgui}-spinner--intent-${intent}` : "") +
|
|
123
133
|
` ${eccgui}-spinner--size-${spinnerSize}` +
|
|
124
134
|
(showLocalBackdrop ? ` ${eccgui}-spinner--localbackdrop` : "") +
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
color: { control: "color" },
|
|
11
11
|
intent: {
|
|
12
12
|
...helpersArgTypes.exampleIntent,
|
|
13
|
-
options: ["UNDEFINED", "primary", "success", "warning", "danger", "none"],
|
|
13
|
+
options: ["UNDEFINED", "primary", "accent", "success", "warning", "danger", "none"],
|
|
14
14
|
},
|
|
15
15
|
position: { control: "radio", options: ["local", "inline", "global"] },
|
|
16
16
|
size: { control: "radio", options: ["tiny", "small", "medium", "large", "xlarge", "inherit"] },
|
|
@@ -29,10 +29,14 @@ span.#{$eccgui}-spinner {
|
|
|
29
29
|
color: inherit;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.#{$eccgui}-spinner--intent-
|
|
32
|
+
.#{$eccgui}-spinner--intent-accent {
|
|
33
33
|
color: $eccgui-color-accent;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
.#{$eccgui}-spinner--intent-primary {
|
|
37
|
+
color: $eccgui-color-primary;
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
.#{$eccgui}-spinner--intent-success {
|
|
37
41
|
color: $eccgui-color-success-text;
|
|
38
42
|
}
|
|
@@ -356,3 +356,25 @@ tr.#{$prefix}--parent-row.#{$prefix}--expandable-row + tr[data-child-row] {
|
|
|
356
356
|
min-height: $eccgui-size-tablecell-height-regular;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
+
|
|
360
|
+
@media print {
|
|
361
|
+
.#{$eccgui}-simpletable:has(.#{$eccgui}-simpletable__cell > .#{$eccgui}-typography__overflowtext) {
|
|
362
|
+
// allow 2 lines of text in `<OverflowText />` elements that are direct children of table cells
|
|
363
|
+
.#{$eccgui}-simpletable__cell {
|
|
364
|
+
& > .#{$eccgui}-typography__overflowtext,
|
|
365
|
+
& > .#{$eccgui}-typography__overflowtext--passdown {
|
|
366
|
+
display: inline;
|
|
367
|
+
overflow: visible;
|
|
368
|
+
text-overflow: unset;
|
|
369
|
+
white-space: unset;
|
|
370
|
+
}
|
|
371
|
+
& > .#{$eccgui}-typography__overflowtext {
|
|
372
|
+
display: -webkit-box;
|
|
373
|
+
overflow: hidden;
|
|
374
|
+
-webkit-line-clamp: 2;
|
|
375
|
+
line-clamp: 2;
|
|
376
|
+
-webkit-box-orient: vertical;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
@@ -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;
|
|
@@ -139,110 +141,135 @@ $tag-round-adjustment: 0 !default;
|
|
|
139
141
|
border-width: 1px;
|
|
140
142
|
|
|
141
143
|
&:not([class*="#{$ns}-intent-"]) {
|
|
144
|
+
--eccgui-tag-bg: #{$tag-default-color};
|
|
145
|
+
--eccgui-tag-border: #{$tag-default-color};
|
|
146
|
+
--eccgui-tag-text: #{eccgui-color-var("identity", "text", "100")};
|
|
147
|
+
--eccgui-tag-emfactor: 100%;
|
|
148
|
+
|
|
149
|
+
color: var(--eccgui-tag-text);
|
|
150
|
+
background-color: eccgui-color-mix(
|
|
151
|
+
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
|
|
152
|
+
eccgui-color-var("identity", "background", "100")
|
|
153
|
+
);
|
|
154
|
+
border-color: var(--eccgui-tag-border);
|
|
155
|
+
|
|
142
156
|
&.#{$eccgui}-tag--strongeremphasis {
|
|
143
|
-
|
|
144
|
-
border-color: $tag-default-color;
|
|
157
|
+
--eccgui-tag-emfactor: 95%;
|
|
145
158
|
}
|
|
146
159
|
&.#{$eccgui}-tag--strongemphasis {
|
|
147
|
-
|
|
148
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.875);
|
|
160
|
+
--eccgui-tag-emfactor: 90%;
|
|
149
161
|
}
|
|
150
162
|
&.#{$eccgui}-tag--normalemphasis {
|
|
151
|
-
|
|
152
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.75);
|
|
163
|
+
--eccgui-tag-emfactor: 85%;
|
|
153
164
|
}
|
|
154
165
|
&.#{$eccgui}-tag--weakemphasis {
|
|
155
|
-
|
|
156
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.625);
|
|
166
|
+
--eccgui-tag-emfactor: 80%;
|
|
157
167
|
}
|
|
158
168
|
&.#{$eccgui}-tag--weakeremphasis {
|
|
159
|
-
|
|
160
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.5);
|
|
169
|
+
--eccgui-tag-emfactor: 75%;
|
|
161
170
|
}
|
|
162
171
|
|
|
163
172
|
&.#{$eccgui}-intent--primary {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
--eccgui-tag-bg: #{$eccgui-color-primary};
|
|
174
|
+
--eccgui-tag-border: #{$eccgui-color-primary};
|
|
175
|
+
--eccgui-tag-text: #{$eccgui-color-primary-contrast};
|
|
167
176
|
}
|
|
168
177
|
&.#{$eccgui}-intent--accent {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
178
|
+
--eccgui-tag-bg: #{$eccgui-color-accent};
|
|
179
|
+
--eccgui-tag-border: #{$eccgui-color-accent};
|
|
180
|
+
--eccgui-tag-text: #{$eccgui-color-accent-contrast};
|
|
172
181
|
}
|
|
173
182
|
&.#{$eccgui}-intent--info {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
--eccgui-tag-bg: #{$eccgui-color-info-text};
|
|
184
|
+
--eccgui-tag-border: #{$eccgui-color-info-text};
|
|
185
|
+
--eccgui-tag-text: #{$eccgui-color-info-background};
|
|
177
186
|
}
|
|
178
187
|
&.#{$eccgui}-intent--success {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
188
|
+
--eccgui-tag-bg: #{$eccgui-color-success-text};
|
|
189
|
+
--eccgui-tag-border: #{$eccgui-color-success-text};
|
|
190
|
+
--eccgui-tag-text: #{$eccgui-color-success-background};
|
|
182
191
|
}
|
|
183
192
|
&.#{$eccgui}-intent--warning {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
--eccgui-tag-bg: #{$eccgui-color-warning-text};
|
|
194
|
+
--eccgui-tag-border: #{$eccgui-color-warning-text};
|
|
195
|
+
--eccgui-tag-text: #{$eccgui-color-warning-background};
|
|
187
196
|
}
|
|
188
197
|
&.#{$eccgui}-intent--danger {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
--eccgui-tag-bg: #{$eccgui-color-danger-text};
|
|
199
|
+
--eccgui-tag-border: #{$eccgui-color-danger-text};
|
|
200
|
+
--eccgui-tag-text: #{$eccgui-color-danger-background};
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
&.#{$ns}-minimal,
|
|
195
204
|
&.#{$ns}-minimal.#{$ns}-interactive {
|
|
205
|
+
--eccgui-tag-bg: #{eccgui-color-var("identity", "background", "500")};
|
|
206
|
+
--eccgui-tag-border: #{$tag-default-color};
|
|
207
|
+
--eccgui-tag-text: #{$tag-default-color};
|
|
208
|
+
|
|
209
|
+
color: var(--eccgui-tag-text);
|
|
210
|
+
background-color: eccgui-color-mix(
|
|
211
|
+
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
|
|
212
|
+
eccgui-color-var("identity", "background", "100")
|
|
213
|
+
);
|
|
214
|
+
border-color: var(--eccgui-tag-border);
|
|
215
|
+
|
|
196
216
|
&.#{$eccgui}-tag--strongeremphasis {
|
|
197
|
-
|
|
198
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.3);
|
|
217
|
+
--eccgui-tag-emfactor: 100%;
|
|
199
218
|
}
|
|
200
219
|
&.#{$eccgui}-tag--strongemphasis {
|
|
201
|
-
|
|
202
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.225);
|
|
220
|
+
--eccgui-tag-emfactor: 90%;
|
|
203
221
|
}
|
|
204
222
|
&.#{$eccgui}-tag--normalemphasis {
|
|
205
|
-
|
|
206
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.15);
|
|
223
|
+
--eccgui-tag-emfactor: 80%;
|
|
207
224
|
}
|
|
208
225
|
&.#{$eccgui}-tag--weakemphasis {
|
|
209
|
-
|
|
210
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.075);
|
|
226
|
+
--eccgui-tag-emfactor: 70%;
|
|
211
227
|
}
|
|
212
228
|
&.#{$eccgui}-tag--weakeremphasis {
|
|
213
|
-
|
|
214
|
-
border-color: eccgui-color-rgba($tag-default-color, 0.15);
|
|
229
|
+
--eccgui-tag-emfactor: 60%;
|
|
215
230
|
}
|
|
231
|
+
|
|
232
|
+
&[class*="#{$eccgui}-intent--"] {
|
|
233
|
+
color: eccgui-color-rgba(var(--eccgui-tag-text), var(--eccgui-tag-emfactor));
|
|
234
|
+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), var(--eccgui-tag-emfactor));
|
|
235
|
+
}
|
|
236
|
+
|
|
216
237
|
&.#{$eccgui}-intent--primary {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
238
|
+
--eccgui-tag-text: #{$eccgui-color-primary};
|
|
239
|
+
--eccgui-tag-border: #{$eccgui-color-primary};
|
|
240
|
+
--eccgui-tag-bg: #{$eccgui-color-primary-contrast};
|
|
220
241
|
}
|
|
221
242
|
&.#{$eccgui}-intent--accent {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
243
|
+
--eccgui-tag-text: #{$eccgui-color-accent};
|
|
244
|
+
--eccgui-tag-border: #{$eccgui-color-accent};
|
|
245
|
+
--eccgui-tag-bg: #{$eccgui-color-accent-contrast};
|
|
225
246
|
}
|
|
226
247
|
&.#{$eccgui}-intent--info {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
248
|
+
--eccgui-tag-text: #{$eccgui-color-info-text};
|
|
249
|
+
--eccgui-tag-border: #{$eccgui-color-info-text};
|
|
250
|
+
--eccgui-tag-bg: #{$eccgui-color-info-background};
|
|
230
251
|
}
|
|
231
252
|
&.#{$eccgui}-intent--success {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
253
|
+
--eccgui-tag-text: #{$eccgui-color-success-text};
|
|
254
|
+
--eccgui-tag-border: #{$eccgui-color-success-text};
|
|
255
|
+
--eccgui-tag-bg: #{$eccgui-color-success-background};
|
|
235
256
|
}
|
|
236
257
|
&.#{$eccgui}-intent--warning {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
258
|
+
--eccgui-tag-text: #{$eccgui-color-warning-text};
|
|
259
|
+
--eccgui-tag-border: #{$eccgui-color-warning-text};
|
|
260
|
+
--eccgui-tag-bg: #{$eccgui-color-warning-background};
|
|
240
261
|
}
|
|
241
262
|
&.#{$eccgui}-intent--danger {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
263
|
+
--eccgui-tag-text: #{$eccgui-color-danger-text};
|
|
264
|
+
--eccgui-tag-border: #{$eccgui-color-danger-text};
|
|
265
|
+
--eccgui-tag-bg: #{$eccgui-color-danger-background};
|
|
245
266
|
}
|
|
246
267
|
}
|
|
247
268
|
}
|
|
248
269
|
}
|
|
270
|
+
|
|
271
|
+
@media print {
|
|
272
|
+
.#{$eccgui}-tag__item {
|
|
273
|
+
print-color-adjust: exact;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -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
|
|
@@ -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),
|
|
@@ -7,9 +7,14 @@ $reactflow-node-color: $eccgui-color-workspace-text !default;
|
|
|
7
7
|
$reactflow-node-font-size: $eccgui-size-typo-caption !default;
|
|
8
8
|
$reactflow-node-border-width: 2 * $button-border-width !default;
|
|
9
9
|
$reactflow-node-border-radius: $button-border-radius !default;
|
|
10
|
-
$reactflow-edge-
|
|
11
|
-
$reactflow-edge-stroke-
|
|
12
|
-
$reactflow-edge-stroke-
|
|
10
|
+
$reactflow-edge-rendering: geometricprecision !default;
|
|
11
|
+
$reactflow-edge-stroke-width-default: 2px !default;
|
|
12
|
+
$reactflow-edge-stroke-width-hover: 2px !default;
|
|
13
|
+
$reactflow-edge-stroke-width-selected: 2px !default;
|
|
14
|
+
$reactflow-edge-stroke-opacity-default: $eccgui-opacity-muted !default;
|
|
15
|
+
$reactflow-edge-stroke-opacity-hover: $eccgui-opacity-narrow !default;
|
|
16
|
+
$reactflow-edge-stroke-opacity-selected: $eccgui-opacity-regular !default;
|
|
17
|
+
$reactflow-edge-stroke-opacity-interaction-ratio: $eccgui-opacity-ghostly !default;
|
|
13
18
|
$reactflow-edge-stroke-color-default: #{eccgui-color-var("identity", "text", "700")} !default;
|
|
14
19
|
$reactflow-edge-stroke-color-hover: $reactflow-edge-stroke-color-default !default;
|
|
15
20
|
$reactflow-edge-stroke-color-selected: $eccgui-color-accent !default;
|