@dynatrace/strato-components 0.85.110 → 1.0.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.
Files changed (259) hide show
  1. package/buttons/button/Button.css +17 -17
  2. package/buttons/button/Button.js +1 -1
  3. package/buttons/button/Button.sty.js +4 -4
  4. package/content/progress/ProgressBar.css +71 -71
  5. package/content/progress/ProgressBar.d.ts +0 -7
  6. package/content/progress/ProgressBar.js +19 -45
  7. package/content/progress/ProgressBar.sty.js +5 -5
  8. package/content/progress/ProgressBarIcon.css +2 -2
  9. package/content/progress/ProgressBarIcon.sty.js +1 -1
  10. package/content/progress/ProgressBarLabel.css +3 -3
  11. package/content/progress/ProgressBarLabel.js +1 -1
  12. package/content/progress/ProgressBarLabel.sty.js +1 -1
  13. package/content/progress/ProgressBarValue.css +5 -5
  14. package/content/progress/ProgressBarValue.js +1 -1
  15. package/content/progress/ProgressBarValue.sty.js +1 -1
  16. package/content/progress/ProgressCircle.css +40 -40
  17. package/content/progress/ProgressCircle.d.ts +0 -7
  18. package/content/progress/ProgressCircle.js +2 -10
  19. package/content/progress/ProgressCircle.sty.js +5 -5
  20. package/content/progress/hooks/useProgressBarPropsContext.d.ts +5 -2
  21. package/content/progress/hooks/useProgressBarPropsContext.js +2 -2
  22. package/content/skeleton/Skeleton.css +6 -6
  23. package/content/skeleton/Skeleton.sty.js +1 -1
  24. package/core/components/app-root/AppRoot.css +0 -57
  25. package/core/hooks/useFontsUpdated.d.ts +1 -1
  26. package/core/hooks/useFontsUpdated.js +2 -2
  27. package/core/index.d.ts +0 -2
  28. package/core/index.js +0 -2
  29. package/core/styles/focusRing.css +66 -66
  30. package/core/styles/focusRing.sty.js +2 -2
  31. package/core/utils/colorUtils.css +60 -60
  32. package/core/utils/colorUtils.sty.js +2 -2
  33. package/esm/buttons/button/Button.css +17 -17
  34. package/esm/buttons/button/Button.js +1 -1
  35. package/esm/buttons/button/Button.js.map +2 -2
  36. package/esm/buttons/button/Button.sty.js +4 -4
  37. package/esm/buttons/button/Button.sty.js.map +2 -2
  38. package/esm/content/progress/ProgressBar.css +71 -71
  39. package/esm/content/progress/ProgressBar.js +19 -45
  40. package/esm/content/progress/ProgressBar.js.map +2 -2
  41. package/esm/content/progress/ProgressBar.sty.js +5 -5
  42. package/esm/content/progress/ProgressBar.sty.js.map +2 -2
  43. package/esm/content/progress/ProgressBarIcon.css +2 -2
  44. package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
  45. package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
  46. package/esm/content/progress/ProgressBarLabel.css +3 -3
  47. package/esm/content/progress/ProgressBarLabel.js +2 -2
  48. package/esm/content/progress/ProgressBarLabel.js.map +2 -2
  49. package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
  50. package/esm/content/progress/ProgressBarLabel.sty.js.map +2 -2
  51. package/esm/content/progress/ProgressBarValue.css +5 -5
  52. package/esm/content/progress/ProgressBarValue.js +2 -2
  53. package/esm/content/progress/ProgressBarValue.js.map +2 -2
  54. package/esm/content/progress/ProgressBarValue.sty.js +1 -1
  55. package/esm/content/progress/ProgressBarValue.sty.js.map +2 -2
  56. package/esm/content/progress/ProgressCircle.css +40 -40
  57. package/esm/content/progress/ProgressCircle.js +2 -10
  58. package/esm/content/progress/ProgressCircle.js.map +2 -2
  59. package/esm/content/progress/ProgressCircle.sty.js +5 -5
  60. package/esm/content/progress/ProgressCircle.sty.js.map +2 -2
  61. package/esm/content/progress/hooks/useProgressBarPropsContext.js +2 -2
  62. package/esm/content/progress/hooks/useProgressBarPropsContext.js.map +2 -2
  63. package/esm/content/skeleton/Skeleton.css +6 -6
  64. package/esm/content/skeleton/Skeleton.sty.js +1 -1
  65. package/esm/content/skeleton/Skeleton.sty.js.map +2 -2
  66. package/esm/core/components/app-root/AppRoot.css +0 -57
  67. package/esm/core/hooks/useFontsUpdated.js +2 -2
  68. package/esm/core/hooks/useFontsUpdated.js.map +2 -2
  69. package/esm/core/index.js +0 -2
  70. package/esm/core/index.js.map +2 -2
  71. package/esm/core/styles/focusRing.css +66 -66
  72. package/esm/core/styles/focusRing.sty.js +2 -2
  73. package/esm/core/styles/focusRing.sty.js.map +2 -2
  74. package/esm/core/utils/colorUtils.css +60 -60
  75. package/esm/core/utils/colorUtils.sty.js +2 -2
  76. package/esm/core/utils/colorUtils.sty.js.map +2 -2
  77. package/esm/layouts/container/Container.css +4 -4
  78. package/esm/layouts/container/Container.sty.js +1 -1
  79. package/esm/layouts/container/Container.sty.js.map +1 -1
  80. package/esm/layouts/divider/Divider.css +6 -6
  81. package/esm/layouts/divider/Divider.sty.js +1 -1
  82. package/esm/layouts/divider/Divider.sty.js.map +2 -2
  83. package/esm/layouts/input-group/InputGroup.css +4 -4
  84. package/esm/layouts/input-group/InputGroup.sty.js +2 -2
  85. package/esm/layouts/input-group/InputGroup.sty.js.map +1 -1
  86. package/esm/layouts/surface/Surface.css +39 -39
  87. package/esm/layouts/surface/Surface.sty.js +2 -2
  88. package/esm/layouts/surface/Surface.sty.js.map +2 -2
  89. package/esm/layouts/surface/variables.sty.js +1 -1
  90. package/esm/layouts/surface/variables.sty.js.map +1 -1
  91. package/esm/styles/colorUtils.css +60 -60
  92. package/esm/styles/colorUtils.sty.js +2 -2
  93. package/esm/styles/colorUtils.sty.js.map +2 -2
  94. package/esm/styles/container.css +47 -47
  95. package/esm/styles/container.sty.js +2 -2
  96. package/esm/styles/container.sty.js.map +2 -2
  97. package/esm/styles/ellipsis.css +1 -1
  98. package/esm/styles/ellipsis.sty.js +1 -1
  99. package/esm/styles/ellipsis.sty.js.map +1 -1
  100. package/esm/styles/field.css +153 -153
  101. package/esm/styles/field.sty.js +2 -2
  102. package/esm/styles/field.sty.js.map +2 -2
  103. package/esm/styles/sprinkles.css +262 -262
  104. package/esm/styles/sprinkles.sty.js +1 -1
  105. package/esm/styles/sprinkles.sty.js.map +2 -2
  106. package/esm/styles/textStyle.css +8 -8
  107. package/esm/styles/textStyle.sty.js +1 -1
  108. package/esm/styles/textStyle.sty.js.map +2 -2
  109. package/esm/typography/block-quote/Blockquote.css +2 -2
  110. package/esm/typography/block-quote/Blockquote.sty.js +1 -1
  111. package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
  112. package/esm/typography/code/Code.css +1 -1
  113. package/esm/typography/code/Code.sty.js +1 -1
  114. package/esm/typography/code/Code.sty.js.map +1 -1
  115. package/esm/typography/emphasis/Emphasis.css +1 -1
  116. package/esm/typography/emphasis/Emphasis.sty.js +1 -1
  117. package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
  118. package/esm/typography/external-link/ExternalLink.css +6 -6
  119. package/esm/typography/external-link/ExternalLink.sty.js +1 -1
  120. package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
  121. package/esm/typography/heading/Heading.css +7 -7
  122. package/esm/typography/heading/Heading.sty.js +1 -1
  123. package/esm/typography/heading/Heading.sty.js.map +2 -2
  124. package/esm/typography/highlight/Highlight.css +1 -1
  125. package/esm/typography/highlight/Highlight.sty.js +1 -1
  126. package/esm/typography/highlight/Highlight.sty.js.map +1 -1
  127. package/esm/typography/index.js +12 -12
  128. package/esm/typography/index.js.map +2 -2
  129. package/esm/typography/link/Link.css +4 -4
  130. package/esm/typography/link/Link.sty.js +1 -1
  131. package/esm/typography/link/Link.sty.js.map +1 -1
  132. package/esm/typography/list/List.css +4 -4
  133. package/esm/typography/list/List.sty.js +2 -2
  134. package/esm/typography/list/List.sty.js.map +1 -1
  135. package/esm/typography/paragraph/Paragraph.css +3 -3
  136. package/esm/typography/paragraph/Paragraph.sty.js +1 -1
  137. package/esm/typography/paragraph/Paragraph.sty.js.map +2 -2
  138. package/esm/typography/strikethrough/Strikethrough.css +1 -1
  139. package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
  140. package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
  141. package/esm/typography/strong/Strong.css +1 -1
  142. package/esm/typography/strong/Strong.sty.js +1 -1
  143. package/esm/typography/strong/Strong.sty.js.map +1 -1
  144. package/esm/typography/text/Text.css +3 -3
  145. package/esm/typography/text/Text.sty.js +1 -1
  146. package/esm/typography/text/Text.sty.js.map +2 -2
  147. package/esm/typography/text-ellipsis/TextEllipsis.css +4 -4
  148. package/esm/typography/text-ellipsis/TextEllipsis.js +45 -45
  149. package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
  150. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +1 -1
  151. package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +2 -2
  152. package/esm/typography/utils.js +19 -19
  153. package/esm/typography/utils.js.map +2 -2
  154. package/layouts/container/Container.css +4 -4
  155. package/layouts/container/Container.sty.js +1 -1
  156. package/layouts/divider/Divider.css +6 -6
  157. package/layouts/divider/Divider.sty.js +1 -1
  158. package/layouts/input-group/InputGroup.css +4 -4
  159. package/layouts/input-group/InputGroup.sty.js +2 -2
  160. package/layouts/surface/Surface.css +39 -39
  161. package/layouts/surface/Surface.sty.js +2 -2
  162. package/layouts/surface/variables.sty.js +1 -1
  163. package/package.json +15 -26
  164. package/styles/colorUtils.css +60 -60
  165. package/styles/colorUtils.sty.js +2 -2
  166. package/styles/container.css +47 -47
  167. package/styles/container.sty.js +2 -2
  168. package/styles/ellipsis.css +1 -1
  169. package/styles/ellipsis.sty.js +1 -1
  170. package/styles/field.css +153 -153
  171. package/styles/field.sty.js +2 -2
  172. package/styles/sprinkles.css +262 -262
  173. package/styles/sprinkles.sty.js +1 -1
  174. package/styles/textStyle.css +8 -8
  175. package/styles/textStyle.sty.js +1 -1
  176. package/typography/block-quote/Blockquote.css +2 -2
  177. package/typography/block-quote/Blockquote.sty.js +1 -1
  178. package/typography/code/Code.css +1 -1
  179. package/typography/code/Code.sty.js +1 -1
  180. package/typography/emphasis/Emphasis.css +1 -1
  181. package/typography/emphasis/Emphasis.sty.js +1 -1
  182. package/typography/external-link/ExternalLink.css +6 -6
  183. package/typography/external-link/ExternalLink.sty.js +1 -1
  184. package/typography/heading/Heading.css +7 -7
  185. package/typography/heading/Heading.sty.js +1 -1
  186. package/typography/highlight/Highlight.css +1 -1
  187. package/typography/highlight/Highlight.sty.js +1 -1
  188. package/typography/index.d.ts +3 -3
  189. package/typography/index.js +6 -6
  190. package/typography/link/Link.css +4 -4
  191. package/typography/link/Link.sty.js +1 -1
  192. package/typography/list/List.css +4 -4
  193. package/typography/list/List.sty.js +2 -2
  194. package/typography/paragraph/Paragraph.css +3 -3
  195. package/typography/paragraph/Paragraph.sty.js +1 -1
  196. package/typography/strikethrough/Strikethrough.css +1 -1
  197. package/typography/strikethrough/Strikethrough.sty.js +1 -1
  198. package/typography/strong/Strong.css +1 -1
  199. package/typography/strong/Strong.sty.js +1 -1
  200. package/typography/text/Text.css +3 -3
  201. package/typography/text/Text.sty.js +1 -1
  202. package/typography/text-ellipsis/TextEllipsis.css +4 -4
  203. package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
  204. package/typography/text-ellipsis/TextEllipsis.js +44 -44
  205. package/typography/text-ellipsis/TextEllipsis.sty.js +1 -1
  206. package/typography/utils.d.ts +14 -11
  207. package/typography/utils.js +19 -19
  208. package/core/types/role-variant.d.ts +0 -12
  209. package/core/types/role-variant.js +0 -30
  210. package/esm/core/types/role-variant.js +0 -12
  211. package/esm/core/types/role-variant.js.map +0 -7
  212. package/testing/custom-render.d.ts +0 -12
  213. package/testing/custom-render.js +0 -62
  214. package/testing/index.d.ts +0 -22
  215. package/testing/index.js +0 -91
  216. package/testing/jest/index.d.ts +0 -1
  217. package/testing/jest/index.js +0 -5
  218. package/testing/jest/jest-preset.d.ts +0 -10
  219. package/testing/jest/jest-preset.js +0 -13
  220. package/testing/jest/resolver.d.ts +0 -0
  221. package/testing/jest/resolver.js +0 -27
  222. package/testing/mocks/bounding-client-rect-mock.d.ts +0 -8
  223. package/testing/mocks/bounding-client-rect-mock.js +0 -36
  224. package/testing/mocks/canvas-mock.d.ts +0 -14
  225. package/testing/mocks/canvas-mock.js +0 -192
  226. package/testing/mocks/create-mock-element.d.ts +0 -14
  227. package/testing/mocks/create-mock-element.js +0 -99
  228. package/testing/mocks/create-range-mock.d.ts +0 -10
  229. package/testing/mocks/create-range-mock.js +0 -47
  230. package/testing/mocks/dom-rect-mock.d.ts +0 -19
  231. package/testing/mocks/dom-rect-mock.js +0 -56
  232. package/testing/mocks/fetch-mock.d.ts +0 -9
  233. package/testing/mocks/fetch-mock.js +0 -38
  234. package/testing/mocks/intersection-observer-mock.d.ts +0 -10
  235. package/testing/mocks/intersection-observer-mock.js +0 -58
  236. package/testing/mocks/match-media-mock.d.ts +0 -10
  237. package/testing/mocks/match-media-mock.js +0 -45
  238. package/testing/mocks/offset-height-mock.d.ts +0 -8
  239. package/testing/mocks/offset-height-mock.js +0 -39
  240. package/testing/mocks/offset-width-mock.d.ts +0 -8
  241. package/testing/mocks/offset-width-mock.js +0 -39
  242. package/testing/mocks/pointer-event-mock.d.ts +0 -8
  243. package/testing/mocks/pointer-event-mock.js +0 -42
  244. package/testing/mocks/resize-observer-mock.d.ts +0 -11
  245. package/testing/mocks/resize-observer-mock.js +0 -42
  246. package/testing/mocks/screen-size-mock.d.ts +0 -8
  247. package/testing/mocks/screen-size-mock.js +0 -34
  248. package/testing/mocks/scroll-into-view-mock.d.ts +0 -10
  249. package/testing/mocks/scroll-into-view-mock.js +0 -34
  250. package/testing/mocks/scroll-width-mock.d.ts +0 -8
  251. package/testing/mocks/scroll-width-mock.js +0 -39
  252. package/testing/mocks/select-mock.d.ts +0 -11
  253. package/testing/mocks/select-mock.js +0 -45
  254. package/testing/mocks/table-virtualization-mock.d.ts +0 -10
  255. package/testing/mocks/table-virtualization-mock.js +0 -50
  256. package/testing/mocks/text-ellipsis-mock.d.ts +0 -8
  257. package/testing/mocks/text-ellipsis-mock.js +0 -43
  258. package/testing/setup.d.ts +0 -8
  259. package/testing/setup.js +0 -57
