@dynatrace/strato-components 0.84.21 → 0.84.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/core/components/app-root/AppRoot.d.ts +9 -4
  2. package/core/components/app-root/AppRoot.js +6 -2
  3. package/core/contexts/FocusContext.d.ts +1 -1
  4. package/core/hooks/useCurrentTheme.d.ts +4 -1
  5. package/core/hooks/useFontsUpdated.d.ts +9 -0
  6. package/core/hooks/useFontsUpdated.js +51 -0
  7. package/core/hooks/useMergeRefs.d.ts +7 -0
  8. package/core/hooks/useMergeRefs.js +34 -0
  9. package/core/index.d.ts +5 -0
  10. package/core/styles/focusRing.css +88 -0
  11. package/core/styles/focusRing.sty.d.ts +96 -0
  12. package/core/styles/focusRing.sty.js +27 -0
  13. package/core/styles/useFocusRing.d.ts +49 -0
  14. package/core/styles/useFocusRing.js +83 -0
  15. package/core/types/a11y-props.d.ts +19 -0
  16. package/core/types/a11y-props.js +15 -0
  17. package/core/types/data-props.d.ts +1 -0
  18. package/core/types/dom.d.ts +19 -0
  19. package/core/types/dom.js +15 -0
  20. package/core/types/focusable-element.d.ts +5 -0
  21. package/core/types/focusable-element.js +15 -0
  22. package/core/types/heading.d.ts +9 -0
  23. package/core/types/heading.js +15 -0
  24. package/core/types/masking-props.d.ts +9 -0
  25. package/core/types/masking-props.js +15 -0
  26. package/core/types/polymorph.d.ts +25 -0
  27. package/core/types/polymorph.js +15 -0
  28. package/core/types/styling-props.d.ts +3 -2
  29. package/core/types/with-children.d.ts +4 -1
  30. package/core/utils/colorUtils.css +80 -0
  31. package/core/utils/colorUtils.sty.d.ts +48 -0
  32. package/core/utils/colorUtils.sty.js +27 -0
  33. package/esm/core/components/app-root/AppRoot.js +6 -2
  34. package/esm/core/components/app-root/AppRoot.js.map +2 -2
  35. package/esm/core/contexts/FocusContext.js.map +1 -1
  36. package/esm/core/hooks/useCurrentTheme.js.map +2 -2
  37. package/esm/core/hooks/useFontsUpdated.js +33 -0
  38. package/esm/core/hooks/useFontsUpdated.js.map +7 -0
  39. package/esm/core/hooks/useMergeRefs.js +16 -0
  40. package/esm/core/hooks/useMergeRefs.js.map +7 -0
  41. package/esm/core/index.js.map +2 -2
  42. package/esm/core/styles/focusRing.css +88 -0
  43. package/esm/core/styles/focusRing.sty.js +9 -0
  44. package/esm/core/styles/focusRing.sty.js.map +7 -0
  45. package/esm/core/styles/useFocusRing.js +69 -0
  46. package/esm/core/styles/useFocusRing.js.map +7 -0
  47. package/esm/core/types/a11y-props.js +1 -0
  48. package/esm/core/types/a11y-props.js.map +7 -0
  49. package/esm/core/types/dom.js +1 -0
  50. package/esm/core/types/dom.js.map +7 -0
  51. package/esm/core/types/focusable-element.js +1 -0
  52. package/esm/core/types/focusable-element.js.map +7 -0
  53. package/esm/core/types/heading.js +1 -0
  54. package/esm/core/types/heading.js.map +7 -0
  55. package/esm/core/types/masking-props.js +1 -0
  56. package/esm/core/types/masking-props.js.map +7 -0
  57. package/esm/core/types/polymorph.js +1 -0
  58. package/esm/core/types/polymorph.js.map +7 -0
  59. package/esm/core/utils/colorUtils.css +80 -0
  60. package/esm/core/utils/colorUtils.sty.js +9 -0
  61. package/esm/core/utils/colorUtils.sty.js.map +7 -0
  62. package/esm/index.js +2 -0
  63. package/esm/index.js.map +2 -2
  64. package/esm/layouts/Divider/Divider.css +23 -0
  65. package/esm/layouts/Divider/Divider.js +39 -0
  66. package/esm/layouts/Divider/Divider.js.map +7 -0
  67. package/esm/layouts/Divider/Divider.sty.js +8 -0
  68. package/esm/layouts/Divider/Divider.sty.js.map +7 -0
  69. package/esm/layouts/index.js +5 -0
  70. package/esm/layouts/index.js.map +7 -0
  71. package/esm/styles/textStyle.css +64 -0
  72. package/esm/styles/textStyle.sty.js +7 -0
  73. package/esm/styles/textStyle.sty.js.map +7 -0
  74. package/esm/typography/BlockQuote/Blockquote.css +17 -0
  75. package/esm/typography/BlockQuote/Blockquote.js +34 -0
  76. package/esm/typography/BlockQuote/Blockquote.js.map +7 -0
  77. package/esm/typography/BlockQuote/Blockquote.sty.js +6 -0
  78. package/esm/typography/BlockQuote/Blockquote.sty.js.map +7 -0
  79. package/esm/typography/Code/Code.css +16 -0
  80. package/esm/typography/Code/Code.js +34 -0
  81. package/esm/typography/Code/Code.js.map +7 -0
  82. package/esm/typography/Code/Code.sty.js +6 -0
  83. package/esm/typography/Code/Code.sty.js.map +7 -0
  84. package/esm/typography/Emphasis/Emphasis.css +4 -0
  85. package/esm/typography/Emphasis/Emphasis.js +34 -0
  86. package/esm/typography/Emphasis/Emphasis.js.map +7 -0
  87. package/esm/typography/Emphasis/Emphasis.sty.js +6 -0
  88. package/esm/typography/Emphasis/Emphasis.sty.js.map +7 -0
  89. package/esm/typography/ExternalLink/ExternalLink.css +28 -0
  90. package/esm/typography/ExternalLink/ExternalLink.js +56 -0
  91. package/esm/typography/ExternalLink/ExternalLink.js.map +7 -0
  92. package/esm/typography/ExternalLink/ExternalLink.sty.js +6 -0
  93. package/esm/typography/ExternalLink/ExternalLink.sty.js.map +7 -0
  94. package/esm/typography/Heading/Heading.css +54 -0
  95. package/esm/typography/Heading/Heading.js +36 -0
  96. package/esm/typography/Heading/Heading.js.map +7 -0
  97. package/esm/typography/Heading/Heading.sty.js +7 -0
  98. package/esm/typography/Heading/Heading.sty.js.map +7 -0
  99. package/esm/typography/Highlight/Highlight.css +4 -0
  100. package/esm/typography/Highlight/Highlight.js +111 -0
  101. package/esm/typography/Highlight/Highlight.js.map +7 -0
  102. package/esm/typography/Highlight/Highlight.sty.js +6 -0
  103. package/esm/typography/Highlight/Highlight.sty.js.map +7 -0
  104. package/esm/typography/Link/Link.css +15 -0
  105. package/esm/typography/Link/Link.js +49 -0
  106. package/esm/typography/Link/Link.js.map +7 -0
  107. package/esm/typography/Link/Link.sty.js +6 -0
  108. package/esm/typography/Link/Link.sty.js.map +7 -0
  109. package/esm/typography/List/List.css +16 -0
  110. package/esm/typography/List/List.js +81 -0
  111. package/esm/typography/List/List.js.map +7 -0
  112. package/esm/typography/List/List.sty.js +8 -0
  113. package/esm/typography/List/List.sty.js.map +7 -0
  114. package/esm/typography/Paragraph/Paragraph.css +19 -0
  115. package/esm/typography/Paragraph/Paragraph.js +49 -0
  116. package/esm/typography/Paragraph/Paragraph.js.map +7 -0
  117. package/esm/typography/Paragraph/Paragraph.sty.js +7 -0
  118. package/esm/typography/Paragraph/Paragraph.sty.js.map +7 -0
  119. package/esm/typography/Strikethrough/Strikethrough.css +5 -0
  120. package/esm/typography/Strikethrough/Strikethrough.js +32 -0
  121. package/esm/typography/Strikethrough/Strikethrough.js.map +7 -0
  122. package/esm/typography/Strikethrough/Strikethrough.sty.js +6 -0
  123. package/esm/typography/Strikethrough/Strikethrough.sty.js.map +7 -0
  124. package/esm/typography/Strong/Strong.css +4 -0
  125. package/esm/typography/Strong/Strong.js +34 -0
  126. package/esm/typography/Strong/Strong.js.map +7 -0
  127. package/esm/typography/Strong/Strong.sty.js +6 -0
  128. package/esm/typography/Strong/Strong.sty.js.map +7 -0
  129. package/esm/typography/Text/Text.css +18 -0
  130. package/esm/typography/Text/Text.js +43 -0
  131. package/esm/typography/Text/Text.js.map +7 -0
  132. package/esm/typography/Text/Text.sty.js +7 -0
  133. package/esm/typography/Text/Text.sty.js.map +7 -0
  134. package/esm/typography/TextEllipsis/TextEllipsis.css +22 -0
  135. package/esm/typography/TextEllipsis/TextEllipsis.js +143 -0
  136. package/esm/typography/TextEllipsis/TextEllipsis.js.map +7 -0
  137. package/esm/typography/TextEllipsis/TextEllipsis.sty.js +7 -0
  138. package/esm/typography/TextEllipsis/TextEllipsis.sty.js.map +7 -0
  139. package/esm/typography/index.js +43 -0
  140. package/esm/typography/index.js.map +7 -0
  141. package/esm/typography/utils.js +101 -0
  142. package/esm/typography/utils.js.map +7 -0
  143. package/index.d.ts +2 -0
  144. package/index.js +2 -0
  145. package/lang/en.json +6 -0
  146. package/lang/uncompiled/en.json +6 -1
  147. package/layouts/Divider/Divider.css +23 -0
  148. package/layouts/Divider/Divider.d.ts +39 -0
  149. package/layouts/Divider/Divider.js +67 -0
  150. package/layouts/Divider/Divider.sty.d.ts +16 -0
  151. package/layouts/Divider/Divider.sty.js +26 -0
  152. package/layouts/index.d.ts +2 -0
  153. package/layouts/index.js +23 -0
  154. package/package.json +17 -2
  155. package/styles/textStyle.css +64 -0
  156. package/styles/textStyle.sty.d.ts +12 -0
  157. package/styles/textStyle.sty.js +25 -0
  158. package/testing/custom-render.d.ts +1 -1
  159. package/testing/mocks/resize-observer-mock.d.ts +1 -1
  160. package/testing/mocks/text-ellipsis-mock.d.ts +1 -1
  161. package/testing/mocks/text-ellipsis-mock.js +8 -3
  162. package/typography/BlockQuote/Blockquote.css +17 -0
  163. package/typography/BlockQuote/Blockquote.d.ts +19 -0
  164. package/typography/BlockQuote/Blockquote.js +62 -0
  165. package/typography/BlockQuote/Blockquote.sty.d.ts +1 -0
  166. package/typography/BlockQuote/Blockquote.sty.js +24 -0
  167. package/typography/Code/Code.css +16 -0
  168. package/typography/Code/Code.d.ts +17 -0
  169. package/typography/Code/Code.js +62 -0
  170. package/typography/Code/Code.sty.d.ts +1 -0
  171. package/typography/Code/Code.sty.js +24 -0
  172. package/typography/Emphasis/Emphasis.css +4 -0
  173. package/typography/Emphasis/Emphasis.d.ts +14 -0
  174. package/typography/Emphasis/Emphasis.js +62 -0
  175. package/typography/Emphasis/Emphasis.sty.d.ts +1 -0
  176. package/typography/Emphasis/Emphasis.sty.js +24 -0
  177. package/typography/ExternalLink/ExternalLink.css +28 -0
  178. package/typography/ExternalLink/ExternalLink.d.ts +21 -0
  179. package/typography/ExternalLink/ExternalLink.js +82 -0
  180. package/typography/ExternalLink/ExternalLink.sty.d.ts +1 -0
  181. package/typography/ExternalLink/ExternalLink.sty.js +24 -0
  182. package/typography/Heading/Heading.css +54 -0
  183. package/typography/Heading/Heading.d.ts +24 -0
  184. package/typography/Heading/Heading.js +64 -0
  185. package/typography/Heading/Heading.sty.d.ts +52 -0
  186. package/typography/Heading/Heading.sty.js +25 -0
  187. package/typography/Highlight/Highlight.css +4 -0
  188. package/typography/Highlight/Highlight.d.ts +27 -0
  189. package/typography/Highlight/Highlight.js +139 -0
  190. package/typography/Highlight/Highlight.sty.d.ts +1 -0
  191. package/typography/Highlight/Highlight.sty.js +24 -0
  192. package/typography/Link/Link.css +15 -0
  193. package/typography/Link/Link.d.ts +17 -0
  194. package/typography/Link/Link.js +75 -0
  195. package/typography/Link/Link.sty.d.ts +1 -0
  196. package/typography/Link/Link.sty.js +24 -0
  197. package/typography/List/List.css +16 -0
  198. package/typography/List/List.d.ts +39 -0
  199. package/typography/List/List.js +109 -0
  200. package/typography/List/List.sty.d.ts +2 -0
  201. package/typography/List/List.sty.js +26 -0
  202. package/typography/Paragraph/Paragraph.css +19 -0
  203. package/typography/Paragraph/Paragraph.d.ts +19 -0
  204. package/typography/Paragraph/Paragraph.js +77 -0
  205. package/typography/Paragraph/Paragraph.sty.d.ts +16 -0
  206. package/typography/Paragraph/Paragraph.sty.js +25 -0
  207. package/typography/Strikethrough/Strikethrough.css +5 -0
  208. package/typography/Strikethrough/Strikethrough.d.ts +15 -0
  209. package/typography/Strikethrough/Strikethrough.js +60 -0
  210. package/typography/Strikethrough/Strikethrough.sty.d.ts +1 -0
  211. package/typography/Strikethrough/Strikethrough.sty.js +24 -0
  212. package/typography/Strong/Strong.css +4 -0
  213. package/typography/Strong/Strong.d.ts +14 -0
  214. package/typography/Strong/Strong.js +62 -0
  215. package/typography/Strong/Strong.sty.d.ts +1 -0
  216. package/typography/Strong/Strong.sty.js +24 -0
  217. package/typography/Text/Text.css +18 -0
  218. package/typography/Text/Text.d.ts +26 -0
  219. package/typography/Text/Text.js +71 -0
  220. package/typography/Text/Text.sty.d.ts +16 -0
  221. package/typography/Text/Text.sty.js +25 -0
  222. package/typography/TextEllipsis/TextEllipsis.css +22 -0
  223. package/typography/TextEllipsis/TextEllipsis.d.ts +32 -0
  224. package/typography/TextEllipsis/TextEllipsis.js +167 -0
  225. package/typography/TextEllipsis/TextEllipsis.sty.d.ts +15 -0
  226. package/typography/TextEllipsis/TextEllipsis.sty.js +25 -0
  227. package/typography/index.d.ts +28 -0
  228. package/typography/index.js +54 -0
  229. package/typography/utils.d.ts +52 -0
  230. package/typography/utils.js +119 -0
