@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,81 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { listCSS, listItemCSS } from "./List.sty.js";
4
+ import { Text } from "../Text/Text.js";
5
+ function interleaveListItems(listItems) {
6
+ const items = [];
7
+ React.Children.forEach(listItems, (listItem) => {
8
+ if (React.isValidElement(listItem)) {
9
+ if (listItem.type === List) {
10
+ if (items.length === 0) {
11
+ items.push([listItem]);
12
+ } else {
13
+ items[items.length - 1].push(listItem);
14
+ }
15
+ } else {
16
+ items.push([listItem]);
17
+ }
18
+ }
19
+ });
20
+ return items.map((values, index) => {
21
+ const itemKey = `list-item-${getItemKey(values, index)}`;
22
+ return /* @__PURE__ */ React.createElement("li", { key: itemKey, className: listItemCSS }, values);
23
+ });
24
+ }
25
+ function getItemKey(values, index) {
26
+ const isArray = Array.isArray(values);
27
+ const value = isArray ? values?.[0] : values;
28
+ if (React.isValidElement(value)) {
29
+ if (value.key) {
30
+ return value.key;
31
+ } else if (value.props && value.props.children) {
32
+ return getItemKey(value.props.children, index);
33
+ }
34
+ return value;
35
+ }
36
+ if (value === void 0) {
37
+ return index;
38
+ }
39
+ return value;
40
+ }
41
+ const List = /* @__PURE__ */ forwardRef(
42
+ (props, ref) => {
43
+ const {
44
+ children,
45
+ ordered = false,
46
+ textStyle,
47
+ fontStyle,
48
+ start = 1,
49
+ "data-testid": dataTestId,
50
+ "data-dtrum-mask": dataDtrumMask,
51
+ "data-dtrum-allow": dataDtrumAllow,
52
+ className: consumerClassName,
53
+ style: consumerStyle,
54
+ ...remainingProps
55
+ } = props;
56
+ return /* @__PURE__ */ React.createElement(
57
+ Text,
58
+ {
59
+ ref,
60
+ as: ordered ? "ol" : "ul",
61
+ ...ordered && {
62
+ start
63
+ },
64
+ textStyle,
65
+ fontStyle,
66
+ "data-testid": dataTestId,
67
+ "data-dtrum-mask": dataDtrumMask,
68
+ "data-dtrum-allow": dataDtrumAllow,
69
+ className: clsx(listCSS, consumerClassName),
70
+ style: consumerStyle,
71
+ ...remainingProps
72
+ },
73
+ interleaveListItems(children)
74
+ );
75
+ }
76
+ );
77
+ List.displayName = "List";
78
+ export {
79
+ List
80
+ };
81
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/List/List.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { listCSS, listItemCSS } from './List.sty.js';\nimport { DataTestId } from '../../core/types/data-props.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport { StylingProps } from '../../core/types/styling-props.js';\nimport { WithChildren } from '../../core/types/with-children.js';\nimport { Text } from '../Text/Text.js';\n\n/**\n * The props for the Link component.\n * @public\n */\nexport interface ListProps<TOrdered extends boolean = false>\n extends WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * Whether the List is ordered or not. This changes whether numbers or bullets are used.\n * @defaultValue false\n */\n ordered?: TOrdered;\n /**\n * Sets the text style for the List.\n * @defaultValue 'base'\n */\n textStyle?: 'base' | 'base-emphasized' | 'small' | 'small-emphasized';\n /**\n * Sets the text style for the List.\n * @defaultValue 'text'\n */\n fontStyle?: 'text' | 'code';\n /**\n * Sets the starting number of the first item in an ordered list.\n * The value is always treated as an integer (floor).\n * @defaultValue 1\n */\n start?: number;\n}\n\n/** Maps a list of (potentially) nested list items to HTML list structure. */\nfunction interleaveListItems(listItems: React.ReactNode) {\n const items: React.ReactNode[][] = [];\n\n React.Children.forEach(listItems, (listItem) => {\n if (React.isValidElement(listItem)) {\n if (listItem.type === List) {\n if (items.length === 0) {\n items.push([listItem]);\n } else {\n items[items.length - 1].push(listItem);\n }\n } else {\n items.push([listItem]);\n }\n }\n });\n\n return items.map((values, index) => {\n const itemKey = `list-item-${getItemKey(values, index)}`;\n return (\n <li key={itemKey} className={listItemCSS}>\n {values}\n </li>\n );\n });\n}\n\n/**\n * Generates a key for a list item. We try to avoid\n * generating [Object object] by looking down levels\n * recursively. If there is an existing key defined in\n * a descendant uses that as part of the key otherwise\n * if we get a string value, use that. Otherwise uses\n * the index if nothing was found.\n * @param values - nodes inside the list item\n * @param index - current zero based index\n * @returns a key generated for the item\n */\nfunction getItemKey(values: React.ReactNode[], index: number): string | number {\n const isArray = Array.isArray(values);\n const value = isArray ? values?.[0] : values;\n if (React.isValidElement(value)) {\n if (value.key) {\n return value.key;\n } else if (value.props && value.props.children) {\n return getItemKey(value.props.children, index);\n }\n return value as unknown as string | number;\n }\n\n if (value === undefined) {\n return index;\n }\n\n return value as unknown as string | number;\n}\n\n/**\n * @public\n * The `List` component groups a set of related content in a list and can be arbitrarily nested.\n * List items are preceded by either a consecutive number (for ordered lists) or a bullet point\n * (for unordered lists).\n */\nexport const List = /* @__PURE__ */ forwardRef(\n <TOrdered extends boolean = false>(\n props: ListProps<TOrdered>,\n ref: React.ForwardedRef<\n TOrdered extends true ? HTMLOListElement : HTMLUListElement\n >,\n ) => {\n const {\n children,\n ordered = false,\n textStyle,\n fontStyle,\n start = 1,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n } = props;\n\n return (\n <Text\n ref={ref}\n as={ordered ? 'ol' : 'ul'}\n {...(ordered && {\n start,\n })}\n textStyle={textStyle}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(listCSS, consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n {interleaveListItems(children)}\n </Text>\n );\n },\n);\n\n(List as typeof List & { displayName: string }).displayName = 'List';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,SAAS,mBAAmB;AAKrC,SAAS,YAAY;AAmCrB,SAAS,oBAAoB,WAA4B;AACvD,QAAM,QAA6B,CAAC;AAEpC,QAAM,SAAS,QAAQ,WAAW,CAAC,aAAa;AAC9C,QAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,UAAI,SAAS,SAAS,MAAM;AAC1B,YAAI,MAAM,WAAW,GAAG;AACtB,gBAAM,KAAK,CAAC,QAAQ,CAAC;AAAA,QACvB,OAAO;AACL,gBAAM,MAAM,SAAS,CAAC,EAAE,KAAK,QAAQ;AAAA,QACvC;AAAA,MACF,OAAO;AACL,cAAM,KAAK,CAAC,QAAQ,CAAC;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO,MAAM,IAAI,CAAC,QAAQ,UAAU;AAClC,UAAM,UAAU,aAAa,WAAW,QAAQ,KAAK,CAAC;AACtD,WACE,oCAAC,QAAG,KAAK,SAAS,WAAW,eAC1B,MACH;AAAA,EAEJ,CAAC;AACH;AAaA,SAAS,WAAW,QAA2B,OAAgC;AAC7E,QAAM,UAAU,MAAM,QAAQ,MAAM;AACpC,QAAM,QAAQ,UAAU,SAAS,CAAC,IAAI;AACtC,MAAI,MAAM,eAAe,KAAK,GAAG;AAC/B,QAAI,MAAM,KAAK;AACb,aAAO,MAAM;AAAA,IACf,WAAW,MAAM,SAAS,MAAM,MAAM,UAAU;AAC9C,aAAO,WAAW,MAAM,MAAM,UAAU,KAAK;AAAA,IAC/C;AACA,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAQO,MAAM,OAAuB;AAAA,EAClC,CACE,OACA,QAGG;AACH,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,GAAG;AAAA,IACL,IAAI;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI,UAAU,OAAO;AAAA,QACpB,GAAI,WAAW;AAAA,UACd;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,WAAW,KAAK,SAAS,iBAAiB;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH,oBAAoB,QAAQ;AAAA,IAC/B;AAAA,EAEJ;AACF;AAEC,KAA+C,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import "./List.css";
2
+ var listCSS = "List_listCSS__13d6w3n0";
3
+ var listItemCSS = "List_listItemCSS__13d6w3n1";
4
+ export {
5
+ listCSS,
6
+ listItemCSS
7
+ };
8
+ //# sourceMappingURL=List.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/List/List.css.ts"],
4
+ "sourcesContent": ["import './List.css';\nexport var listCSS = 'List_listCSS__13d6w3n0';\nexport var listItemCSS = 'List_listItemCSS__13d6w3n1';"],
5
+ "mappings": "AAAA,OAAO;AACA,IAAI,UAAU;AACd,IAAI,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ .Paragraph_paragraphCSS__42lz6l0 {
2
+ margin-top: 0;
3
+ margin-bottom: 0;
4
+ overflow-wrap: break-word;
5
+ color: var(--dt-colors-text-neutral-default, #2b2a58);
6
+ font-style: normal;
7
+ }
8
+ .Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1 {
9
+ display: block;
10
+ white-space: nowrap;
11
+ text-overflow: ellipsis;
12
+ overflow: hidden;
13
+ }
14
+ .Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2 {
15
+ display: -webkit-box;
16
+ -webkit-line-clamp: var(--strato-ellipsis-line-clamp);
17
+ -webkit-box-orient: vertical;
18
+ overflow: hidden;
19
+ }
@@ -0,0 +1,49 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { paragraphCSS } from "./Paragraph.sty.js";
4
+ import { textStyleCSS } from "../../styles/textStyle.sty.js";
5
+ const Paragraph = /* @__PURE__ */ forwardRef((props, ref) => {
6
+ const {
7
+ children,
8
+ maxLines,
9
+ className: consumerClassName,
10
+ style: consumerStyle,
11
+ "data-testid": dataTestId,
12
+ "data-dtrum-mask": dataDtrumMask,
13
+ "data-dtrum-allow": dataDtrumAllow,
14
+ ...remainingProps
15
+ } = props;
16
+ let ellipsis;
17
+ if (maxLines === void 0 || maxLines === 0) {
18
+ ellipsis = void 0;
19
+ } else if (maxLines === 1) {
20
+ ellipsis = "singleLine";
21
+ } else {
22
+ ellipsis = "multiLine";
23
+ }
24
+ return /* @__PURE__ */ React.createElement(
25
+ "p",
26
+ {
27
+ ref,
28
+ "data-testid": dataTestId,
29
+ "data-dtrum-mask": dataDtrumMask,
30
+ "data-dtrum-allow": dataDtrumAllow,
31
+ className: clsx(
32
+ paragraphCSS({ ellipsis }),
33
+ textStyleCSS(),
34
+ consumerClassName
35
+ ),
36
+ style: {
37
+ ...consumerStyle,
38
+ "--strato-ellipsis-line-clamp": maxLines
39
+ },
40
+ ...remainingProps
41
+ },
42
+ children
43
+ );
44
+ });
45
+ Paragraph.displayName = "Paragraph";
46
+ export {
47
+ Paragraph
48
+ };
49
+ //# sourceMappingURL=Paragraph.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Paragraph/Paragraph.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { type CSSProperties, forwardRef } from 'react';\n\nimport { paragraphCSS } from './Paragraph.sty.js';\nimport {\n type DataTestId,\n type StylingProps,\n type WithChildren,\n} from '../../core/index.js';\nimport type { DOMProps } from '../../core/types/dom.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * The props for the Paragraph component.\n * @public\n * */\nexport interface ParagraphProps\n extends WithChildren,\n DOMProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * Limits the text to the given number of lines and adds ellipsis if the text would need more lines.\n */\n maxLines?: number;\n}\n\n/**\n * @public\n * The `Paragraph` component displays a block of text with the default text style and supports text truncation.\n */\nexport const Paragraph = /* @__PURE__ */ forwardRef<\n HTMLParagraphElement,\n ParagraphProps\n>((props, ref) => {\n const {\n children,\n maxLines,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n } = props;\n\n let ellipsis: undefined | 'singleLine' | 'multiLine';\n if (maxLines === undefined || maxLines === 0) {\n ellipsis = undefined;\n } else if (maxLines === 1) {\n ellipsis = 'singleLine';\n } else {\n ellipsis = 'multiLine';\n }\n\n return (\n <p\n ref={ref}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(\n paragraphCSS({ ellipsis }),\n textStyleCSS(),\n consumerClassName,\n )}\n style={\n {\n ...consumerStyle,\n '--strato-ellipsis-line-clamp': maxLines,\n } as CSSProperties\n }\n {...remainingProps}\n >\n {children}\n </p>\n );\n});\n(Paragraph as typeof Paragraph & { displayName: string }).displayName =\n 'Paragraph';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAA6B,kBAAkB;AAEtD,SAAS,oBAAoB;AAQ7B,SAAS,oBAAoB;AAsBtB,MAAM,YAA4B,2BAGvC,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AAEJ,MAAI;AACJ,MAAI,aAAa,UAAa,aAAa,GAAG;AAC5C,eAAW;AAAA,EACb,WAAW,aAAa,GAAG;AACzB,eAAW;AAAA,EACb,OAAO;AACL,eAAW;AAAA,EACb;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,WAAW;AAAA,QACT,aAAa,EAAE,SAAS,CAAC;AAAA,QACzB,aAAa;AAAA,QACb;AAAA,MACF;AAAA,MACA,OACE;AAAA,QACE,GAAG;AAAA,QACH,gCAAgC;AAAA,MAClC;AAAA,MAED,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AACA,UAAyD,cACxD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import "./Paragraph.css";
2
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ var paragraphCSS = _7a468({ defaultClassName: "Paragraph_paragraphCSS__42lz6l0", variantClassNames: { ellipsis: { singleLine: "Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1", multiLine: "Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2" } }, defaultVariants: {}, compoundVariants: [] });
4
+ export {
5
+ paragraphCSS
6
+ };
7
+ //# sourceMappingURL=Paragraph.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Paragraph/Paragraph.css.ts"],
4
+ "sourcesContent": ["import './Paragraph.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var paragraphCSS = _7a468({defaultClassName:'Paragraph_paragraphCSS__42lz6l0',variantClassNames:{ellipsis:{singleLine:'Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1',multiLine:'Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2'}},defaultVariants:{},compoundVariants:[]});"],
5
+ "mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,mCAAkC,mBAAkB,EAAC,UAAS,EAAC,YAAW,uDAAsD,WAAU,qDAAoD,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ .Strikethrough_strikethroughCSS__1178y080 {
2
+ text-decoration: line-through;
3
+ text-decoration-style: solid;
4
+ overflow-wrap: break-word;
5
+ }
@@ -0,0 +1,32 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { strikethroughCSS } from "./Strikethrough.sty.js";
4
+ const Strikethrough = /* @__PURE__ */ forwardRef((props, ref) => {
5
+ const {
6
+ children,
7
+ "data-testid": dataTestId,
8
+ "data-dtrum-mask": dataDtrumMask,
9
+ "data-dtrum-allow": dataDtrumAllow,
10
+ className: consumerClassName,
11
+ style: consumerStyle,
12
+ ...remainingProps
13
+ } = props;
14
+ return /* @__PURE__ */ React.createElement(
15
+ "s",
16
+ {
17
+ ref,
18
+ "data-testid": dataTestId,
19
+ "data-dtrum-mask": dataDtrumMask,
20
+ "data-dtrum-allow": dataDtrumAllow,
21
+ className: clsx(strikethroughCSS, consumerClassName),
22
+ style: consumerStyle,
23
+ ...remainingProps
24
+ },
25
+ children
26
+ );
27
+ });
28
+ Strikethrough.displayName = "Strikethrough";
29
+ export {
30
+ Strikethrough
31
+ };
32
+ //# sourceMappingURL=Strikethrough.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Strikethrough/Strikethrough.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { strikethroughCSS } from './Strikethrough.sty.js';\nimport {\n type DataTestId,\n type StylingProps,\n type WithChildren,\n} from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Strikethrough component.\n * @public\n * */\nexport interface StrikethroughProps\n extends WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {}\n\n/**\n * @public\n * The `Strikethrough` component renders text with a line through it. Use it to\n * represent things that are no longer relevant or accurate.\n */\nexport const Strikethrough = /* @__PURE__ */ forwardRef<\n HTMLElement,\n StrikethroughProps\n>((props, ref) => {\n const {\n children,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n } = props;\n\n return (\n <s\n ref={ref}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(strikethroughCSS, consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </s>\n );\n});\n(Strikethrough as typeof Strikethrough & { displayName: string }).displayName =\n 'Strikethrough';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,wBAAwB;AAuB1B,MAAM,gBAAgC,2BAG3C,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,WAAW,KAAK,kBAAkB,iBAAiB;AAAA,MACnD,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AACA,cAAiE,cAChE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import "./Strikethrough.css";
2
+ var strikethroughCSS = "Strikethrough_strikethroughCSS__1178y080";
3
+ export {
4
+ strikethroughCSS
5
+ };
6
+ //# sourceMappingURL=Strikethrough.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Strikethrough/Strikethrough.css.ts"],
4
+ "sourcesContent": ["import './Strikethrough.css';\nexport var strikethroughCSS = 'Strikethrough_strikethroughCSS__1178y080';"],
5
+ "mappings": "AAAA,OAAO;AACA,IAAI,mBAAmB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ .Strong_strongCSS__1sqovlt0 {
2
+ font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
3
+ overflow-wrap: break-word;
4
+ }
@@ -0,0 +1,34 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { strongCSS } from "./Strong.sty.js";
4
+ const Strong = /* @__PURE__ */ forwardRef(
5
+ (props, ref) => {
6
+ const {
7
+ children,
8
+ "data-testid": dataTestId,
9
+ "data-dtrum-mask": dataDtrumMask,
10
+ "data-dtrum-allow": dataDtrumAllow,
11
+ className: consumerClassName,
12
+ style: consumerStyle,
13
+ ...remainingProps
14
+ } = props;
15
+ return /* @__PURE__ */ React.createElement(
16
+ "strong",
17
+ {
18
+ ref,
19
+ "data-testid": dataTestId,
20
+ "data-dtrum-mask": dataDtrumMask,
21
+ "data-dtrum-allow": dataDtrumAllow,
22
+ className: clsx(strongCSS, consumerClassName),
23
+ style: consumerStyle,
24
+ ...remainingProps
25
+ },
26
+ children
27
+ );
28
+ }
29
+ );
30
+ Strong.displayName = "Strong";
31
+ export {
32
+ Strong
33
+ };
34
+ //# sourceMappingURL=Strong.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Strong/Strong.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { strongCSS } from './Strong.sty.js';\nimport {\n type DataTestId,\n type StylingProps,\n type WithChildren,\n} from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Strong component.\n * @public\n * */\nexport interface StrongProps\n extends WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {}\n\n/**\n * @public\n * Use the `Strong` component to render text in bold type to emphasize it.\n */\nexport const Strong = /* @__PURE__ */ forwardRef<HTMLElement, StrongProps>(\n (props, ref) => {\n const {\n children,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n } = props;\n return (\n <strong\n ref={ref}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(strongCSS, consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </strong>\n );\n },\n);\n\n(Strong as typeof Strong & { displayName: string }).displayName = 'Strong';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,iBAAiB;AAsBnB,MAAM,SAAyB;AAAA,EACpC,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ;AAAA,MACA,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,GAAG;AAAA,IACL,IAAI;AACJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,WAAW,KAAK,WAAW,iBAAiB;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,OAAmD,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import "./Strong.css";
2
+ var strongCSS = "Strong_strongCSS__1sqovlt0";
3
+ export {
4
+ strongCSS
5
+ };
6
+ //# sourceMappingURL=Strong.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Strong/Strong.css.ts"],
4
+ "sourcesContent": ["import './Strong.css';\nexport var strongCSS = 'Strong_strongCSS__1sqovlt0';"],
5
+ "mappings": "AAAA,OAAO;AACA,IAAI,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ .Text_textCSS__ty6wu50 {
2
+ margin-top: 0;
3
+ margin-bottom: 0;
4
+ min-width: 0;
5
+ overflow-wrap: break-word;
6
+ }
7
+ .Text_textCSS_ellipsis_singleLine__ty6wu51 {
8
+ display: block;
9
+ white-space: nowrap;
10
+ text-overflow: ellipsis;
11
+ overflow: hidden;
12
+ }
13
+ .Text_textCSS_ellipsis_multiLine__ty6wu52 {
14
+ display: -webkit-box;
15
+ -webkit-line-clamp: var(--strato-ellipsis-line-clamp);
16
+ -webkit-box-orient: vertical;
17
+ overflow: hidden;
18
+ }
@@ -0,0 +1,43 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { textCSS } from "./Text.sty.js";
4
+ import { textStyleCSS } from "../../styles/textStyle.sty.js";
5
+ const Text = /* @__PURE__ */ forwardRef(
6
+ ({
7
+ children,
8
+ textStyle,
9
+ fontStyle,
10
+ as,
11
+ className: consumerClassName,
12
+ style: consumerStyle,
13
+ "data-testid": dataTestId,
14
+ "data-dtrum-mask": dataDtrumMask,
15
+ "data-dtrum-allow": dataDtrumAllow,
16
+ ...remainingProps
17
+ }, ref) => {
18
+ const TextTag = as || "span";
19
+ let ellipsis;
20
+ return /* @__PURE__ */ React.createElement(
21
+ TextTag,
22
+ {
23
+ "data-testid": dataTestId,
24
+ "data-dtrum-mask": dataDtrumMask,
25
+ "data-dtrum-allow": dataDtrumAllow,
26
+ ref,
27
+ className: clsx([
28
+ textCSS({ ellipsis }),
29
+ (fontStyle || textStyle) && textStyleCSS({ fontStyle, textStyle }),
30
+ consumerClassName
31
+ ]),
32
+ style: consumerStyle,
33
+ ...remainingProps
34
+ },
35
+ children
36
+ );
37
+ }
38
+ );
39
+ Text.displayName = "Text";
40
+ export {
41
+ Text
42
+ };
43
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Text/Text.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { type ElementType, type ReactElement, forwardRef } from 'react';\n\nimport { textCSS } from './Text.sty.js';\nimport type { AriaLabelingProps } from '../../core/types/a11y-props.js';\nimport { DataTestId } from '../../core/types/data-props.js';\nimport type { DOMProps } from '../../core/types/dom.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport type { PolymorphicComponentProps } from '../../core/types/polymorph.js';\nimport { StylingProps } from '../../core/types/styling-props.js';\nimport { WithChildren } from '../../core/types/with-children.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * @public\n * The props for the text component without any props coming from polymorphing. */\nexport interface TextOwnProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** Sets the text style. Variants include \"base\", \"base-emphasized\", etc. */\n textStyle?: 'base' | 'base-emphasized' | 'small' | 'small-emphasized';\n /** Sets the font style. Can either be \"text\" or \"code\" */\n fontStyle?: 'text' | 'code';\n}\n\n/**\n * @public\n * Combined props for the text component - polymorphing and own props. */\nexport type TextProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n TextOwnProps\n>;\n\n/**\n * @public\n * Use the `Text` component for text that is rendered without any semantic markup.\n */\nexport const Text: <E extends ElementType = 'span'>(\n props: TextProps<E>,\n) => ReactElement | null = /* @__PURE__ */ forwardRef(\n <E extends ElementType>(\n {\n children,\n textStyle,\n fontStyle,\n as,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: TextProps<E>,\n ref: typeof remainingProps.ref,\n ) => {\n const TextTag = as || 'span';\n\n let ellipsis: undefined | 'singleLine' | 'multiLine';\n\n return (\n <TextTag\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={ref}\n className={clsx([\n textCSS({ ellipsis }),\n (fontStyle || textStyle) && textStyleCSS({ fontStyle, textStyle }),\n consumerClassName,\n ])}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </TextTag>\n );\n },\n);\n\n(Text as typeof Text & { displayName: string }).displayName = 'Text';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAA8C,kBAAkB;AAEvE,SAAS,eAAe;AAQxB,SAAS,oBAAoB;AA8BtB,MAAM,OAE8B;AAAA,EACzC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,UAAU,MAAM;AAEtB,QAAI;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB;AAAA,QACA,WAAW,KAAK;AAAA,UACd,QAAQ,EAAE,SAAS,CAAC;AAAA,WACnB,aAAa,cAAc,aAAa,EAAE,WAAW,UAAU,CAAC;AAAA,UACjE;AAAA,QACF,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,KAA+C,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import "./Text.css";
2
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ var textCSS = _7a468({ defaultClassName: "Text_textCSS__ty6wu50", variantClassNames: { ellipsis: { singleLine: "Text_textCSS_ellipsis_singleLine__ty6wu51", multiLine: "Text_textCSS_ellipsis_multiLine__ty6wu52" } }, defaultVariants: {}, compoundVariants: [] });
4
+ export {
5
+ textCSS
6
+ };
7
+ //# sourceMappingURL=Text.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/Text/Text.css.ts"],
4
+ "sourcesContent": ["import './Text.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var textCSS = _7a468({defaultClassName:'Text_textCSS__ty6wu50',variantClassNames:{ellipsis:{singleLine:'Text_textCSS_ellipsis_singleLine__ty6wu51',multiLine:'Text_textCSS_ellipsis_multiLine__ty6wu52'}},defaultVariants:{},compoundVariants:[]});"],
5
+ "mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,UAAU,OAAO,EAAC,kBAAiB,yBAAwB,mBAAkB,EAAC,UAAS,EAAC,YAAW,6CAA4C,WAAU,2CAA0C,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ .TextEllipsis_textEllipsisCSS__1n6xzhd0 {
2
+ display: inline-block;
3
+ box-sizing: border-box;
4
+ vertical-align: middle;
5
+ overflow: hidden;
6
+ word-break: keep-all;
7
+ overflow-wrap: normal;
8
+ white-space: nowrap;
9
+ text-decoration: inherit;
10
+ width: 100%;
11
+ }
12
+ .TextEllipsis_textEllipsisCSS_truncationMode_start__1n6xzhd1 {
13
+ text-overflow: ellipsis;
14
+ direction: rtl;
15
+ text-align: left;
16
+ }
17
+ .TextEllipsis_textEllipsisCSS_truncationMode_middle__1n6xzhd2 {
18
+ text-overflow: clip;
19
+ }
20
+ .TextEllipsis_textEllipsisCSS_truncationMode_end__1n6xzhd3 {
21
+ text-overflow: ellipsis;
22
+ }
@@ -0,0 +1,143 @@
1
+ import clsx from "clsx";
2
+ import React, {
3
+ forwardRef,
4
+ useLayoutEffect,
5
+ useRef
6
+ } from "react";
7
+ import useResizeObserver from "use-resize-observer";
8
+ import { textEllipsisCSS } from "./TextEllipsis.sty.js";
9
+ import { _useFontsUpdated } from "../../core/hooks/useFontsUpdated.js";
10
+ import { useMergeRefs } from "../../core/hooks/useMergeRefs.js";
11
+ import { _centerEllipsizeText } from "../utils.js";
12
+ function getFontProps(textWrapper) {
13
+ const computedStyle = window.getComputedStyle(textWrapper, null);
14
+ return {
15
+ fontStyle: computedStyle.getPropertyValue("font-style"),
16
+ fontWeight: computedStyle.getPropertyValue("font-weight"),
17
+ fontSize: computedStyle.getPropertyValue("font-size"),
18
+ fontFamily: computedStyle.getPropertyValue("font-family")
19
+ };
20
+ }
21
+ function isNativeEllipsisActive(textWrapper, containerWidth) {
22
+ const textWidth = Math.floor(textWrapper.getBoundingClientRect().width * 100) / 100;
23
+ return textWidth > containerWidth;
24
+ }
25
+ function renderEllipsizedText(originalText, truncationMode, containerRef, wasEllipsized, onTextOverflow) {
26
+ const containerElement = containerRef.current;
27
+ const textWrapper = containerElement?.firstElementChild || null;
28
+ if (containerElement !== null && textWrapper !== null) {
29
+ if (textWrapper.textContent !== originalText) {
30
+ textWrapper.textContent = originalText;
31
+ }
32
+ const containerWidth = Math.ceil(containerElement.getBoundingClientRect().width * 100) / 100;
33
+ if (truncationMode === "middle") {
34
+ if (isNativeEllipsisActive(textWrapper, containerWidth)) {
35
+ const ellipsizedText = _centerEllipsizeText(
36
+ originalText,
37
+ getFontProps(textWrapper),
38
+ containerWidth
39
+ );
40
+ textWrapper.textContent = ellipsizedText;
41
+ if (ellipsizedText !== originalText) {
42
+ if (onTextOverflow && !wasEllipsized) {
43
+ onTextOverflow(true);
44
+ }
45
+ return true;
46
+ }
47
+ }
48
+ if (onTextOverflow && wasEllipsized) {
49
+ onTextOverflow(false);
50
+ }
51
+ } else if (isNativeEllipsisActive(textWrapper, containerWidth)) {
52
+ if (onTextOverflow && !wasEllipsized) {
53
+ onTextOverflow(true);
54
+ }
55
+ return true;
56
+ } else if (onTextOverflow && wasEllipsized) {
57
+ onTextOverflow(false);
58
+ }
59
+ }
60
+ return false;
61
+ }
62
+ const ComputedTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
63
+ const {
64
+ children,
65
+ truncationMode = "end",
66
+ onTextOverflow,
67
+ className: consumerClassName,
68
+ style: consumerStyle,
69
+ "data-testid": dataTestId,
70
+ "data-dtrum-mask": dataDtrumMask,
71
+ "data-dtrum-allow": dataDtrumAllow,
72
+ ...remainingProps
73
+ } = props;
74
+ const { ref: observerContainerRef } = useResizeObserver();
75
+ const containerRef = useRef(null);
76
+ const ellipsisStateRef = useRef(false);
77
+ const mergedRef = useMergeRefs([
78
+ observerContainerRef,
79
+ (instance) => {
80
+ containerRef.current = instance;
81
+ },
82
+ forwardedRef
83
+ ]);
84
+ const containerWidth = containerRef.current?.getBoundingClientRect().width;
85
+ const fontsUpdated = _useFontsUpdated();
86
+ useLayoutEffect(() => {
87
+ ellipsisStateRef.current = renderEllipsizedText(
88
+ children,
89
+ truncationMode,
90
+ containerRef,
91
+ ellipsisStateRef.current,
92
+ onTextOverflow
93
+ );
94
+ }, [containerWidth, children, truncationMode, fontsUpdated, onTextOverflow]);
95
+ return /* @__PURE__ */ React.createElement(
96
+ "span",
97
+ {
98
+ ref: mergedRef,
99
+ "aria-label": children,
100
+ "data-ellipsis": true,
101
+ "data-testid": dataTestId,
102
+ "data-dtrum-mask": dataDtrumMask,
103
+ "data-dtrum-allow": dataDtrumAllow,
104
+ className: clsx(textEllipsisCSS({ truncationMode }), consumerClassName),
105
+ style: consumerStyle,
106
+ ...remainingProps
107
+ },
108
+ /* @__PURE__ */ React.createElement("span", null, children)
109
+ );
110
+ });
111
+ const CssTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
112
+ const {
113
+ children,
114
+ truncationMode = "end",
115
+ onTextOverflow,
116
+ className: consumerClassName,
117
+ style: consumerStyle,
118
+ "data-testid": dataTestId,
119
+ ...remainingProps
120
+ } = props;
121
+ return /* @__PURE__ */ React.createElement(
122
+ "span",
123
+ {
124
+ ref: forwardedRef,
125
+ "aria-label": children,
126
+ "data-ellipsis": true,
127
+ "data-testid": dataTestId,
128
+ className: clsx(textEllipsisCSS({ truncationMode }), consumerClassName),
129
+ style: consumerStyle,
130
+ ...remainingProps
131
+ },
132
+ /* @__PURE__ */ React.createElement("span", null, children)
133
+ );
134
+ });
135
+ const TextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
136
+ const cssOnlyEllipsis = !props.onTextOverflow && props.truncationMode !== "middle";
137
+ return cssOnlyEllipsis ? /* @__PURE__ */ React.createElement(CssTextEllipsis, { ref: forwardedRef, ...props }) : /* @__PURE__ */ React.createElement(ComputedTextEllipsis, { ref: forwardedRef, ...props });
138
+ });
139
+ TextEllipsis.displayName = "TextEllipsis";
140
+ export {
141
+ TextEllipsis
142
+ };
143
+ //# sourceMappingURL=TextEllipsis.js.map