@@ -33,12 +33,12 @@ module.exports = __toCommonJS(TextEllipsis_exports);
33
33
  var import_clsx = __toESM(require("clsx"));
34
34
  var import_react = __toESM(require("react"));
35
35
  var import_use_resize_observer = __toESM(require("use-resize-observer"));
36
- var import_TextEllipsis_css = require("./TextEllipsis.sty.js");
37
36
  var import_useFontsUpdated = require("../../core/hooks/useFontsUpdated.js");
38
37
  var import_useMergeRefs = require("../../core/hooks/useMergeRefs.js");
39
- var import_utils2 = require("../utils.js");
40
- function getFontProps(textWrapper) {
41
- const computedStyle = window.getComputedStyle(textWrapper, null);
38
+ var import_utils = require("../utils.js");
39
+ var import_TextEllipsis_css = require("./TextEllipsis.sty.js");
40
+ function getFontProps(innerSpanElement) {
41
+ const computedStyle = window.getComputedStyle(innerSpanElement, null);
42
42
  return {
43
43
  fontStyle: computedStyle.getPropertyValue("font-style"),
44
44
  fontWeight: computedStyle.getPropertyValue("font-weight"),
@@ -46,50 +46,51 @@ function getFontProps(textWrapper) {
46
46
  fontFamily: computedStyle.getPropertyValue("font-family")
47
47
  };
48
48
  }
49
- function isNativeEllipsisActive(textWrapper, containerWidth) {
49
+ function isNativeEllipsisActive(innerSpanElement, containerWidth) {
50
50
  const originalTextWidth = Math.max(
51
- textWrapper.getBoundingClientRect().width,
52
- textWrapper.scrollWidth
51
+ innerSpanElement.getBoundingClientRect().width,
52
+ innerSpanElement.scrollWidth
53
53
  );
54
54
  const textWidth = Math.floor(originalTextWidth * 100) / 100;
55
55
  return textWidth > containerWidth;
56
56
  }
57
+ function resetFullText(innerSpanElement, originalText) {
58
+ if (innerSpanElement.textContent !== originalText) {
59
+ innerSpanElement.textContent = originalText;
60
+ }
61
+ }
62
+ function getWidth(element) {
63
+ return Math.max(element.getBoundingClientRect().width, element.clientWidth);
64
+ }
65
+ function getContainerWidth(containerElement) {
66
+ return Math.ceil(getWidth(containerElement) * 100) / 100;
67
+ }
68
+ function onTextOverflowCallback(current, wasEllipsized, onTextOverflow) {
69
+ if (onTextOverflow && current !== wasEllipsized) {
70
+ onTextOverflow(current);
71
+ }
72
+ }
57
73
  function renderEllipsizedText(originalText, truncationMode, containerRef, wasEllipsized, onTextOverflow) {
58
74
  const containerElement = containerRef.current;
59
- const textWrapper = containerElement?.firstElementChild || null;
60
- if (containerElement !== null && textWrapper !== null) {
61
- if (textWrapper.textContent !== originalText) {
62
- textWrapper.textContent = originalText;
63
- }
64
- const containerWidth = Math.ceil(containerElement.getBoundingClientRect().width * 100) / 100;
65
- if (truncationMode === "middle") {
66
- if (isNativeEllipsisActive(textWrapper, containerWidth)) {
67
- const ellipsizedText = (0, import_utils2._centerEllipsizeText)(
68
- originalText,
69
- getFontProps(textWrapper),
70
- containerWidth
71
- );
72
- textWrapper.textContent = ellipsizedText;
73
- if (ellipsizedText !== originalText) {
74
- if (onTextOverflow && !wasEllipsized) {
75
- onTextOverflow(true);
76
- }
77
- return true;
78
- }
79
- }
80
- if (onTextOverflow && wasEllipsized) {
81
- onTextOverflow(false);
82
- }
83
- } else if (isNativeEllipsisActive(textWrapper, containerWidth)) {
84
- if (onTextOverflow && !wasEllipsized) {
85
- onTextOverflow(true);
86
- }
87
- return true;
88
- } else if (onTextOverflow && wasEllipsized) {
89
- onTextOverflow(false);
90
- }
75
+ const innerSpanElement = containerElement?.firstElementChild || null;
76
+ if (containerElement === null || innerSpanElement === null) {
77
+ return false;
78
+ }
79
+ resetFullText(innerSpanElement, originalText);
80
+ const containerWidth = getContainerWidth(containerElement);
81
+ if (!isNativeEllipsisActive(innerSpanElement, containerWidth)) {
82
+ onTextOverflowCallback(false, wasEllipsized, onTextOverflow);
83
+ return false;
84
+ }
85
+ if (truncationMode === "middle") {
86
+ innerSpanElement.textContent = (0, import_utils.centerEllipsizeText)(
87
+ originalText,
88
+ getFontProps(innerSpanElement),
89
+ containerWidth
90
+ );
91
91
  }
92
- return false;
92
+ onTextOverflowCallback(true, wasEllipsized, onTextOverflow);
93
+ return true;
93
94
  }
94
95
  const ComputedTextEllipsis = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
95
96
  const {
@@ -103,7 +104,7 @@ const ComputedTextEllipsis = /* @__PURE__ */ (0, import_react.forwardRef)((props
103
104
  "data-dtrum-allow": dataDtrumAllow,
104
105
  ...remainingProps
105
106
  } = props;
106
- const { ref: observerContainerRef } = (0, import_use_resize_observer.default)();
107
+ const { ref: observerContainerRef, width } = (0, import_use_resize_observer.default)();
107
108
  const containerRef = (0, import_react.useRef)(null);
108
109
  const ellipsisStateRef = (0, import_react.useRef)(false);
109
110
  const mergedRef = (0, import_useMergeRefs.useMergeRefs)([
@@ -113,8 +114,7 @@ const ComputedTextEllipsis = /* @__PURE__ */ (0, import_react.forwardRef)((props
113
114
  },
114
115
  forwardedRef
115
116
  ]);
116
- const containerWidth = containerRef.current?.getBoundingClientRect().width;
117
- const fontsUpdated = (0, import_useFontsUpdated._useFontsUpdated)();
117
+ const fontsUpdated = (0, import_useFontsUpdated.useFontsUpdated)();
118
118
  (0, import_react.useLayoutEffect)(() => {
119
119
  ellipsisStateRef.current = renderEllipsizedText(
120
120
  children,
@@ -123,7 +123,7 @@ const ComputedTextEllipsis = /* @__PURE__ */ (0, import_react.forwardRef)((props
123
123
  ellipsisStateRef.current,
124
124
  onTextOverflow
125
125
  );
126
- }, [containerWidth, children, truncationMode, fontsUpdated, onTextOverflow]);
126
+ }, [width, children, truncationMode, fontsUpdated, onTextOverflow]);
127
127
  return /* @__PURE__ */ import_react.default.createElement(
128
128
  "span",
129
129
  {
@@ -22,4 +22,4 @@ __export(TextEllipsis_css_exports, {
22
22
  module.exports = __toCommonJS(TextEllipsis_css_exports);
23
23
  var import_TextEllipsis_css_ts_vanilla = require("./TextEllipsis.css");
24
24
  var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
25
- var textEllipsisCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1mnpbqs0-0-85-110", variantClassNames: { truncationMode: { start: "_1mnpbqs1-0-85-110", middle: "_1mnpbqs2-0-85-110", end: "_1mnpbqs3-0-85-110" } }, defaultVariants: {}, compoundVariants: [] });
25
+ var textEllipsisCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1mnpbqs0-1-0-0", variantClassNames: { truncationMode: { start: "_1mnpbqs1-1-0-0", middle: "_1mnpbqs2-1-0-0", end: "_1mnpbqs3-1-0-0" } }, defaultVariants: {}, compoundVariants: [] });
@@ -1,20 +1,23 @@
1
1
  /**
2
+ * Properties describing how a piece of text is formatted.
2
3
  * @internal
3
- * Properties describing how a piece of text is formatted. */
4
- export type _Font = {
4
+ */
5
+ export type Font = {
5
6
  fontStyle?: string;
6
7
  fontWeight?: string;
7
8
  fontSize: string;
8
9
  fontFamily: string;
9
10
  };
10
11
  /**
12
+ * The Unicode character representing an ellipsis.
11
13
  * @internal
12
- * The Unicode character representing an ellipsis. */
13
- export declare const _ELLIPSIS_CHARACTER = "\u2026";
14
+ */
15
+ export declare const ELLIPSIS_CHARACTER = "\u2026";
14
16
  /**
17
+ * Max iterations for finding the perfect truncated text for a given width
15
18
  * @internal
16
- * Max iterations for finding the perfect truncated text for a given width */
17
- export declare const _ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
19
+ */
20
+ export declare const ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
18
21
  /**
19
22
  * Calculates the width of formatted text in pixels.
20
23
  *
@@ -22,14 +25,14 @@ export declare const _ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
22
25
  * @param textFont - The font settings for the text
23
26
  * @internal
24
27
  */
25
- export declare function _getTextWidth(text: string, textFont: _Font): number;
28
+ export declare function getTextWidth(text: string, textFont: Font): number;
26
29
  /**
27
- * @internal
28
30
  * Calculates the height of formatted text in pixels.
29
31
  * @param text - The text to calculate the height of
30
32
  * @param textFont - The font settings for the text
33
+ * @internal
31
34
  */
32
- export declare function _getTextHeight(text: string, textFont: _Font): number;
35
+ export declare function getTextHeight(text: string, textFont: Font): number;
33
36
  /**
34
37
  * Cuts off text that exceeds the maximum width in the center and
35
38
  * concatenates both shortened ends of the text with an ellipsis.
@@ -39,14 +42,14 @@ export declare function _getTextHeight(text: string, textFont: _Font): number;
39
42
  * @param maxWidthInPx - If the text's width exceeds this value, the text will be truncated to a string whose width is guaranteed to be below it
40
43
  * @internal
41
44
  */
42
- export declare function _centerEllipsizeText(originalText: string, textFont: _Font, maxWidthInPx: number): string;
45
+ export declare function centerEllipsizeText(originalText: string, textFont: Font, maxWidthInPx: number): string;
43
46
  /**
44
47
  * Returns an object containing the width of a given formatted text and the
45
48
  * width of an ellipsis character with the same text format or `null`
46
49
  * if the text width does not exceed its maximum available width.
47
50
  * @internal
48
51
  */
49
- export declare function _calculateEllipsisInfo(originalText: string, textFont: _Font, maxWidthInPx: number): {
52
+ export declare function calculateEllipsisInfo(originalText: string, textFont: Font, maxWidthInPx: number): {
50
53
  ellipsisWidth: number;
51
54
  avgLetterWidth: number;
52
55
  } | null;
@@ -17,18 +17,18 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var utils_exports = {};
19
19
  __export(utils_exports, {
20
- _ELLIPSIS_APPROXIMATION_THRESHOLD: () => _ELLIPSIS_APPROXIMATION_THRESHOLD,
21
- _ELLIPSIS_CHARACTER: () => _ELLIPSIS_CHARACTER,
22
- _calculateEllipsisInfo: () => _calculateEllipsisInfo,
23
- _centerEllipsizeText: () => _centerEllipsizeText,
24
- _getTextHeight: () => _getTextHeight,
25
- _getTextWidth: () => _getTextWidth
20
+ ELLIPSIS_APPROXIMATION_THRESHOLD: () => ELLIPSIS_APPROXIMATION_THRESHOLD,
21
+ ELLIPSIS_CHARACTER: () => ELLIPSIS_CHARACTER,
22
+ calculateEllipsisInfo: () => calculateEllipsisInfo,
23
+ centerEllipsizeText: () => centerEllipsizeText,
24
+ getTextHeight: () => getTextHeight,
25
+ getTextWidth: () => getTextWidth
26
26
  });
27
27
  module.exports = __toCommonJS(utils_exports);
28
- const _ELLIPSIS_CHARACTER = "\u2026";
29
- const _ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
28
+ const ELLIPSIS_CHARACTER = "\u2026";
29
+ const ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
30
30
  let inMemContext2d;
31
- function _getTextWidth(text, textFont) {
31
+ function getTextWidth(text, textFont) {
32
32
  const context = getCanvasContext2d();
33
33
  context.font = getFontString(textFont);
34
34
  const textMetrics = context.measureText(text);
@@ -38,15 +38,15 @@ function _getTextWidth(text, textFont) {
38
38
  const actualTextWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
39
39
  return Math.ceil(actualTextWidth);
40
40
  }
41
- function _getTextHeight(text, textFont) {
41
+ function getTextHeight(text, textFont) {
42
42
  const context = getCanvasContext2d();
43
43
  context.font = getFontString(textFont);
44
44
  const textMetrics = context.measureText(text);
45
45
  const actualTextHeight = Math.abs(textMetrics.actualBoundingBoxAscent) + Math.abs(textMetrics.actualBoundingBoxDescent);
46
46
  return Math.ceil(actualTextHeight);
47
47
  }
48
- function _centerEllipsizeText(originalText, textFont, maxWidthInPx) {
49
- const ellipsisInfo = _calculateEllipsisInfo(
48
+ function centerEllipsizeText(originalText, textFont, maxWidthInPx) {
49
+ const ellipsisInfo = calculateEllipsisInfo(
50
50
  originalText,
51
51
  textFont,
52
52
  maxWidthInPx
@@ -57,7 +57,7 @@ function _centerEllipsizeText(originalText, textFont, maxWidthInPx) {
57
57
  const { ellipsisWidth, avgLetterWidth } = ellipsisInfo;
58
58
  const availableTextWidth = maxWidthInPx - ellipsisWidth;
59
59
  if (availableTextWidth <= ellipsisWidth) {
60
- return _ELLIPSIS_CHARACTER;
60
+ return ELLIPSIS_CHARACTER;
61
61
  }
62
62
  const initialPrefixSuffixLength = Math.floor(availableTextWidth / avgLetterWidth / 2) + 1;
63
63
  let prefix;
@@ -72,10 +72,10 @@ function _centerEllipsizeText(originalText, textFont, maxWidthInPx) {
72
72
  suffixLength -= attempt % 2 === 0 ? 1 : 0;
73
73
  prefix = originalText.substring(0, prefixLength);
74
74
  suffix = originalText.substring(originalText.length - suffixLength);
75
- ellipsizedText = `${prefix}${_ELLIPSIS_CHARACTER}${suffix}`;
76
- approximatedTextWidth = _getTextWidth(ellipsizedText, textFont);
75
+ ellipsizedText = `${prefix}${ELLIPSIS_CHARACTER}${suffix}`;
76
+ approximatedTextWidth = getTextWidth(ellipsizedText, textFont);
77
77
  attempt++;
78
- } while (attempt <= _ELLIPSIS_APPROXIMATION_THRESHOLD && approximatedTextWidth >= maxWidthInPx);
78
+ } while (attempt <= ELLIPSIS_APPROXIMATION_THRESHOLD && approximatedTextWidth >= maxWidthInPx);
79
79
  return ellipsizedText;
80
80
  }
81
81
  function getFontString(textFont) {
@@ -92,15 +92,15 @@ function getFontString(textFont) {
92
92
  )
93
93
  ).join(" ");
94
94
  }
95
- function _calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
95
+ function calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
96
96
  const originalTextLength = originalText.length;
97
97
  if (originalTextLength <= 1) {
98
98
  return null;
99
99
  }
100
- const textWidth = _getTextWidth(originalText, textFont);
100
+ const textWidth = getTextWidth(originalText, textFont);
101
101
  const avgLetterWidth = textWidth / originalTextLength;
102
102
  return textWidth > maxWidthInPx ? {
103
- ellipsisWidth: _getTextWidth(_ELLIPSIS_CHARACTER, textFont),
103
+ ellipsisWidth: getTextWidth(ELLIPSIS_CHARACTER, textFont),
104
104
  avgLetterWidth
105
105
  } : null;
106
106
  }
@@ -1,12 +0,0 @@
1
- /**
2
- * Defines role / color variants
3
- * @public
4
- * @deprecated Will be removed.
5
- */
6
- export declare const roleVariants: readonly ["neutral", "primary", "success", "warning", "critical", "onAccent"];
7
- /**
8
- * Defines the types of role variants
9
- * @public
10
- * @deprecated Will be removed. You can use 'neutral' | 'primary' | 'success' | 'warning' | 'critical' instead.
11
- */
12
- export type RoleVariantType = (typeof roleVariants)[number];
@@ -1,30 +0,0 @@
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 role_variant_exports = {};
19
- __export(role_variant_exports, {
20
- roleVariants: () => roleVariants
21
- });
22
- module.exports = __toCommonJS(role_variant_exports);
23
- const roleVariants = [
24
- "neutral",
25
- "primary",
26
- "success",
27
- "warning",
28
- "critical",
29
- "onAccent"
30
- ];
@@ -1,12 +0,0 @@
1
- const roleVariants = [
2
- "neutral",
3
- "primary",
4
- "success",
5
- "warning",
6
- "critical",
7
- "onAccent"
8
- ];
9
- export {
10
- roleVariants
11
- };
12
- //# sourceMappingURL=role-variant.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/core/types/role-variant.tsx"],
4
- "sourcesContent": ["/* eslint-disable deprecation/deprecation */\n\n/**\n * Defines role / color variants\n * @public\n * @deprecated Will be removed.\n */\nexport const roleVariants = [\n 'neutral',\n 'primary',\n 'success',\n 'warning',\n 'critical',\n 'onAccent',\n] as const;\n\n/**\n * Defines the types of role variants\n * @public\n * @deprecated Will be removed. You can use 'neutral' | 'primary' | 'success' | 'warning' | 'critical' instead.\n */\nexport type RoleVariantType = (typeof roleVariants)[number];\n"],
5
- "mappings": "AAOO,MAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
- "names": []
7
- }
@@ -1,12 +0,0 @@
1
- import { type RenderOptions, type RenderResult } from '@testing-library/react';
2
- import React from 'react';
3
- type RenderWithIntlOptions = {
4
- locale?: string;
5
- timeZone?: string;
6
- } & Omit<RenderOptions, 'queries'>;
7
- /** Wrapper to render components with all required providers
8
- * @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
9
- */
10
- export declare const customRender: (ui: React.ReactElement, { locale, timeZone, wrapper: CustomWrapper, ...renderOptions }?: RenderWithIntlOptions) => RenderResult;
11
- export * from '@testing-library/react';
12
- export { customRender as render };
@@ -1,62 +0,0 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var custom_render_exports = {};
30
- __export(custom_render_exports, {
31
- customRender: () => customRender,
32
- render: () => customRender
33
- });
34
- module.exports = __toCommonJS(custom_render_exports);
35
- var import_react = require("@testing-library/react");
36
- var import_react2 = __toESM(require("react"));
37
- var import_react_intl = require("react-intl");
38
- __reExport(custom_render_exports, require("@testing-library/react"), module.exports);
39
- const AllProviders = ({
40
- children,
41
- locale = "en",
42
- timeZone = "UTC"
43
- }) => {
44
- return /* @__PURE__ */ import_react2.default.createElement(import_react_intl.IntlProvider, { locale, timeZone }, children);
45
- };
46
- const DefaultWrapper = (props) => (
47
- // eslint-disable-next-line react/jsx-no-useless-fragment
48
- /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, props.children)
49
- );
50
- const customRender = (ui, {
51
- locale = "en",
52
- timeZone = "UTC",
53
- wrapper: CustomWrapper = DefaultWrapper,
54
- ...renderOptions
55
- } = {}) => {
56
- return (0, import_react.render)(ui, {
57
- wrapper: ({ children }) => {
58
- return /* @__PURE__ */ import_react2.default.createElement(AllProviders, { locale, timeZone }, /* @__PURE__ */ import_react2.default.createElement(CustomWrapper, null, children));
59
- },
60
- ...renderOptions
61
- });
62
- };
@@ -1,22 +0,0 @@
1
- import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
2
- export * from './custom-render.js';
3
- export { setupGetBoundingClientRectMock, clearGetBoundingClientRectMock, } from './mocks/bounding-client-rect-mock.js';
4
- export { createMockElement } from './mocks/create-mock-element.js';
5
- export { setupCanvasMeasureTextMock, clearCanvasMeasureTextMock, } from './mocks/canvas-mock.js';
6
- export { setupResizeObserverMock, clearResizeObserverMock, } from './mocks/resize-observer-mock.js';
7
- export { _setupSelectMocks } from './mocks/select-mock.js';
8
- export { setupOffsetWidthMock, clearOffsetWidthMock, } from './mocks/offset-width-mock.js';
9
- export { setupOffsetHeightMock, clearOffsetHeightMock, } from './mocks/offset-height-mock.js';
10
- export { setupDomRectMock, clearDomRectMock } from './mocks/dom-rect-mock.js';
11
- export { setupMatchMediaMock, clearMatchMediaMock, } from './mocks/match-media-mock.js';
12
- export { setupPointerEventMock, clearPointerEventMock, } from './mocks/pointer-event-mock.js';
13
- export { setupIntersectionObserverMock, clearIntersectionObserverMock, } from './mocks/intersection-observer-mock.js';
14
- export { setupCreateRangeMock, clearCreateRangeMock, } from './mocks/create-range-mock.js';
15
- export { setupScreenSizeMock, clearScreenSizeMock, } from './mocks/screen-size-mock.js';
16
- export { setupScrollIntoViewMock, clearScrollIntoViewMock, } from './mocks/scroll-into-view-mock.js';
17
- export { setupScrollWidthMock, clearScrollWidthMock, } from './mocks/scroll-width-mock.js';
18
- export { setupFetchMock, clearFetchMock } from './mocks/fetch-mock.js';
19
- export { setupTableVirtualizationMock, clearTableVirtualizationMock, } from './mocks/table-virtualization-mock.js';
20
- export { setupTextEllipsisMock, clearTextEllipsisMock, } from './mocks/text-ellipsis-mock.js';
21
- export { setup, clear } from './setup.js';
22
- export { userEvent, PointerEventsCheckLevel };
package/testing/index.js DELETED
@@ -1,91 +0,0 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var testing_exports = {};
30
- __export(testing_exports, {
31
- PointerEventsCheckLevel: () => import_user_event.PointerEventsCheckLevel,
32
- _setupSelectMocks: () => import_select_mock._setupSelectMocks,
33
- clear: () => import_setup.clear,
34
- clearCanvasMeasureTextMock: () => import_canvas_mock.clearCanvasMeasureTextMock,
35
- clearCreateRangeMock: () => import_create_range_mock.clearCreateRangeMock,
36
- clearDomRectMock: () => import_dom_rect_mock.clearDomRectMock,
37
- clearFetchMock: () => import_fetch_mock.clearFetchMock,
38
- clearGetBoundingClientRectMock: () => import_bounding_client_rect_mock.clearGetBoundingClientRectMock,
39
- clearIntersectionObserverMock: () => import_intersection_observer_mock.clearIntersectionObserverMock,
40
- clearMatchMediaMock: () => import_match_media_mock.clearMatchMediaMock,
41
- clearOffsetHeightMock: () => import_offset_height_mock.clearOffsetHeightMock,
42
- clearOffsetWidthMock: () => import_offset_width_mock.clearOffsetWidthMock,
43
- clearPointerEventMock: () => import_pointer_event_mock.clearPointerEventMock,
44
- clearResizeObserverMock: () => import_resize_observer_mock.clearResizeObserverMock,
45
- clearScreenSizeMock: () => import_screen_size_mock.clearScreenSizeMock,
46
- clearScrollIntoViewMock: () => import_scroll_into_view_mock.clearScrollIntoViewMock,
47
- clearScrollWidthMock: () => import_scroll_width_mock.clearScrollWidthMock,
48
- clearTableVirtualizationMock: () => import_table_virtualization_mock.clearTableVirtualizationMock,
49
- clearTextEllipsisMock: () => import_text_ellipsis_mock.clearTextEllipsisMock,
50
- createMockElement: () => import_create_mock_element.createMockElement,
51
- setup: () => import_setup.setup,
52
- setupCanvasMeasureTextMock: () => import_canvas_mock.setupCanvasMeasureTextMock,
53
- setupCreateRangeMock: () => import_create_range_mock.setupCreateRangeMock,
54
- setupDomRectMock: () => import_dom_rect_mock.setupDomRectMock,
55
- setupFetchMock: () => import_fetch_mock.setupFetchMock,
56
- setupGetBoundingClientRectMock: () => import_bounding_client_rect_mock.setupGetBoundingClientRectMock,
57
- setupIntersectionObserverMock: () => import_intersection_observer_mock.setupIntersectionObserverMock,
58
- setupMatchMediaMock: () => import_match_media_mock.setupMatchMediaMock,
59
- setupOffsetHeightMock: () => import_offset_height_mock.setupOffsetHeightMock,
60
- setupOffsetWidthMock: () => import_offset_width_mock.setupOffsetWidthMock,
61
- setupPointerEventMock: () => import_pointer_event_mock.setupPointerEventMock,
62
- setupResizeObserverMock: () => import_resize_observer_mock.setupResizeObserverMock,
63
- setupScreenSizeMock: () => import_screen_size_mock.setupScreenSizeMock,
64
- setupScrollIntoViewMock: () => import_scroll_into_view_mock.setupScrollIntoViewMock,
65
- setupScrollWidthMock: () => import_scroll_width_mock.setupScrollWidthMock,
66
- setupTableVirtualizationMock: () => import_table_virtualization_mock.setupTableVirtualizationMock,
67
- setupTextEllipsisMock: () => import_text_ellipsis_mock.setupTextEllipsisMock,
68
- userEvent: () => import_user_event.default
69
- });
70
- module.exports = __toCommonJS(testing_exports);
71
- var import_user_event = __toESM(require("@testing-library/user-event"));
72
- __reExport(testing_exports, require("./custom-render.js"), module.exports);
73
- var import_bounding_client_rect_mock = require("./mocks/bounding-client-rect-mock.js");
74
- var import_create_mock_element = require("./mocks/create-mock-element.js");
75
- var import_canvas_mock = require("./mocks/canvas-mock.js");
76
- var import_resize_observer_mock = require("./mocks/resize-observer-mock.js");
77
- var import_select_mock = require("./mocks/select-mock.js");
78
- var import_offset_width_mock = require("./mocks/offset-width-mock.js");
79
- var import_offset_height_mock = require("./mocks/offset-height-mock.js");
80
- var import_dom_rect_mock = require("./mocks/dom-rect-mock.js");
81
- var import_match_media_mock = require("./mocks/match-media-mock.js");
82
- var import_pointer_event_mock = require("./mocks/pointer-event-mock.js");
83
- var import_intersection_observer_mock = require("./mocks/intersection-observer-mock.js");
84
- var import_create_range_mock = require("./mocks/create-range-mock.js");
85
- var import_screen_size_mock = require("./mocks/screen-size-mock.js");
86
- var import_scroll_into_view_mock = require("./mocks/scroll-into-view-mock.js");
87
- var import_scroll_width_mock = require("./mocks/scroll-width-mock.js");
88
- var import_fetch_mock = require("./mocks/fetch-mock.js");
89
- var import_table_virtualization_mock = require("./mocks/table-virtualization-mock.js");
90
- var import_text_ellipsis_mock = require("./mocks/text-ellipsis-mock.js");
91
- var import_setup = require("./setup.js");
@@ -1 +0,0 @@
1
- export { stratoPreset } from './jest-preset.js';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stratoPreset = void 0;
4
- var jest_preset_js_1 = require("./jest-preset.js");
5
- Object.defineProperty(exports, "stratoPreset", { enumerable: true, get: function () { return jest_preset_js_1.stratoPreset; } });
@@ -1,10 +0,0 @@
1
- /**
2
- * @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
3
- */
4
- export declare const stratoPreset: {
5
- moduleNameMapper: {
6
- nanoid: string;
7
- '\\.(css|less|scss|sass)$': string;
8
- };
9
- resolver: string;
10
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stratoPreset = void 0;
4
- /**
5
- * @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
6
- */
7
- exports.stratoPreset = {
8
- moduleNameMapper: {
9
- nanoid: '<rootDir>/node_modules/nanoid/index.cjs',
10
- '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
11
- },
12
- resolver: '<rootDir>/node_modules/@dynatrace/strato-components/testing/jest/resolver.js',
13
- };
File without changes
@@ -1,27 +0,0 @@
1
- module.exports = (path, options) => {
2
- // Call the defaultResolver, so we leverage its cache, error handling, etc.
3
- return options.defaultResolver(path, {
4
- ...options,
5
- // Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb)
6
- packageFilter: (pkg) => {
7
- // This is a workaround for https://github.com/uuidjs/uuid/pull/616
8
- //
9
- // jest-environment-jsdom 28+ tries to use browser exports instead of default exports,
10
- // but uuid only offers an ESM browser export and not a CommonJS one. Jest does not yet
11
- // support ESM modules natively, so this causes a Jest error related to trying to parse
12
- // "export" syntax.
13
- //
14
- // This workaround prevents Jest from considering uuid's module-based exports at all;
15
- // it falls back to uuid's CommonJS+node "main" property.
16
- //
17
- // Once we're able to migrate our Jest config to ESM and a browser crypto
18
- // implementation is available for the browser+ESM version of uuid to use (eg, via
19
- // https://github.com/jsdom/jsdom/pull/3352 or a similar polyfill), this can go away.
20
- if (pkg.name === 'uuid') {
21
- delete pkg['exports'];
22
- delete pkg['module'];
23
- }
24
- return pkg;
25
- },
26
- });
27
- };
@@ -1,8 +0,0 @@
1
- /** Mocks the `getBoundingClientRect()` function on all HTMLElements.
2
- * @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
3
- */
4
- export declare function setupGetBoundingClientRectMock(widthOrMockFn: number | (() => DOMRect | null), height?: number, x?: number, y?: number, top?: number, right?: number, bottom?: number, left?: number): void;
5
- /** Clears mocked `getBoundingClientRect()` function on HTMLElements.
6
- * @deprecated The testing subpackage is deprecated. Please switch to the `@dynatrace/strato-components-testing` package.
7
- */
8
- export declare function clearGetBoundingClientRectMock(): void;