@dynatrace/strato-components 1.14.0 → 1.16.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/buttons/button/Button.css +16 -16
- package/buttons/button/Button.js +10 -10
- package/buttons/button/Button.sty.d.ts +4 -4
- package/buttons/button/Button.sty.js +8 -8
- package/buttons/button/Label.js +1 -1
- package/buttons/intent-button/IntentButton.d.ts +1 -0
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.js +3 -3
- package/content/progress/ProgressBarLabel.sty.d.ts +1 -1
- package/content/progress/ProgressBarLabel.sty.js +2 -2
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +2 -2
- package/content/progress/ProgressBarValue.sty.d.ts +1 -1
- package/content/progress/ProgressBarValue.sty.js +2 -2
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +1 -1
- package/content/progress/ProgressCircle.sty.d.ts +13 -7
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +7 -7
- package/content/skeleton/Skeleton.js +2 -2
- package/content/skeleton/Skeleton.sty.js +5 -5
- package/content/skeleton/SkeletonText.js +3 -3
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.d.ts +34 -10
- package/core/styles/focusRing.sty.js +2 -2
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.d.ts +15 -5
- package/core/utils/colorUtils.sty.js +2 -2
- package/core/utils/is-node-environment.d.ts +15 -0
- package/core/utils/is-node-environment.js +34 -0
- package/core/utils/logging.d.ts +8 -0
- package/core/utils/logging.js +33 -0
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +11 -11
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +8 -8
- package/esm/buttons/button/Button.sty.js.map +2 -2
- package/esm/buttons/button/Label.js +2 -2
- package/esm/buttons/button/Label.js.map +2 -2
- package/esm/buttons/index.js.map +2 -2
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.js +6 -6
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.js +4 -4
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js.map +2 -2
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +2 -2
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +7 -7
- package/esm/content/skeleton/Skeleton.js +1 -1
- package/esm/content/skeleton/Skeleton.js.map +1 -1
- package/esm/content/skeleton/Skeleton.sty.js +5 -5
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/content/skeleton/SkeletonText.js +1 -1
- package/esm/content/skeleton/SkeletonText.js.map +1 -1
- package/esm/core/hooks/useId.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/core/utils/is-node-environment.js +15 -0
- package/esm/core/utils/is-node-environment.js.map +7 -0
- package/esm/core/utils/logging.js +14 -0
- package/esm/core/utils/logging.js.map +7 -0
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.js +4 -4
- package/esm/layouts/surface/Surface.js.map +2 -2
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +3 -3
- package/esm/styles/colorUtils.sty.js.map +2 -2
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +2 -2
- package/esm/styles/ellipsis.sty.js.map +2 -2
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +3 -3
- package/esm/styles/field.sty.js.map +2 -2
- package/esm/styles/index.js +2 -2
- package/esm/styles/index.js.map +2 -2
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +2 -2
- package/esm/styles/textStyle.sty.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -8
- package/esm/typography/external-link/ExternalLink.js +1 -1
- package/esm/typography/external-link/ExternalLink.js.map +2 -2
- package/esm/typography/external-link/ExternalLink.sty.js +1 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +5 -6
- package/esm/typography/highlight/Highlight.js +45 -138
- package/esm/typography/highlight/Highlight.js.map +3 -3
- package/esm/typography/highlight/Highlight.sty.js +2 -4
- package/esm/typography/highlight/Highlight.sty.js.map +2 -2
- package/esm/typography/highlight/utils/create-ranged-highlights.js +51 -0
- package/esm/typography/highlight/utils/create-ranged-highlights.js.map +7 -0
- package/esm/typography/highlight/utils/get-or-create-shared-highlight.js +25 -0
- package/esm/typography/highlight/utils/get-or-create-shared-highlight.js.map +7 -0
- package/esm/typography/link/Link.css +3 -3
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.js +3 -7
- package/esm/typography/paragraph/Paragraph.js.map +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.js +5 -5
- package/esm/typography/text/Text.js.map +2 -2
- package/esm/typography/text/Text.sty.js +2 -2
- package/esm/typography/text/Text.sty.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/esm/typography/utils.js +17 -9
- package/esm/typography/utils.js.map +2 -2
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.js +2 -2
- package/layouts/surface/Surface.sty.d.ts +19 -6
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +3 -3
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.d.ts +16 -6
- package/styles/colorUtils.sty.js +3 -3
- package/styles/container.css +47 -47
- package/styles/container.sty.d.ts +16 -6
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.d.ts +1 -1
- package/styles/ellipsis.sty.js +2 -2
- package/styles/field.css +153 -153
- package/styles/field.sty.d.ts +25 -18
- package/styles/field.sty.js +3 -3
- package/styles/index.d.ts +1 -1
- package/styles/index.js +1 -1
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.d.ts +1 -1
- package/styles/textStyle.sty.js +2 -2
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +6 -8
- package/typography/external-link/ExternalLink.js +1 -1
- package/typography/external-link/ExternalLink.sty.js +1 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +5 -6
- package/typography/highlight/Highlight.d.ts +1 -1
- package/typography/highlight/Highlight.js +43 -127
- package/typography/highlight/Highlight.sty.d.ts +1 -2
- package/typography/highlight/Highlight.sty.js +2 -4
- package/typography/highlight/utils/create-ranged-highlights.d.ts +10 -0
- package/typography/highlight/utils/create-ranged-highlights.js +70 -0
- package/typography/highlight/utils/get-or-create-shared-highlight.d.ts +7 -0
- package/typography/highlight/utils/get-or-create-shared-highlight.js +44 -0
- package/typography/link/Link.css +3 -3
- package/typography/link/Link.sty.js +1 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +1 -5
- package/typography/paragraph/Paragraph.sty.d.ts +1 -1
- package/typography/paragraph/Paragraph.sty.js +2 -2
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +3 -3
- package/typography/text/Text.sty.d.ts +1 -1
- package/typography/text/Text.sty.js +2 -2
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/typography/utils.js +17 -9
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var create_ranged_highlights_exports = {};
|
|
20
|
+
__export(create_ranged_highlights_exports, {
|
|
21
|
+
createRangedHighlights: () => createRangedHighlights
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(create_ranged_highlights_exports);
|
|
24
|
+
var import_logging = require("../../../core/utils/logging.js");
|
|
25
|
+
function collectTextNodes(node, textNodes = []) {
|
|
26
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
27
|
+
textNodes.push(node);
|
|
28
|
+
} else {
|
|
29
|
+
for (const child of Array.from(node.childNodes)) {
|
|
30
|
+
collectTextNodes(child, textNodes);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return textNodes;
|
|
34
|
+
}
|
|
35
|
+
function getTextRangeForHighlight(element, terms, caseSensitive) {
|
|
36
|
+
const textNodes = collectTextNodes(element);
|
|
37
|
+
const ranges = [];
|
|
38
|
+
for (const textNode of textNodes) {
|
|
39
|
+
const textContent = textNode.textContent ?? "";
|
|
40
|
+
const searchText = caseSensitive ? textContent : textContent.toLocaleLowerCase();
|
|
41
|
+
for (const term of terms) {
|
|
42
|
+
const searchTerm = caseSensitive ? term : term.toLocaleLowerCase();
|
|
43
|
+
let index = 0;
|
|
44
|
+
while ((index = searchText.indexOf(searchTerm, index)) !== -1) {
|
|
45
|
+
const range = new Range();
|
|
46
|
+
range.setStart(textNode, index);
|
|
47
|
+
range.setEnd(textNode, index + term.length);
|
|
48
|
+
ranges.push(range);
|
|
49
|
+
index += term.length;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return ranges;
|
|
54
|
+
}
|
|
55
|
+
function createRangedHighlights(targetElement, terms, caseSensitive, highlight) {
|
|
56
|
+
const storedRanges = [];
|
|
57
|
+
if (terms.length === 0) {
|
|
58
|
+
return storedRanges;
|
|
59
|
+
}
|
|
60
|
+
const ranges = getTextRangeForHighlight(targetElement, terms, caseSensitive);
|
|
61
|
+
for (const range of ranges) {
|
|
62
|
+
try {
|
|
63
|
+
highlight.add(range);
|
|
64
|
+
storedRanges.push(range);
|
|
65
|
+
} catch {
|
|
66
|
+
(0, import_logging.devLog)("Failed to add range", range);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return storedRanges;
|
|
70
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const HIGHLIGHT_NAME = "strato-typography-highlight";
|
|
2
|
+
/**
|
|
3
|
+
* Gets or creates the shared text highlight.
|
|
4
|
+
* All Highlight components share the same highlight instance.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function getOrCreateSharedHighlight(): Set<AbstractRange> | Highlight;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var get_or_create_shared_highlight_exports = {};
|
|
20
|
+
__export(get_or_create_shared_highlight_exports, {
|
|
21
|
+
HIGHLIGHT_NAME: () => HIGHLIGHT_NAME,
|
|
22
|
+
getOrCreateSharedHighlight: () => getOrCreateSharedHighlight
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(get_or_create_shared_highlight_exports);
|
|
25
|
+
var import_logging = require("../../../core/utils/logging.js");
|
|
26
|
+
const HIGHLIGHT_NAME = "strato-typography-highlight";
|
|
27
|
+
let sharedHighlight = null;
|
|
28
|
+
function getOrCreateSharedHighlight() {
|
|
29
|
+
if (sharedHighlight) {
|
|
30
|
+
return sharedHighlight;
|
|
31
|
+
}
|
|
32
|
+
if ("Highlight" in window) {
|
|
33
|
+
sharedHighlight = new Highlight();
|
|
34
|
+
if (sharedHighlight instanceof Highlight) {
|
|
35
|
+
CSS.highlights.set(HIGHLIGHT_NAME, sharedHighlight);
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
sharedHighlight = /* @__PURE__ */ new Set();
|
|
39
|
+
(0, import_logging.devLog)(
|
|
40
|
+
"CSS Highlight API is not supported in this browser. Text highlighting will not be visible."
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return sharedHighlight;
|
|
44
|
+
}
|
package/typography/link/Link.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
._1iksxp40-1-
|
|
1
|
+
._1iksxp40-1-16-0 {
|
|
2
2
|
display: inline;
|
|
3
3
|
color: var(--dt-colors-text-primary-default, #464cce);
|
|
4
4
|
text-decoration: underline;
|
|
5
5
|
overflow-wrap: anywhere;
|
|
6
6
|
}
|
|
7
|
-
._1iksxp40-1-
|
|
7
|
+
._1iksxp40-1-16-0:hover {
|
|
8
8
|
color: var(--dt-colors-text-primary-default-hover, #3431b3);
|
|
9
9
|
}
|
|
10
|
-
._1iksxp40-1-
|
|
10
|
+
._1iksxp40-1-16-0:active {
|
|
11
11
|
color: var(--dt-colors-text-primary-default-active, #250f98);
|
|
12
12
|
}
|
package/typography/list/List.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
._16276mt0-1-
|
|
1
|
+
._16276mt0-1-16-0 {
|
|
2
2
|
margin: 0;
|
|
3
3
|
padding-left: var(--dt-spacings-size-40, 40px);
|
|
4
4
|
}
|
|
5
|
-
._16276mt0-1-
|
|
5
|
+
._16276mt0-1-16-0 ._16276mt0-1-16-0 {
|
|
6
6
|
margin-block: var(--dt-spacings-size-4, 4px);
|
|
7
7
|
padding-left: var(--dt-spacings-size-28, 28px);
|
|
8
8
|
}
|
|
9
|
-
._16276mt1-1-
|
|
9
|
+
._16276mt1-1-16-0 {
|
|
10
10
|
position: relative;
|
|
11
11
|
overflow-wrap: break-word;
|
|
12
12
|
margin-block: var(--dt-spacings-size-2, 2px);
|
|
13
13
|
}
|
|
14
|
-
._16276mt1-1-
|
|
14
|
+
._16276mt1-1-16-0::marker {
|
|
15
15
|
font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
|
|
16
16
|
}
|
|
@@ -23,5 +23,5 @@ __export(List_css_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(List_css_exports);
|
|
25
25
|
var import_List_css_ts_vanilla = require("./List.css");
|
|
26
|
-
var listCSS = "_16276mt0-1-
|
|
27
|
-
var listItemCSS = "_16276mt1-1-
|
|
26
|
+
var listCSS = "_16276mt0-1-16-0";
|
|
27
|
+
var listItemCSS = "_16276mt1-1-16-0";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
._487p2n0-1-
|
|
1
|
+
._487p2n0-1-16-0 {
|
|
2
2
|
margin-top: 0;
|
|
3
3
|
margin-bottom: 0;
|
|
4
4
|
overflow-wrap: break-word;
|
|
5
5
|
color: inherit;
|
|
6
6
|
font-style: normal;
|
|
7
7
|
}
|
|
8
|
-
._487p2n1-1-
|
|
8
|
+
._487p2n1-1-16-0 {
|
|
9
9
|
display: block;
|
|
10
10
|
white-space: nowrap;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
}
|
|
14
|
-
._487p2n2-1-
|
|
14
|
+
._487p2n2-1-16-0 {
|
|
15
15
|
display: -webkit-box;
|
|
16
16
|
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
17
17
|
-webkit-box-orient: vertical;
|
|
@@ -62,11 +62,7 @@ const Paragraph = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
|
|
|
62
62
|
"data-testid": dataTestId,
|
|
63
63
|
"data-dtrum-mask": dataDtrumMask,
|
|
64
64
|
"data-dtrum-allow": dataDtrumAllow,
|
|
65
|
-
className: (0, import_clsx.default)(
|
|
66
|
-
(0, import_Paragraph_css.paragraphCSS)({ ellipsis }),
|
|
67
|
-
(0, import_textStyle_css.textStyleCSS)(),
|
|
68
|
-
consumerClassName
|
|
69
|
-
),
|
|
65
|
+
className: (0, import_clsx.default)((0, import_Paragraph_css.paragraph)({ ellipsis }), (0, import_textStyle_css.textStyle)(), consumerClassName),
|
|
70
66
|
style: {
|
|
71
67
|
...consumerStyle,
|
|
72
68
|
"--strato-ellipsis-line-clamp": maxLines
|
|
@@ -18,9 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var Paragraph_css_exports = {};
|
|
20
20
|
__export(Paragraph_css_exports, {
|
|
21
|
-
|
|
21
|
+
paragraph: () => paragraph
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Paragraph_css_exports);
|
|
24
24
|
var import_Paragraph_css_ts_vanilla = require("./Paragraph.css");
|
|
25
25
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
26
|
-
var
|
|
26
|
+
var paragraph = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_487p2n0-1-16-0", variantClassNames: { ellipsis: { singleLine: "_487p2n1-1-16-0", multiLine: "_487p2n2-1-16-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -22,4 +22,4 @@ __export(Strikethrough_css_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Strikethrough_css_exports);
|
|
24
24
|
var import_Strikethrough_css_ts_vanilla = require("./Strikethrough.css");
|
|
25
|
-
var strikethroughCSS = "_4oao6y0-1-
|
|
25
|
+
var strikethroughCSS = "_4oao6y0-1-16-0";
|
package/typography/text/Text.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
._rup8ap0-1-
|
|
1
|
+
._rup8ap0-1-16-0 {
|
|
2
2
|
margin-top: 0;
|
|
3
3
|
margin-bottom: 0;
|
|
4
4
|
min-width: 0;
|
|
5
5
|
overflow-wrap: break-word;
|
|
6
6
|
}
|
|
7
|
-
._rup8ap1-1-
|
|
7
|
+
._rup8ap1-1-16-0 {
|
|
8
8
|
display: block;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
text-overflow: ellipsis;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
}
|
|
13
|
-
._rup8ap2-1-
|
|
13
|
+
._rup8ap2-1-16-0 {
|
|
14
14
|
display: -webkit-box;
|
|
15
15
|
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
16
16
|
-webkit-box-orient: vertical;
|
package/typography/text/Text.js
CHANGED
|
@@ -39,7 +39,7 @@ var import_textStyle_css = require("../../styles/textStyle.sty.js");
|
|
|
39
39
|
const Text = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
40
40
|
({
|
|
41
41
|
children,
|
|
42
|
-
textStyle,
|
|
42
|
+
textStyle: textStyleProp,
|
|
43
43
|
fontStyle,
|
|
44
44
|
as,
|
|
45
45
|
className: consumerClassName,
|
|
@@ -59,8 +59,8 @@ const Text = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
|
59
59
|
"data-dtrum-allow": dataDtrumAllow,
|
|
60
60
|
ref,
|
|
61
61
|
className: (0, import_clsx.default)([
|
|
62
|
-
(0, import_Text_css.
|
|
63
|
-
(fontStyle ||
|
|
62
|
+
(0, import_Text_css.text)({ ellipsis }),
|
|
63
|
+
(fontStyle || textStyleProp) && (0, import_textStyle_css.textStyle)({ fontStyle, textStyle: textStyleProp }),
|
|
64
64
|
consumerClassName
|
|
65
65
|
]),
|
|
66
66
|
style: consumerStyle,
|
|
@@ -18,9 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var Text_css_exports = {};
|
|
20
20
|
__export(Text_css_exports, {
|
|
21
|
-
|
|
21
|
+
text: () => text
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Text_css_exports);
|
|
24
24
|
var import_Text_css_ts_vanilla = require("./Text.css");
|
|
25
25
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
26
|
-
var
|
|
26
|
+
var text = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_rup8ap0-1-16-0", variantClassNames: { ellipsis: { singleLine: "_rup8ap1-1-16-0", multiLine: "_rup8ap2-1-16-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
._1mnpbqs1-1-
|
|
1
|
+
._1mnpbqs1-1-16-0 {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
vertical-align: middle;
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
text-decoration: inherit;
|
|
10
10
|
width: 100%;
|
|
11
11
|
}
|
|
12
|
-
._1mnpbqs2-1-
|
|
12
|
+
._1mnpbqs2-1-16-0 {
|
|
13
13
|
text-overflow: ellipsis;
|
|
14
14
|
direction: rtl;
|
|
15
15
|
text-align: left;
|
|
16
16
|
}
|
|
17
|
-
._1mnpbqs2-1-
|
|
17
|
+
._1mnpbqs2-1-16-0::after, ._1mnpbqs2-1-16-0::before {
|
|
18
18
|
content: "";
|
|
19
19
|
}
|
|
20
|
-
._1mnpbqs3-1-
|
|
20
|
+
._1mnpbqs3-1-16-0 {
|
|
21
21
|
text-overflow: clip;
|
|
22
22
|
}
|
|
23
|
-
._1mnpbqs3-1-
|
|
23
|
+
._1mnpbqs3-1-16-0._1mnpbqs0-1-16-0:after {
|
|
24
24
|
content: attr(data-sourcetext) / "";
|
|
25
25
|
color: transparent;
|
|
26
26
|
display: table;
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
line-height: 0;
|
|
29
29
|
user-select: none;
|
|
30
30
|
}
|
|
31
|
-
._1mnpbqs4-1-
|
|
31
|
+
._1mnpbqs4-1-16-0 {
|
|
32
32
|
text-overflow: ellipsis;
|
|
33
33
|
}
|
|
@@ -24,5 +24,5 @@ __export(TextEllipsis_css_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(TextEllipsis_css_exports);
|
|
25
25
|
var import_TextEllipsis_css_ts_vanilla = require("./TextEllipsis.css");
|
|
26
26
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
27
|
-
var active = "_1mnpbqs0-1-
|
|
28
|
-
var ellipsis = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1mnpbqs1-1-
|
|
27
|
+
var active = "_1mnpbqs0-1-16-0";
|
|
28
|
+
var ellipsis = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1mnpbqs1-1-16-0", variantClassNames: { truncationMode: { start: "_1mnpbqs2-1-16-0", middle: "_1mnpbqs3-1-16-0", end: "_1mnpbqs4-1-16-0" } }, defaultVariants: {}, compoundVariants: [] });
|
package/typography/utils.js
CHANGED
|
@@ -27,9 +27,17 @@ __export(utils_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(utils_exports);
|
|
29
29
|
var import_user_preferences = require("@dynatrace-sdk/user-preferences");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
let localizedSegmenter;
|
|
31
|
+
function getLocalizedSegmenter() {
|
|
32
|
+
if (localizedSegmenter) {
|
|
33
|
+
return localizedSegmenter;
|
|
34
|
+
}
|
|
35
|
+
const segmenter = new Intl.Segmenter((0, import_user_preferences.getLanguage)(), {
|
|
36
|
+
granularity: "grapheme"
|
|
37
|
+
});
|
|
38
|
+
localizedSegmenter = segmenter;
|
|
39
|
+
return localizedSegmenter;
|
|
40
|
+
}
|
|
33
41
|
const ELLIPSIS_CHARACTER = "\u2026";
|
|
34
42
|
const ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
|
|
35
43
|
let inMemContext2d;
|
|
@@ -72,9 +80,10 @@ function centerEllipsizeText(originalText, textFont, maxWidthInPx) {
|
|
|
72
80
|
let attempt = 1;
|
|
73
81
|
let prefixLength = initialPrefixSuffixLength;
|
|
74
82
|
let suffixLength = initialPrefixSuffixLength;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
const segmenter = getLocalizedSegmenter();
|
|
84
|
+
const originalSegmentedText = Array.from(segmenter.segment(originalText)).map(
|
|
85
|
+
(segment) => segment.segment
|
|
86
|
+
);
|
|
78
87
|
do {
|
|
79
88
|
const originalSegmentedTextCopy = [...originalSegmentedText];
|
|
80
89
|
prefixLength -= attempt % 2 === 1 ? 1 : 0;
|
|
@@ -102,9 +111,8 @@ function getFontString(textFont) {
|
|
|
102
111
|
).join(" ");
|
|
103
112
|
}
|
|
104
113
|
function calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
).length;
|
|
114
|
+
const segmenter = getLocalizedSegmenter();
|
|
115
|
+
const originalTextLength = Array.from(segmenter.segment(originalText)).length;
|
|
108
116
|
if (originalTextLength <= 1) {
|
|
109
117
|
return null;
|
|
110
118
|
}
|