@@ -0,0 +1,64 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Heading_exports = {};
29
+ __export(Heading_exports, {
30
+ Heading: () => Heading
31
+ });
32
+ module.exports = __toCommonJS(Heading_exports);
33
+ var import_clsx = __toESM(require("clsx"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_Heading_css = require("./Heading.sty.js");
36
+ const Heading = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
37
+ const {
38
+ level,
39
+ children,
40
+ as,
41
+ "data-testid": dataTestId,
42
+ "data-dtrum-mask": dataDtrumMask,
43
+ "data-dtrum-allow": dataDtrumAllow,
44
+ className: consumerClassName,
45
+ style: consumerStyle,
46
+ ...remainingProps
47
+ } = props;
48
+ const visualLevel = level ?? 1;
49
+ const HeadingTag = as ?? `h${visualLevel}`;
50
+ return /* @__PURE__ */ import_react.default.createElement(
51
+ HeadingTag,
52
+ {
53
+ ref: forwardedRef,
54
+ "data-testid": dataTestId,
55
+ "data-dtrum-mask": dataDtrumMask,
56
+ "data-dtrum-allow": dataDtrumAllow,
57
+ className: (0, import_clsx.default)((0, import_Heading_css.headingCSS)({ visualLevel }), consumerClassName),
58
+ style: consumerStyle,
59
+ ...remainingProps
60
+ },
61
+ children
62
+ );
63
+ });
64
+ Heading.displayName = "Heading";
@@ -0,0 +1,52 @@
1
+ export declare const headingCSS: import("@vanilla-extract/recipes").RuntimeFn<{
2
+ visualLevel: {
3
+ 1: {
4
+ fontFamily: string;
5
+ fontSize: string;
6
+ fontWeight: string;
7
+ lineHeight: string;
8
+ textTransform: any;
9
+ textDecoration: string;
10
+ };
11
+ 2: {
12
+ fontFamily: string;
13
+ fontSize: string;
14
+ fontWeight: string;
15
+ lineHeight: string;
16
+ textTransform: any;
17
+ textDecoration: string;
18
+ };
19
+ 3: {
20
+ fontFamily: string;
21
+ fontSize: string;
22
+ fontWeight: string;
23
+ lineHeight: string;
24
+ textTransform: any;
25
+ textDecoration: string;
26
+ };
27
+ 4: {
28
+ fontFamily: string;
29
+ fontSize: string;
30
+ fontWeight: string;
31
+ lineHeight: string;
32
+ textTransform: any;
33
+ textDecoration: string;
34
+ };
35
+ 5: {
36
+ fontFamily: string;
37
+ fontSize: string;
38
+ fontWeight: string;
39
+ lineHeight: string;
40
+ textTransform: any;
41
+ textDecoration: string;
42
+ };
43
+ 6: {
44
+ fontFamily: string;
45
+ fontSize: string;
46
+ fontWeight: string;
47
+ lineHeight: string;
48
+ textTransform: any;
49
+ textDecoration: string;
50
+ };
51
+ };
52
+ }>;
@@ -0,0 +1,25 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Heading_css_exports = {};
19
+ __export(Heading_css_exports, {
20
+ headingCSS: () => headingCSS
21
+ });
22
+ module.exports = __toCommonJS(Heading_css_exports);
23
+ var import_Heading_css_ts_vanilla = require("./Heading.css");
24
+ var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
25
+ var headingCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Heading_headingCSS__u4t9450", variantClassNames: { visualLevel: { "1": "Heading_headingCSS_visualLevel_1__u4t9451", "2": "Heading_headingCSS_visualLevel_2__u4t9452", "3": "Heading_headingCSS_visualLevel_3__u4t9453", "4": "Heading_headingCSS_visualLevel_4__u4t9454", "5": "Heading_headingCSS_visualLevel_5__u4t9455", "6": "Heading_headingCSS_visualLevel_6__u4t9456" } }, defaultVariants: {}, compoundVariants: [] });
@@ -0,0 +1,4 @@
1
+ .Highlight_highlightCSS__1u4tng00 {
2
+ color: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
3
+ background: var(--dt-colors-background-container-neutral-accent, #5a5b8c);
4
+ }
@@ -0,0 +1,27 @@
1
+ import { ReactElement } from 'react';
2
+ import { type DataTestId, type WithChildren } from '../../core/index.js';
3
+ import type { MaskingProps } from '../../core/types/masking-props.js';
4
+ /**
5
+ * The props for the Heading component.
6
+ * @public
7
+ */
8
+ export interface HighlightProps extends WithChildren, DataTestId, MaskingProps {
9
+ /**
10
+ * Either a substring or an array of multiple different substrings that
11
+ * should be highlighted in the projected content.
12
+ * Every occurrence of the string(s) is highlighted accordingly.
13
+ */
14
+ term: string | string[];
15
+ /**
16
+ * Property that determines whether the highlighting search is case-sensitive.
17
+ * If set to `true`, the component searches for case sensitive occurrences.
18
+ * @defaultValue false
19
+ */
20
+ caseSensitive?: boolean;
21
+ }
22
+ /**
23
+ * @public
24
+ * Use the `Highlight` component to highlight one or more substrings within a
25
+ * text.
26
+ */
27
+ export declare const Highlight: (props: HighlightProps) => ReactElement;
@@ -0,0 +1,139 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Highlight_exports = {};
29
+ __export(Highlight_exports, {
30
+ Highlight: () => Highlight
31
+ });
32
+ module.exports = __toCommonJS(Highlight_exports);
33
+ var import_clsx = __toESM(require("clsx"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_Highlight_css = require("./Highlight.sty.js");
36
+ const HTML_CHARS_OVERRIDES = [
37
+ [/&lt;/g, "<"],
38
+ [/&gt;/g, ">"],
39
+ [/&amp;/g, "&"],
40
+ [/&nbsp;/g, " "]
41
+ ];
42
+ function escapeRegExp(text) {
43
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
44
+ }
45
+ function highlightChildren(children, term, caseSensitive, dataTestId, dataDtrumMask, dataDtrumAllow) {
46
+ const terms = (() => {
47
+ if (Array.isArray(term)) {
48
+ return term.filter((t) => t);
49
+ }
50
+ return term ? [term] : [];
51
+ })();
52
+ return terms.length > 0 ? import_react.default.Children.map(
53
+ children,
54
+ (child) => highlightRecursive(
55
+ child,
56
+ terms,
57
+ caseSensitive,
58
+ dataTestId,
59
+ dataDtrumMask,
60
+ dataDtrumAllow
61
+ )
62
+ ) : children;
63
+ }
64
+ function highlightRecursive(sourceElement, terms, caseSensitive, dataTestId, dataDtrumMask, dataDtrumAllow) {
65
+ if (!sourceElement) {
66
+ return sourceElement;
67
+ }
68
+ if (import_react.default.isValidElement(sourceElement)) {
69
+ const children = import_react.default.Children.map(
70
+ sourceElement.props.children,
71
+ (child) => highlightRecursive(
72
+ child,
73
+ terms,
74
+ caseSensitive,
75
+ dataTestId,
76
+ dataDtrumMask,
77
+ dataDtrumAllow
78
+ )
79
+ );
80
+ return import_react.default.cloneElement(sourceElement, sourceElement.props, children);
81
+ }
82
+ return highlightLeafElement(
83
+ sourceElement,
84
+ terms,
85
+ caseSensitive,
86
+ dataTestId,
87
+ dataDtrumMask,
88
+ dataDtrumAllow
89
+ );
90
+ }
91
+ function highlightLeafElement(textContent, terms, caseSensitive, dataTestId, dataDtrumMask, dataDtrumAllow) {
92
+ if (terms.length === 0) {
93
+ return textContent;
94
+ }
95
+ const sanitizedTextContent = HTML_CHARS_OVERRIDES.reduce(
96
+ (text, [needle, replacement]) => text.replace(needle, replacement),
97
+ `${textContent}`
98
+ );
99
+ const termsInLowerCase = terms.map((t) => t.toLowerCase());
100
+ return getTextTokens(sanitizedTextContent, terms, caseSensitive).map(
101
+ (token) => termsInLowerCase.includes(token.toLowerCase()) ? /* @__PURE__ */ import_react.default.createElement(
102
+ "mark",
103
+ {
104
+ role: "mark",
105
+ className: (0, import_clsx.default)(import_Highlight_css.highlightCSS),
106
+ "data-dtrum-mask": dataDtrumMask,
107
+ "data-dtrum-allow": dataDtrumAllow
108
+ },
109
+ token
110
+ ) : /* @__PURE__ */ import_react.default.createElement("span", null, token)
111
+ );
112
+ }
113
+ function getTextTokens(textContent, terms, caseSensitive) {
114
+ const flags = caseSensitive ? "gm" : "gmi";
115
+ const regExp = new RegExp(
116
+ `(${terms.map((t) => escapeRegExp(t)).join("|")})`,
117
+ flags
118
+ );
119
+ return textContent.toString().split(regExp).filter((s) => s.length > 0);
120
+ }
121
+ const Highlight = (props) => {
122
+ const {
123
+ children,
124
+ term,
125
+ caseSensitive = false,
126
+ "data-testid": dataTestId,
127
+ "data-dtrum-mask": dataDtrumMask,
128
+ "data-dtrum-allow": dataDtrumAllow
129
+ } = props;
130
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, highlightChildren(
131
+ children,
132
+ term,
133
+ caseSensitive,
134
+ dataTestId,
135
+ dataDtrumMask,
136
+ dataDtrumAllow
137
+ ));
138
+ };
139
+ Highlight.displayName = "Highlight";
@@ -0,0 +1 @@
1
+ export declare const highlightCSS: string;
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Highlight_css_exports = {};
19
+ __export(Highlight_css_exports, {
20
+ highlightCSS: () => highlightCSS
21
+ });
22
+ module.exports = __toCommonJS(Highlight_css_exports);
23
+ var import_Highlight_css_ts_vanilla = require("./Highlight.css");
24
+ var highlightCSS = "Highlight_highlightCSS__1u4tng00";
@@ -0,0 +1,15 @@
1
+ .Link_linkCSS__1ck42do0 {
2
+ display: inline-block;
3
+ color: var(--dt-colors-text-primary-default, #454cc9);
4
+ text-decoration: underline;
5
+ overflow-wrap: anywhere;
6
+ }
7
+ .Link_linkCSS__1ck42do0:hover {
8
+ color: var(--dt-colors-text-primary-default-hover, #3332ae);
9
+ }
10
+ .Link_linkCSS__1ck42do0:active {
11
+ color: var(--dt-colors-text-primary-default-active, #241193);
12
+ }
13
+ .Link_linkCSS__1ck42do0:focus-visible {
14
+ text-decoration: none;
15
+ }
@@ -0,0 +1,17 @@
1
+ import { ElementType, ReactElement } from 'react';
2
+ import { type DataTestId, type StylingProps, type WithChildren } from '../../core/index.js';
3
+ import type { MaskingProps } from '../../core/types/masking-props.js';
4
+ import type { PolymorphicComponentProps } from '../../core/types/polymorph.js';
5
+ /**
6
+ * The props for the Link component.
7
+ * @public
8
+ */
9
+ export type LinkProps<E extends ElementType> = PolymorphicComponentProps<E, WithChildren & StylingProps & DataTestId & MaskingProps>;
10
+ /**
11
+ * @public
12
+ * Use the `Link` component to navigate to a different page within the application.
13
+ * For external resources in a different domain, use the
14
+ * {@link https://developer.dynatrace.com/reference/design-system/preview/typography/ExternalLink/ | `ExternalLink`}
15
+ * component instead.
16
+ */
17
+ export declare const Link: <E extends ElementType = 'a'>(props: LinkProps<E>) => ReactElement | null;
@@ -0,0 +1,75 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Link_exports = {};
29
+ __export(Link_exports, {
30
+ Link: () => Link
31
+ });
32
+ module.exports = __toCommonJS(Link_exports);
33
+ var import_clsx = __toESM(require("clsx"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_core = require("../../core/index.js");
36
+ var import_useFocusRing = require("../../core/styles/useFocusRing.js");
37
+ var import_Link_css = require("../Link/Link.sty.js");
38
+ const Link = /* @__PURE__ */ (0, import_react.forwardRef)(
39
+ ({
40
+ children,
41
+ as,
42
+ "data-testid": dataTestId,
43
+ "data-dtrum-mask": dataDtrumMask,
44
+ "data-dtrum-allow": dataDtrumAllow,
45
+ className: consumerClassName,
46
+ style: consumerStyle,
47
+ ...remainingProps
48
+ }, ref) => {
49
+ const { focusProps, focusClassName } = (0, import_useFocusRing.useFocusRing)({
50
+ variant: "primary",
51
+ isMinimal: true
52
+ });
53
+ const LinkTag = as || "a";
54
+ return /* @__PURE__ */ import_react.default.createElement(
55
+ LinkTag,
56
+ {
57
+ ref,
58
+ "data-testid": dataTestId,
59
+ "data-dtrum-mask": dataDtrumMask,
60
+ "data-dtrum-allow": dataDtrumAllow,
61
+ className: (0, import_clsx.default)(focusClassName, import_Link_css.linkCSS, consumerClassName),
62
+ style: consumerStyle,
63
+ ...(0, import_core._mergeProps)(
64
+ // Need to cast this one as the inference of mergeProps would generate
65
+ // a not allowed overlap. The remainingProps type is too complex due to the
66
+ // polymorphic inheritance.
67
+ remainingProps,
68
+ focusProps
69
+ )
70
+ },
71
+ children
72
+ );
73
+ }
74
+ );
75
+ Link.displayName = "Link";
@@ -0,0 +1 @@
1
+ export declare const linkCSS: string;
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Link_css_exports = {};
19
+ __export(Link_css_exports, {
20
+ linkCSS: () => linkCSS
21
+ });
22
+ module.exports = __toCommonJS(Link_css_exports);
23
+ var import_Link_css_ts_vanilla = require("./Link.css");
24
+ var linkCSS = "Link_linkCSS__1ck42do0";
@@ -0,0 +1,16 @@
1
+ .List_listCSS__13d6w3n0 {
2
+ margin: 0;
3
+ padding-left: var(--dt-spacings-size-40, 40px);
4
+ }
5
+ .List_listCSS__13d6w3n0 .List_listCSS__13d6w3n0 {
6
+ margin-block: var(--dt-spacings-size-4, 4px);
7
+ padding-left: var(--dt-spacings-size-28, 28px);
8
+ }
9
+ .List_listItemCSS__13d6w3n1 {
10
+ position: relative;
11
+ overflow-wrap: break-word;
12
+ margin-block: var(--dt-spacings-size-2, 2px);
13
+ }
14
+ .List_listItemCSS__13d6w3n1::marker {
15
+ font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
16
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { DataTestId } from '../../core/types/data-props.js';
3
+ import type { MaskingProps } from '../../core/types/masking-props.js';
4
+ import { StylingProps } from '../../core/types/styling-props.js';
5
+ import { WithChildren } from '../../core/types/with-children.js';
6
+ /**
7
+ * The props for the Link component.
8
+ * @public
9
+ */
10
+ export interface ListProps<TOrdered extends boolean = false> extends WithChildren, StylingProps, DataTestId, MaskingProps {
11
+ /**
12
+ * Whether the List is ordered or not. This changes whether numbers or bullets are used.
13
+ * @defaultValue false
14
+ */
15
+ ordered?: TOrdered;
16
+ /**
17
+ * Sets the text style for the List.
18
+ * @defaultValue 'base'
19
+ */
20
+ textStyle?: 'base' | 'base-emphasized' | 'small' | 'small-emphasized';
21
+ /**
22
+ * Sets the text style for the List.
23
+ * @defaultValue 'text'
24
+ */
25
+ fontStyle?: 'text' | 'code';
26
+ /**
27
+ * Sets the starting number of the first item in an ordered list.
28
+ * The value is always treated as an integer (floor).
29
+ * @defaultValue 1
30
+ */
31
+ start?: number;
32
+ }
33
+ /**
34
+ * @public
35
+ * The `List` component groups a set of related content in a list and can be arbitrarily nested.
36
+ * List items are preceded by either a consecutive number (for ordered lists) or a bullet point
37
+ * (for unordered lists).
38
+ */
39
+ export declare const List: <TOrdered extends boolean = false>(props: ListProps<TOrdered> & React.RefAttributes<TOrdered extends true ? HTMLOListElement : HTMLUListElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
@@ -0,0 +1,109 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var List_exports = {};
29
+ __export(List_exports, {
30
+ List: () => List
31
+ });
32
+ module.exports = __toCommonJS(List_exports);
33
+ var import_clsx = __toESM(require("clsx"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_List_css = require("./List.sty.js");
36
+ var import_Text = require("../Text/Text.js");
37
+ function interleaveListItems(listItems) {
38
+ const items = [];
39
+ import_react.default.Children.forEach(listItems, (listItem) => {
40
+ if (import_react.default.isValidElement(listItem)) {
41
+ if (listItem.type === List) {
42
+ if (items.length === 0) {
43
+ items.push([listItem]);
44
+ } else {
45
+ items[items.length - 1].push(listItem);
46
+ }
47
+ } else {
48
+ items.push([listItem]);
49
+ }
50
+ }
51
+ });
52
+ return items.map((values, index) => {
53
+ const itemKey = `list-item-${getItemKey(values, index)}`;
54
+ return /* @__PURE__ */ import_react.default.createElement("li", { key: itemKey, className: import_List_css.listItemCSS }, values);
55
+ });
56
+ }
57
+ function getItemKey(values, index) {
58
+ const isArray = Array.isArray(values);
59
+ const value = isArray ? values?.[0] : values;
60
+ if (import_react.default.isValidElement(value)) {
61
+ if (value.key) {
62
+ return value.key;
63
+ } else if (value.props && value.props.children) {
64
+ return getItemKey(value.props.children, index);
65
+ }
66
+ return value;
67
+ }
68
+ if (value === void 0) {
69
+ return index;
70
+ }
71
+ return value;
72
+ }
73
+ const List = /* @__PURE__ */ (0, import_react.forwardRef)(
74
+ (props, ref) => {
75
+ const {
76
+ children,
77
+ ordered = false,
78
+ textStyle,
79
+ fontStyle,
80
+ start = 1,
81
+ "data-testid": dataTestId,
82
+ "data-dtrum-mask": dataDtrumMask,
83
+ "data-dtrum-allow": dataDtrumAllow,
84
+ className: consumerClassName,
85
+ style: consumerStyle,
86
+ ...remainingProps
87
+ } = props;
88
+ return /* @__PURE__ */ import_react.default.createElement(
89
+ import_Text.Text,
90
+ {
91
+ ref,
92
+ as: ordered ? "ol" : "ul",
93
+ ...ordered && {
94
+ start
95
+ },
96
+ textStyle,
97
+ fontStyle,
98
+ "data-testid": dataTestId,
99
+ "data-dtrum-mask": dataDtrumMask,
100
+ "data-dtrum-allow": dataDtrumAllow,
101
+ className: (0, import_clsx.default)(import_List_css.listCSS, consumerClassName),
102
+ style: consumerStyle,
103
+ ...remainingProps
104
+ },
105
+ interleaveListItems(children)
106
+ );
107
+ }
108
+ );
109
+ List.displayName = "List";
@@ -0,0 +1,2 @@
1
+ export declare const listCSS: string;
2
+ export declare const listItemCSS: string;