@dynatrace/strato-components 0.85.10 → 0.85.21

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/buttons/button/Button.css +1 -0
  2. package/buttons/index.d.ts +2 -0
  3. package/buttons/index.js +2 -0
  4. package/buttons/intent-button/IntentButton.d.ts +44 -0
  5. package/buttons/intent-button/IntentButton.js +102 -0
  6. package/buttons/intent-button/useIntentButton.d.ts +12 -0
  7. package/buttons/intent-button/useIntentButton.js +72 -0
  8. package/content/index.d.ts +4 -0
  9. package/content/index.js +5 -1
  10. package/content/skeleton/Skeleton.css +33 -0
  11. package/content/skeleton/Skeleton.d.ts +30 -0
  12. package/content/skeleton/Skeleton.js +60 -0
  13. package/content/skeleton/Skeleton.sty.d.ts +10 -0
  14. package/content/skeleton/Skeleton.sty.js +25 -0
  15. package/content/skeleton/SkeletonText.d.ts +24 -0
  16. package/content/skeleton/SkeletonText.js +84 -0
  17. package/esm/buttons/button/Button.css +1 -0
  18. package/esm/buttons/index.js +2 -0
  19. package/esm/buttons/index.js.map +2 -2
  20. package/esm/buttons/intent-button/IntentButton.js +74 -0
  21. package/esm/buttons/intent-button/IntentButton.js.map +7 -0
  22. package/esm/buttons/intent-button/useIntentButton.js +57 -0
  23. package/esm/buttons/intent-button/useIntentButton.js.map +7 -0
  24. package/esm/content/index.js +5 -1
  25. package/esm/content/index.js.map +2 -2
  26. package/esm/content/skeleton/Skeleton.css +33 -0
  27. package/esm/content/skeleton/Skeleton.js +32 -0
  28. package/esm/content/skeleton/Skeleton.js.map +7 -0
  29. package/esm/content/skeleton/Skeleton.sty.js +7 -0
  30. package/esm/content/skeleton/Skeleton.sty.js.map +7 -0
  31. package/esm/content/skeleton/SkeletonText.js +56 -0
  32. package/esm/content/skeleton/SkeletonText.js.map +7 -0
  33. package/esm/layouts/{Divider → divider}/Divider.css +5 -5
  34. package/esm/layouts/{Divider → divider}/Divider.js.map +1 -1
  35. package/esm/layouts/{Divider → divider}/Divider.sty.js +1 -1
  36. package/esm/layouts/{Divider → divider}/Divider.sty.js.map +2 -2
  37. package/esm/layouts/helpers/spacingToCss.js +13 -0
  38. package/esm/layouts/helpers/spacingToCss.js.map +7 -0
  39. package/esm/layouts/hooks/useLayoutSizeProps.js +15 -0
  40. package/esm/layouts/hooks/useLayoutSizeProps.js.map +7 -0
  41. package/esm/layouts/hooks/useLayoutStyles.js +105 -0
  42. package/esm/layouts/hooks/useLayoutStyles.js.map +7 -0
  43. package/esm/layouts/hooks/useMarginProps.js +55 -0
  44. package/esm/layouts/hooks/useMarginProps.js.map +7 -0
  45. package/esm/layouts/hooks/usePaddingProps.js +59 -0
  46. package/esm/layouts/hooks/usePaddingProps.js.map +7 -0
  47. package/esm/layouts/index.js +6 -2
  48. package/esm/layouts/index.js.map +2 -2
  49. package/esm/layouts/surface/Surface.css +95 -0
  50. package/esm/layouts/surface/Surface.js +84 -0
  51. package/esm/layouts/surface/Surface.js.map +7 -0
  52. package/esm/layouts/surface/Surface.sty.js +10 -0
  53. package/esm/layouts/surface/Surface.sty.js.map +7 -0
  54. package/esm/layouts/surface/variables.sty.js +5 -0
  55. package/esm/layouts/surface/variables.sty.js.map +7 -0
  56. package/esm/layouts/types/layout.types.js +1 -0
  57. package/esm/layouts/types/layout.types.js.map +7 -0
  58. package/esm/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  59. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js.map +2 -2
  60. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  61. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js.map +2 -2
  62. package/{typography/Code → esm/typography/code}/Code.css +1 -1
  63. package/esm/typography/{Code → code}/Code.js.map +2 -2
  64. package/esm/typography/{Code → code}/Code.sty.js +1 -1
  65. package/esm/typography/{Code → code}/Code.sty.js.map +2 -2
  66. package/esm/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  67. package/esm/typography/{Emphasis → emphasis}/Emphasis.js.map +2 -2
  68. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  69. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js.map +2 -2
  70. package/{typography/ExternalLink → esm/typography/external-link}/ExternalLink.css +6 -6
  71. package/esm/typography/{ExternalLink → external-link}/ExternalLink.js.map +2 -2
  72. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  73. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js.map +2 -2
  74. package/esm/typography/{Heading → heading}/Heading.css +7 -7
  75. package/esm/typography/heading/Heading.js.map +7 -0
  76. package/esm/typography/heading/Heading.sty.js +7 -0
  77. package/esm/typography/{Heading → heading}/Heading.sty.js.map +2 -2
  78. package/esm/typography/{Highlight → highlight}/Highlight.css +1 -1
  79. package/esm/typography/{Highlight → highlight}/Highlight.js.map +2 -2
  80. package/esm/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  81. package/esm/typography/{Highlight → highlight}/Highlight.sty.js.map +2 -2
  82. package/esm/typography/index.js +13 -13
  83. package/esm/typography/index.js.map +1 -1
  84. package/{typography/Link → esm/typography/link}/Link.css +4 -4
  85. package/esm/typography/{Link → link}/Link.js +1 -1
  86. package/esm/typography/link/Link.js.map +7 -0
  87. package/esm/typography/{Link → link}/Link.sty.js +1 -1
  88. package/esm/typography/{Link → link}/Link.sty.js.map +2 -2
  89. package/esm/typography/{List → list}/List.css +4 -4
  90. package/esm/typography/{List → list}/List.js +1 -1
  91. package/esm/typography/{List → list}/List.js.map +2 -2
  92. package/esm/typography/{List → list}/List.sty.js +2 -2
  93. package/esm/typography/{List → list}/List.sty.js.map +2 -2
  94. package/esm/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  95. package/esm/typography/{Paragraph → paragraph}/Paragraph.js.map +2 -2
  96. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  97. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js.map +2 -2
  98. package/{typography/Strikethrough → esm/typography/strikethrough}/Strikethrough.css +1 -1
  99. package/esm/typography/strikethrough/Strikethrough.js.map +7 -0
  100. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  101. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js.map +2 -2
  102. package/{typography/Strong → esm/typography/strong}/Strong.css +1 -1
  103. package/esm/typography/{Strong → strong}/Strong.js.map +2 -2
  104. package/esm/typography/{Strong → strong}/Strong.sty.js +1 -1
  105. package/esm/typography/{Strong → strong}/Strong.sty.js.map +2 -2
  106. package/{typography/Text → esm/typography/text}/Text.css +3 -3
  107. package/esm/typography/text/Text.js.map +7 -0
  108. package/esm/typography/{Text → text}/Text.sty.js +1 -1
  109. package/esm/typography/{Text → text}/Text.sty.js.map +2 -2
  110. package/{typography/TextEllipsis → esm/typography/text-ellipsis}/TextEllipsis.css +4 -4
  111. package/esm/typography/text-ellipsis/TextEllipsis.js.map +7 -0
  112. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +7 -0
  113. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js.map +2 -2
  114. package/lang/en.json +6 -0
  115. package/lang/ja.json +24 -0
  116. package/lang/uncompiled/en.json +4 -0
  117. package/lang/uncompiled/ja.json +14 -1
  118. package/layouts/{Divider → divider}/Divider.css +5 -5
  119. package/layouts/{Divider → divider}/Divider.sty.js +1 -1
  120. package/layouts/helpers/spacingToCss.d.ts +6 -0
  121. package/layouts/helpers/spacingToCss.js +29 -0
  122. package/layouts/hooks/useLayoutSizeProps.d.ts +6 -0
  123. package/layouts/hooks/useLayoutSizeProps.js +33 -0
  124. package/layouts/hooks/useLayoutStyles.d.ts +7 -0
  125. package/layouts/hooks/useLayoutStyles.js +123 -0
  126. package/layouts/hooks/useMarginProps.d.ts +7 -0
  127. package/layouts/hooks/useMarginProps.js +73 -0
  128. package/layouts/hooks/usePaddingProps.d.ts +7 -0
  129. package/layouts/hooks/usePaddingProps.js +77 -0
  130. package/layouts/index.d.ts +6 -2
  131. package/layouts/index.js +6 -2
  132. package/layouts/surface/Surface.css +95 -0
  133. package/layouts/surface/Surface.d.ts +46 -0
  134. package/layouts/surface/Surface.js +110 -0
  135. package/layouts/surface/Surface.sty.d.ts +43 -0
  136. package/layouts/surface/Surface.sty.js +28 -0
  137. package/layouts/surface/variables.sty.d.ts +1 -0
  138. package/layouts/surface/variables.sty.js +23 -0
  139. package/layouts/types/layout.types.d.ts +64 -0
  140. package/layouts/types/layout.types.js +15 -0
  141. package/package.json +2 -2
  142. package/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  143. package/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  144. package/{esm/typography/Code → typography/code}/Code.css +1 -1
  145. package/typography/{Code → code}/Code.sty.js +1 -1
  146. package/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  147. package/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  148. package/{esm/typography/ExternalLink → typography/external-link}/ExternalLink.css +6 -6
  149. package/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  150. package/typography/{Heading → heading}/Heading.css +7 -7
  151. package/typography/{Heading → heading}/Heading.d.ts +3 -2
  152. package/typography/{Heading → heading}/Heading.sty.js +1 -1
  153. package/typography/{Highlight → highlight}/Highlight.css +1 -1
  154. package/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  155. package/typography/index.d.ts +26 -26
  156. package/typography/index.js +13 -13
  157. package/{esm/typography/Link → typography/link}/Link.css +4 -4
  158. package/typography/{Link → link}/Link.js +1 -1
  159. package/typography/{Link → link}/Link.sty.js +1 -1
  160. package/typography/{List → list}/List.css +4 -4
  161. package/typography/{List → list}/List.js +1 -1
  162. package/typography/{List → list}/List.sty.js +2 -2
  163. package/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  164. package/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  165. package/{esm/typography/Strikethrough → typography/strikethrough}/Strikethrough.css +1 -1
  166. package/typography/{Strikethrough → strikethrough}/Strikethrough.d.ts +2 -2
  167. package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  168. package/{esm/typography/Strong → typography/strong}/Strong.css +1 -1
  169. package/typography/{Strong → strong}/Strong.sty.js +1 -1
  170. package/{esm/typography/Text → typography/text}/Text.css +3 -3
  171. package/typography/{Text → text}/Text.d.ts +3 -2
  172. package/typography/{Text → text}/Text.sty.js +1 -1
  173. package/{esm/typography/TextEllipsis → typography/text-ellipsis}/TextEllipsis.css +4 -4
  174. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.d.ts +3 -3
  175. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js +1 -1
  176. package/esm/typography/Heading/Heading.js.map +0 -7
  177. package/esm/typography/Heading/Heading.sty.js +0 -7
  178. package/esm/typography/Link/Link.js.map +0 -7
  179. package/esm/typography/Strikethrough/Strikethrough.js.map +0 -7
  180. package/esm/typography/Text/Text.js.map +0 -7
  181. package/esm/typography/TextEllipsis/TextEllipsis.js.map +0 -7
  182. package/esm/typography/TextEllipsis/TextEllipsis.sty.js +0 -7
  183. package/esm/layouts/{Divider → divider}/Divider.js +0 -0
  184. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  185. package/esm/typography/{Code → code}/Code.js +0 -0
  186. package/esm/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  187. package/esm/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  188. package/esm/typography/{Heading → heading}/Heading.js +0 -0
  189. package/esm/typography/{Highlight → highlight}/Highlight.js +0 -0
  190. package/esm/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  191. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  192. package/esm/typography/{Strong → strong}/Strong.js +0 -0
  193. package/esm/typography/{Text → text}/Text.js +0 -0
  194. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  195. package/layouts/{Divider → divider}/Divider.d.ts +0 -0
  196. package/layouts/{Divider → divider}/Divider.js +0 -0
  197. package/layouts/{Divider → divider}/Divider.sty.d.ts +0 -0
  198. package/typography/{BlockQuote → block-quote}/Blockquote.d.ts +1 -1
  199. package/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  200. package/typography/{BlockQuote → block-quote}/Blockquote.sty.d.ts +0 -0
  201. package/typography/{Code → code}/Code.d.ts +1 -1
  202. package/typography/{Code → code}/Code.js +0 -0
  203. package/typography/{Code → code}/Code.sty.d.ts +0 -0
  204. package/typography/{Emphasis → emphasis}/Emphasis.d.ts +1 -1
  205. package/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  206. package/typography/{Emphasis → emphasis}/Emphasis.sty.d.ts +0 -0
  207. package/typography/{ExternalLink → external-link}/ExternalLink.d.ts +1 -1
  208. package/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  209. package/typography/{ExternalLink → external-link}/ExternalLink.sty.d.ts +0 -0
  210. package/typography/{Heading → heading}/Heading.js +0 -0
  211. package/typography/{Heading → heading}/Heading.sty.d.ts +0 -0
  212. package/typography/{Highlight → highlight}/Highlight.d.ts +1 -1
  213. package/typography/{Highlight → highlight}/Highlight.js +0 -0
  214. package/typography/{Highlight → highlight}/Highlight.sty.d.ts +0 -0
  215. package/typography/{Link → link}/Link.d.ts +1 -1
  216. package/typography/{Link → link}/Link.sty.d.ts +0 -0
  217. package/typography/{List → list}/List.d.ts +1 -1
  218. package/typography/{List → list}/List.sty.d.ts +0 -0
  219. package/typography/{Paragraph → paragraph}/Paragraph.d.ts +1 -1
  220. package/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  221. package/typography/{Paragraph → paragraph}/Paragraph.sty.d.ts +0 -0
  222. package/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  223. package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.d.ts +0 -0
  224. package/typography/{Strong → strong}/Strong.d.ts +1 -1
  225. /package/typography/{Strong → strong}/Strong.js +0 -0
  226. /package/typography/{Strong → strong}/Strong.sty.d.ts +0 -0
  227. /package/typography/{Text → text}/Text.js +0 -0
  228. /package/typography/{Text → text}/Text.sty.d.ts +0 -0
  229. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  230. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/heading/Heading.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { headingCSS } from './Heading.sty.js';\nimport {\n type DataTestId,\n type StylingProps,\n type WithChildren,\n type MaskingProps,\n} from '../../core/index.js';\nimport type { DOMProps } from '../../core/types/dom.js';\nimport type { _HeadingTag } from '../../core/types/heading.js';\n\n/**\n * Props used for the Heading component\n * @public\n */\nexport interface HeadingProps\n extends DOMProps,\n WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The visual level of the heading.\n * @defaultValue 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * The polymorphed HTML tag that determines the semantic level of the heading.\n * @defaultValue 'h1'\n */\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n}\n\n/**\n * Use the `Heading` to render semantic HTML heading elements (`h1`, `h2`, etc.).\n * The component allows you to independently define both the visual and the semantic level of the heading.\n * @public\n */\nexport const Heading = /* @__PURE__ */ forwardRef<\n HTMLHeadingElement,\n HeadingProps\n>((props, forwardedRef) => {\n const {\n level,\n children,\n as,\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 const visualLevel = level ?? 1;\n // semantic level\n const HeadingTag: _HeadingTag = as ?? (`h${visualLevel}` as _HeadingTag);\n\n return (\n <HeadingTag\n ref={forwardedRef}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(headingCSS({ visualLevel }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </HeadingTag>\n );\n});\n(Heading as typeof Heading & { displayName: string }).displayName = 'Heading';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,kBAAkB;AAqCpB,MAAM,UAA0B,2BAGrC,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,cAAc,SAAS;AAE7B,QAAM,aAA0B,MAAO,IAAI,WAAW;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,WAAW,KAAK,WAAW,EAAE,YAAY,CAAC,GAAG,iBAAiB;AAAA,MAC9D,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AACA,QAAqD,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import "./Heading.css";
2
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ var headingCSS = _7a468({ defaultClassName: "Heading_headingCSS__5ei34w0", variantClassNames: { visualLevel: { "1": "Heading_headingCSS_visualLevel_1__5ei34w1", "2": "Heading_headingCSS_visualLevel_2__5ei34w2", "3": "Heading_headingCSS_visualLevel_3__5ei34w3", "4": "Heading_headingCSS_visualLevel_4__5ei34w4", "5": "Heading_headingCSS_visualLevel_5__5ei34w5", "6": "Heading_headingCSS_visualLevel_6__5ei34w6" } }, defaultVariants: {}, compoundVariants: [] });
4
+ export {
5
+ headingCSS
6
+ };
7
+ //# sourceMappingURL=Heading.sty.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Heading/Heading.css.ts"],
4
- "sourcesContent": ["import './Heading.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var headingCSS = _7a468({defaultClassName:'Heading_headingCSS__u4t9450',variantClassNames:{visualLevel:{'1':'Heading_headingCSS_visualLevel_1__u4t9451','2':'Heading_headingCSS_visualLevel_2__u4t9452','3':'Heading_headingCSS_visualLevel_3__u4t9453','4':'Heading_headingCSS_visualLevel_4__u4t9454','5':'Heading_headingCSS_visualLevel_5__u4t9455','6':'Heading_headingCSS_visualLevel_6__u4t9456'}},defaultVariants:{},compoundVariants:[]});"],
3
+ "sources": ["../../../../src/typography/heading/Heading.css.ts"],
4
+ "sourcesContent": ["import './Heading.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var headingCSS = _7a468({defaultClassName:'Heading_headingCSS__5ei34w0',variantClassNames:{visualLevel:{'1':'Heading_headingCSS_visualLevel_1__5ei34w1','2':'Heading_headingCSS_visualLevel_2__5ei34w2','3':'Heading_headingCSS_visualLevel_3__5ei34w3','4':'Heading_headingCSS_visualLevel_4__5ei34w4','5':'Heading_headingCSS_visualLevel_5__5ei34w5','6':'Heading_headingCSS_visualLevel_6__5ei34w6'}},defaultVariants:{},compoundVariants:[]});"],
5
5
  "mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,aAAa,OAAO,EAAC,kBAAiB,+BAA8B,mBAAkB,EAAC,aAAY,EAAC,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,6CAA4C,KAAI,4CAA2C,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- .Highlight_highlightCSS__1u4tng00 {
1
+ .Highlight_highlightCSS__lajjl30 {
2
2
  color: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
3
3
  background: var(--dt-colors-background-container-neutral-accent, #5a5b8c);
4
4
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Highlight/Highlight.tsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport React, { ReactElement, ReactNode, ReactText } from 'react';\n\nimport { highlightCSS } from './Highlight.sty.js';\nimport { type DataTestId, type WithChildren } from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Heading component.\n * @public\n */\nexport interface HighlightProps extends WithChildren, DataTestId, MaskingProps {\n /**\n * Either a substring or an array of multiple different substrings that\n * should be highlighted in the projected content.\n * Every occurrence of the string(s) is highlighted accordingly.\n */\n term: string | string[];\n\n /**\n * Property that determines whether the highlighting search is case-sensitive.\n * If set to `true`, the component searches for case sensitive occurrences.\n * @defaultValue false\n */\n caseSensitive?: boolean;\n}\n\nconst HTML_CHARS_OVERRIDES: [RegExp, string][] = [\n [/&lt;/g, '<'],\n [/&gt;/g, '>'],\n [/&amp;/g, '&'],\n [/&nbsp;/g, ' '],\n];\n\n/** Escapes all characters that could be dangerous for a regular expression */\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/** Highlights all occurences of a list of terms within a ReactNode. */\nfunction highlightChildren(\n children: ReactNode,\n term: string | string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n) {\n const terms = (() => {\n if (Array.isArray(term)) {\n return term.filter((t) => t);\n }\n\n return term ? [term] : [];\n })();\n\n return terms.length > 0\n ? React.Children.map(children, (child: ReactNode) =>\n highlightRecursive(\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n )\n : children;\n}\n\n/**\n * Iterates over all children of a ReactNode recursively to look\n * for a list of terms and highlights them.\n */\nfunction highlightRecursive(\n sourceElement: ReactNode,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (!sourceElement) {\n return sourceElement;\n }\n\n if (React.isValidElement(sourceElement)) {\n const children = React.Children.map(sourceElement.props.children, (child) =>\n highlightRecursive(\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n );\n\n return React.cloneElement(sourceElement, sourceElement.props, children);\n }\n\n return highlightLeafElement(\n sourceElement as ReactText,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n );\n}\n\n/** Highlights parts of the text that match a certain group of terms. */\nfunction highlightLeafElement(\n textContent: ReactText,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (terms.length === 0) {\n return textContent;\n }\n\n const sanitizedTextContent = HTML_CHARS_OVERRIDES.reduce(\n (text, [needle, replacement]) => text.replace(needle, replacement),\n `${textContent}`,\n );\n const termsInLowerCase = terms.map((t) => t.toLowerCase());\n\n return getTextTokens(sanitizedTextContent, terms, caseSensitive).map(\n (token: string) =>\n termsInLowerCase.includes(token.toLowerCase()) ? (\n <mark\n role=\"mark\"\n className={clsx(highlightCSS)}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n >\n {token}\n </mark>\n ) : (\n <span>{token}</span>\n ),\n );\n}\n\n/**\n * Splits text into an array of strings where a given list of terms\n * acts as separator strings.\n */\nfunction getTextTokens(\n textContent: ReactText,\n terms: string[],\n caseSensitive: boolean,\n): string[] {\n const flags = caseSensitive ? 'gm' : 'gmi';\n const regExp = new RegExp(\n `(${terms.map((t) => escapeRegExp(t)).join('|')})`,\n flags,\n );\n\n return textContent\n .toString()\n .split(regExp)\n .filter((s) => s.length > 0);\n}\n\n/**\n * @public\n * Use the `Highlight` component to highlight one or more substrings within a\n * text.\n */\nexport const Highlight = (props: HighlightProps): ReactElement => {\n const {\n children,\n term,\n caseSensitive = false,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n } = props;\n\n return (\n <>\n {highlightChildren(\n children,\n term,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n )}\n </>\n );\n};\n\n(Highlight as typeof Highlight & { displayName: string }).displayName =\n 'Highlight';\n"],
3
+ "sources": ["../../../../src/typography/highlight/Highlight.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { ReactElement, ReactNode, ReactText } from 'react';\n\nimport { highlightCSS } from './Highlight.sty.js';\nimport { type DataTestId, type WithChildren } from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Heading component.\n * @public\n */\nexport interface HighlightProps extends WithChildren, DataTestId, MaskingProps {\n /**\n * Either a substring or an array of multiple different substrings that\n * should be highlighted in the projected content.\n * Every occurrence of the string(s) is highlighted accordingly.\n */\n term: string | string[];\n\n /**\n * Property that determines whether the highlighting search is case-sensitive.\n * If set to `true`, the component searches for case sensitive occurrences.\n * @defaultValue false\n */\n caseSensitive?: boolean;\n}\n\nconst HTML_CHARS_OVERRIDES: [RegExp, string][] = [\n [/&lt;/g, '<'],\n [/&gt;/g, '>'],\n [/&amp;/g, '&'],\n [/&nbsp;/g, ' '],\n];\n\n/** Escapes all characters that could be dangerous for a regular expression */\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/** Highlights all occurences of a list of terms within a ReactNode. */\nfunction highlightChildren(\n children: ReactNode,\n term: string | string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n) {\n const terms = (() => {\n if (Array.isArray(term)) {\n return term.filter((t) => t);\n }\n\n return term ? [term] : [];\n })();\n\n return terms.length > 0\n ? React.Children.map(children, (child: ReactNode) =>\n highlightRecursive(\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n )\n : children;\n}\n\n/**\n * Iterates over all children of a ReactNode recursively to look\n * for a list of terms and highlights them.\n */\nfunction highlightRecursive(\n sourceElement: ReactNode,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (!sourceElement) {\n return sourceElement;\n }\n\n if (React.isValidElement(sourceElement)) {\n const children = React.Children.map(sourceElement.props.children, (child) =>\n highlightRecursive(\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n );\n\n return React.cloneElement(sourceElement, sourceElement.props, children);\n }\n\n return highlightLeafElement(\n sourceElement as ReactText,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n );\n}\n\n/** Highlights parts of the text that match a certain group of terms. */\nfunction highlightLeafElement(\n textContent: ReactText,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (terms.length === 0) {\n return textContent;\n }\n\n const sanitizedTextContent = HTML_CHARS_OVERRIDES.reduce(\n (text, [needle, replacement]) => text.replace(needle, replacement),\n `${textContent}`,\n );\n const termsInLowerCase = terms.map((t) => t.toLowerCase());\n\n return getTextTokens(sanitizedTextContent, terms, caseSensitive).map(\n (token: string) =>\n termsInLowerCase.includes(token.toLowerCase()) ? (\n <mark\n role=\"mark\"\n className={clsx(highlightCSS)}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n >\n {token}\n </mark>\n ) : (\n <span>{token}</span>\n ),\n );\n}\n\n/**\n * Splits text into an array of strings where a given list of terms\n * acts as separator strings.\n */\nfunction getTextTokens(\n textContent: ReactText,\n terms: string[],\n caseSensitive: boolean,\n): string[] {\n const flags = caseSensitive ? 'gm' : 'gmi';\n const regExp = new RegExp(\n `(${terms.map((t) => escapeRegExp(t)).join('|')})`,\n flags,\n );\n\n return textContent\n .toString()\n .split(regExp)\n .filter((s) => s.length > 0);\n}\n\n/**\n * Use the `Highlight` component to highlight one or more substrings within a\n * text.\n * @public\n */\nexport const Highlight = (props: HighlightProps): ReactElement => {\n const {\n children,\n term,\n caseSensitive = false,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n } = props;\n\n return (\n <>\n {highlightChildren(\n children,\n term,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n )}\n </>\n );\n};\n\n(Highlight as typeof Highlight & { displayName: string }).displayName =\n 'Highlight';\n"],
5
5
  "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,WAAmD;AAE1D,SAAS,oBAAoB;AAwB7B,MAAM,uBAA2C;AAAA,EAC/C,CAAC,SAAS,GAAG;AAAA,EACb,CAAC,SAAS,GAAG;AAAA,EACb,CAAC,UAAU,GAAG;AAAA,EACd,CAAC,WAAW,GAAG;AACjB;AAGA,SAAS,aAAa,MAAsB;AAC1C,SAAO,KAAK,QAAQ,uBAAuB,MAAM;AACnD;AAGA,SAAS,kBACP,UACA,MACA,eACA,YACA,eACA,gBACA;AACA,QAAM,SAAS,MAAM;AACnB,QAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,aAAO,KAAK,OAAO,CAAC,MAAM,CAAC;AAAA,IAC7B;AAEA,WAAO,OAAO,CAAC,IAAI,IAAI,CAAC;AAAA,EAC1B,GAAG;AAEH,SAAO,MAAM,SAAS,IAClB,MAAM,SAAS;AAAA,IAAI;AAAA,IAAU,CAAC,UAC5B;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,IACA;AACN;AAMA,SAAS,mBACP,eACA,OACA,eACA,YACA,eACA,gBACW;AACX,MAAI,CAAC,eAAe;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,eAAe,aAAa,GAAG;AACvC,UAAM,WAAW,MAAM,SAAS;AAAA,MAAI,cAAc,MAAM;AAAA,MAAU,CAAC,UACjE;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,WAAO,MAAM,aAAa,eAAe,cAAc,OAAO,QAAQ;AAAA,EACxE;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAGA,SAAS,qBACP,aACA,OACA,eACA,YACA,eACA,gBACW;AACX,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO;AAAA,EACT;AAEA,QAAM,uBAAuB,qBAAqB;AAAA,IAChD,CAAC,MAAM,CAAC,QAAQ,WAAW,MAAM,KAAK,QAAQ,QAAQ,WAAW;AAAA,IACjE,GAAG,WAAW;AAAA,EAChB;AACA,QAAM,mBAAmB,MAAM,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC;AAEzD,SAAO,cAAc,sBAAsB,OAAO,aAAa,EAAE;AAAA,IAC/D,CAAC,UACC,iBAAiB,SAAS,MAAM,YAAY,CAAC,IAC3C;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAW,KAAK,YAAY;AAAA,QAC5B,mBAAiB;AAAA,QACjB,oBAAkB;AAAA;AAAA,MAEjB;AAAA,IACH,IAEA,oCAAC,cAAM,KAAM;AAAA,EAEnB;AACF;AAMA,SAAS,cACP,aACA,OACA,eACU;AACV,QAAM,QAAQ,gBAAgB,OAAO;AACrC,QAAM,SAAS,IAAI;AAAA,IACjB,IAAI,MAAM,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO,YACJ,SAAS,EACT,MAAM,MAAM,EACZ,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;AAC/B;AAOO,MAAM,YAAY,CAAC,UAAwC;AAChE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB,IAAI;AAEJ,SACE,0DACG;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AAEJ;AAEC,UAAyD,cACxD;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import "./Highlight.css";
2
- var highlightCSS = "Highlight_highlightCSS__1u4tng00";
2
+ var highlightCSS = "Highlight_highlightCSS__lajjl30";
3
3
  export {
4
4
  highlightCSS
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Highlight/Highlight.css.ts"],
4
- "sourcesContent": ["import './Highlight.css';\nexport var highlightCSS = 'Highlight_highlightCSS__1u4tng00';"],
3
+ "sources": ["../../../../src/typography/highlight/Highlight.css.ts"],
4
+ "sourcesContent": ["import './Highlight.css';\nexport var highlightCSS = 'Highlight_highlightCSS__lajjl30';"],
5
5
  "mappings": "AAAA,OAAO;AACA,IAAI,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,16 @@
1
- import { Blockquote } from "./BlockQuote/Blockquote.js";
2
- import { Code } from "./Code/Code.js";
3
- import { Emphasis } from "./Emphasis/Emphasis.js";
4
- import { ExternalLink } from "./ExternalLink/ExternalLink.js";
5
- import { Heading } from "./Heading/Heading.js";
6
- import { Highlight } from "./Highlight/Highlight.js";
7
- import { Link } from "./Link/Link.js";
8
- import { List } from "./List/List.js";
9
- import { Paragraph } from "./Paragraph/Paragraph.js";
10
- import { Strikethrough } from "./Strikethrough/Strikethrough.js";
11
- import { Strong } from "./Strong/Strong.js";
12
- import { Text } from "./Text/Text.js";
13
- import { TextEllipsis } from "./TextEllipsis/TextEllipsis.js";
1
+ import { Blockquote } from "./block-quote/Blockquote.js";
2
+ import { Code } from "./code/Code.js";
3
+ import { Emphasis } from "./emphasis/Emphasis.js";
4
+ import { ExternalLink } from "./external-link/ExternalLink.js";
5
+ import { Heading } from "./heading/Heading.js";
6
+ import { Highlight } from "./highlight/Highlight.js";
7
+ import { Link } from "./link/Link.js";
8
+ import { List } from "./list/List.js";
9
+ import { Paragraph } from "./paragraph/Paragraph.js";
10
+ import { Strikethrough } from "./strikethrough/Strikethrough.js";
11
+ import { Strong } from "./strong/Strong.js";
12
+ import { Text } from "./text/Text.js";
13
+ import { TextEllipsis } from "./text-ellipsis/TextEllipsis.js";
14
14
  import {
15
15
  _calculateEllipsisInfo,
16
16
  _getTextHeight,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/typography/index.ts"],
4
- "sourcesContent": ["export { Blockquote } from './BlockQuote/Blockquote.js';\nexport type { BlockquoteProps } from './BlockQuote/Blockquote.js';\nexport { Code } from './Code/Code.js';\nexport type { CodeProps } from './Code/Code.js';\nexport { Emphasis } from './Emphasis/Emphasis.js';\nexport type { EmphasisProps } from './Emphasis/Emphasis.js';\nexport { ExternalLink } from './ExternalLink/ExternalLink.js';\nexport type { ExternalLinkProps } from './ExternalLink/ExternalLink.js';\nexport { Heading } from './Heading/Heading.js';\nexport type { HeadingProps } from './Heading/Heading.js';\nexport { Highlight } from './Highlight/Highlight.js';\nexport type { HighlightProps } from './Highlight/Highlight.js';\nexport { Link } from './Link/Link.js';\nexport type { LinkProps } from './Link/Link.js';\nexport { List } from './List/List.js';\nexport type { ListProps } from './List/List.js';\nexport { Paragraph } from './Paragraph/Paragraph.js';\nexport type { ParagraphProps } from './Paragraph/Paragraph.js';\nexport { Strikethrough } from './Strikethrough/Strikethrough.js';\nexport type { StrikethroughProps } from './Strikethrough/Strikethrough.js';\nexport { Strong } from './Strong/Strong.js';\nexport type { StrongProps } from './Strong/Strong.js';\nexport { Text } from './Text/Text.js';\nexport type { TextOwnProps, TextProps } from './Text/Text.js';\nexport { TextEllipsis } from './TextEllipsis/TextEllipsis.js';\nexport type {\n TextEllipsisProps,\n _TruncationMode,\n} from './TextEllipsis/TextEllipsis.js';\nexport {\n _calculateEllipsisInfo,\n _getTextHeight,\n _centerEllipsizeText,\n _getTextWidth,\n _ELLIPSIS_APPROXIMATION_THRESHOLD,\n _ELLIPSIS_CHARACTER,\n} from './utils.js';\nexport type { _Font } from './utils.js';\n"],
4
+ "sourcesContent": ["export { Blockquote } from './block-quote/Blockquote.js';\nexport type { BlockquoteProps } from './block-quote/Blockquote.js';\nexport { Code } from './code/Code.js';\nexport type { CodeProps } from './code/Code.js';\nexport { Emphasis } from './emphasis/Emphasis.js';\nexport type { EmphasisProps } from './emphasis/Emphasis.js';\nexport { ExternalLink } from './external-link/ExternalLink.js';\nexport type { ExternalLinkProps } from './external-link/ExternalLink.js';\nexport { Heading } from './heading/Heading.js';\nexport type { HeadingProps } from './heading/Heading.js';\nexport { Highlight } from './highlight/Highlight.js';\nexport type { HighlightProps } from './highlight/Highlight.js';\nexport { Link } from './link/Link.js';\nexport type { LinkProps } from './link/Link.js';\nexport { List } from './list/List.js';\nexport type { ListProps } from './list/List.js';\nexport { Paragraph } from './paragraph/Paragraph.js';\nexport type { ParagraphProps } from './paragraph/Paragraph.js';\nexport { Strikethrough } from './strikethrough/Strikethrough.js';\nexport type { StrikethroughProps } from './strikethrough/Strikethrough.js';\nexport { Strong } from './strong/Strong.js';\nexport type { StrongProps } from './strong/Strong.js';\nexport { Text } from './text/Text.js';\nexport type { TextOwnProps, TextProps } from './text/Text.js';\nexport { TextEllipsis } from './text-ellipsis/TextEllipsis.js';\nexport type {\n TextEllipsisProps,\n _TruncationMode,\n} from './text-ellipsis/TextEllipsis.js';\nexport {\n _calculateEllipsisInfo,\n _getTextHeight,\n _centerEllipsizeText,\n _getTextWidth,\n _ELLIPSIS_APPROXIMATION_THRESHOLD,\n _ELLIPSIS_CHARACTER,\n} from './utils.js';\nexport type { _Font } from './utils.js';\n"],
5
5
  "mappings": "AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AAErB,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAE7B,SAAS,eAAe;AAExB,SAAS,iBAAiB;AAE1B,SAAS,YAAY;AAErB,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAE1B,SAAS,qBAAqB;AAE9B,SAAS,cAAc;AAEvB,SAAS,YAAY;AAErB,SAAS,oBAAoB;AAK7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,15 @@
1
- .Link_linkCSS__1ck42do0 {
1
+ .Link_linkCSS__1iksxp40 {
2
2
  display: inline-block;
3
3
  color: var(--dt-colors-text-primary-default, #454cc9);
4
4
  text-decoration: underline;
5
5
  overflow-wrap: anywhere;
6
6
  }
7
- .Link_linkCSS__1ck42do0:hover {
7
+ .Link_linkCSS__1iksxp40:hover {
8
8
  color: var(--dt-colors-text-primary-default-hover, #3332ae);
9
9
  }
10
- .Link_linkCSS__1ck42do0:active {
10
+ .Link_linkCSS__1iksxp40:active {
11
11
  color: var(--dt-colors-text-primary-default-active, #241193);
12
12
  }
13
- .Link_linkCSS__1ck42do0:focus-visible {
13
+ .Link_linkCSS__1iksxp40:focus-visible {
14
14
  text-decoration: none;
15
15
  }
@@ -1,10 +1,10 @@
1
1
  import clsx from "clsx";
2
2
  import React, { forwardRef } from "react";
3
+ import { linkCSS } from "./Link.sty.js";
3
4
  import {
4
5
  _mergeProps
5
6
  } from "../../core/index.js";
6
7
  import { useFocusRing } from "../../core/styles/useFocusRing.js";
7
- import { linkCSS } from "../Link/Link.sty.js";
8
8
  const Link = /* @__PURE__ */ forwardRef(
9
9
  ({
10
10
  children,
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/link/Link.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { ElementType, forwardRef, ReactElement } from 'react';\n\nimport { linkCSS } from './Link.sty.js';\nimport {\n type PolymorphicComponentProps,\n type DataTestId,\n type StylingProps,\n type WithChildren,\n _mergeProps,\n} from '../../core/index.js';\nimport { useFocusRing } from '../../core/styles/useFocusRing.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Link component.\n * @public\n */\nexport type LinkProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n WithChildren & StylingProps & DataTestId & MaskingProps\n>;\n\n/**\n * Use the `Link` component to navigate to a different page within the application.\n * For external resources in a different domain, use the\n * {@link https://developer.dynatrace.com/design/components/typography/ExternalLink/ | `ExternalLink`}\n * component instead.\n * @public\n */\nexport const Link: <E extends ElementType = 'a'>(\n props: LinkProps<E>,\n) => ReactElement | null = /* @__PURE__ */ forwardRef(\n <E extends ElementType>(\n {\n children,\n as,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n }: LinkProps<E>,\n ref: typeof remainingProps.ref,\n ) => {\n const { focusProps, focusClassName } = useFocusRing({\n variant: 'primary',\n isMinimal: true,\n });\n const LinkTag = as || 'a';\n\n return (\n <LinkTag\n ref={ref}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(focusClassName, linkCSS, consumerClassName)}\n style={consumerStyle}\n {..._mergeProps(\n // Need to cast this one as the inference of mergeProps would generate\n // a not allowed overlap. The remainingProps type is too complex due to the\n // polymorphic inheritance.\n remainingProps as Record<string, unknown>,\n focusProps,\n )}\n >\n {children}\n </LinkTag>\n );\n },\n);\n\n(Link as typeof Link & { displayName: string }).displayName = 'Link';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAsB,kBAAgC;AAE7D,SAAS,eAAe;AACxB;AAAA,EAKE;AAAA,OACK;AACP,SAAS,oBAAoB;AAmBtB,MAAM,OAE8B;AAAA,EACzC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,OAAO;AAAA,IACP,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,EAAE,YAAY,eAAe,IAAI,aAAa;AAAA,MAClD,SAAS;AAAA,MACT,WAAW;AAAA,IACb,CAAC;AACD,UAAM,UAAU,MAAM;AAEtB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,WAAW,KAAK,gBAAgB,SAAS,iBAAiB;AAAA,QAC1D,OAAO;AAAA,QACN,GAAG;AAAA;AAAA;AAAA;AAAA,UAIF;AAAA,UACA;AAAA,QACF;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,KAA+C,cAAc;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
1
  import "./Link.css";
2
- var linkCSS = "Link_linkCSS__1ck42do0";
2
+ var linkCSS = "Link_linkCSS__1iksxp40";
3
3
  export {
4
4
  linkCSS
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Link/Link.css.ts"],
4
- "sourcesContent": ["import './Link.css';\nexport var linkCSS = 'Link_linkCSS__1ck42do0';"],
3
+ "sources": ["../../../../src/typography/link/Link.css.ts"],
4
+ "sourcesContent": ["import './Link.css';\nexport var linkCSS = 'Link_linkCSS__1iksxp40';"],
5
5
  "mappings": "AAAA,OAAO;AACA,IAAI,UAAU;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,16 @@
1
- .List_listCSS__13d6w3n0 {
1
+ .List_listCSS__16276mt0 {
2
2
  margin: 0;
3
3
  padding-left: var(--dt-spacings-size-40, 40px);
4
4
  }
5
- .List_listCSS__13d6w3n0 .List_listCSS__13d6w3n0 {
5
+ .List_listCSS__16276mt0 .List_listCSS__16276mt0 {
6
6
  margin-block: var(--dt-spacings-size-4, 4px);
7
7
  padding-left: var(--dt-spacings-size-28, 28px);
8
8
  }
9
- .List_listItemCSS__13d6w3n1 {
9
+ .List_listItemCSS__16276mt1 {
10
10
  position: relative;
11
11
  overflow-wrap: break-word;
12
12
  margin-block: var(--dt-spacings-size-2, 2px);
13
13
  }
14
- .List_listItemCSS__13d6w3n1::marker {
14
+ .List_listItemCSS__16276mt1::marker {
15
15
  font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
16
16
  }
@@ -1,7 +1,7 @@
1
1
  import clsx from "clsx";
2
2
  import React, { forwardRef } from "react";
3
3
  import { listCSS, listItemCSS } from "./List.sty.js";
4
- import { Text } from "../Text/Text.js";
4
+ import { Text } from "../text/Text.js";
5
5
  function interleaveListItems(listItems) {
6
6
  const items = [];
7
7
  React.Children.forEach(listItems, (listItem) => {
@@ -1,7 +1,7 @@
1
1
  {
2
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 { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type 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"],
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 { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type 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 * 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 * @public\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
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
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import "./List.css";
2
- var listCSS = "List_listCSS__13d6w3n0";
3
- var listItemCSS = "List_listItemCSS__13d6w3n1";
2
+ var listCSS = "List_listCSS__16276mt0";
3
+ var listItemCSS = "List_listItemCSS__16276mt1";
4
4
  export {
5
5
  listCSS,
6
6
  listItemCSS
@@ -1,7 +1,7 @@
1
1
  {
2
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';"],
3
+ "sources": ["../../../../src/typography/list/List.css.ts"],
4
+ "sourcesContent": ["import './List.css';\nexport var listCSS = 'List_listCSS__16276mt0';\nexport var listItemCSS = 'List_listItemCSS__16276mt1';"],
5
5
  "mappings": "AAAA,OAAO;AACA,IAAI,UAAU;AACd,IAAI,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,17 +1,17 @@
1
- .Paragraph_paragraphCSS__42lz6l0 {
1
+ .Paragraph_paragraphCSS__487p2n0 {
2
2
  margin-top: 0;
3
3
  margin-bottom: 0;
4
4
  overflow-wrap: break-word;
5
5
  color: var(--dt-colors-text-neutral-default, #2b2a58);
6
6
  font-style: normal;
7
7
  }
8
- .Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1 {
8
+ .Paragraph_paragraphCSS_ellipsis_singleLine__487p2n1 {
9
9
  display: block;
10
10
  white-space: nowrap;
11
11
  text-overflow: ellipsis;
12
12
  overflow: hidden;
13
13
  }
14
- .Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2 {
14
+ .Paragraph_paragraphCSS_ellipsis_multiLine__487p2n2 {
15
15
  display: -webkit-box;
16
16
  -webkit-line-clamp: var(--strato-ellipsis-line-clamp);
17
17
  -webkit-box-orient: vertical;
@@ -1,7 +1,7 @@
1
1
  {
2
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"],
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 * The `Paragraph` component displays a block of text with the default text style and supports text truncation.\n * @public\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
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
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import "./Paragraph.css";
2
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: [] });
3
+ var paragraphCSS = _7a468({ defaultClassName: "Paragraph_paragraphCSS__487p2n0", variantClassNames: { ellipsis: { singleLine: "Paragraph_paragraphCSS_ellipsis_singleLine__487p2n1", multiLine: "Paragraph_paragraphCSS_ellipsis_multiLine__487p2n2" } }, defaultVariants: {}, compoundVariants: [] });
4
4
  export {
5
5
  paragraphCSS
6
6
  };
@@ -1,7 +1,7 @@
1
1
  {
2
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:[]});"],
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__487p2n0',variantClassNames:{ellipsis:{singleLine:'Paragraph_paragraphCSS_ellipsis_singleLine__487p2n1',multiLine:'Paragraph_paragraphCSS_ellipsis_multiLine__487p2n2'}},defaultVariants:{},compoundVariants:[]});"],
5
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
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- .Strikethrough_strikethroughCSS__1178y080 {
1
+ .Strikethrough_strikethroughCSS__4oao6y0 {
2
2
  text-decoration: line-through;
3
3
  text-decoration-style: solid;
4
4
  overflow-wrap: break-word;
@@ -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 * The `Strikethrough` component renders text with a line through it. Use it to\n * represent things that are no longer relevant or accurate.\n * @public\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
+ }
@@ -1,5 +1,5 @@
1
1
  import "./Strikethrough.css";
2
- var strikethroughCSS = "Strikethrough_strikethroughCSS__1178y080";
2
+ var strikethroughCSS = "Strikethrough_strikethroughCSS__4oao6y0";
3
3
  export {
4
4
  strikethroughCSS
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Strikethrough/Strikethrough.css.ts"],
4
- "sourcesContent": ["import './Strikethrough.css';\nexport var strikethroughCSS = 'Strikethrough_strikethroughCSS__1178y080';"],
3
+ "sources": ["../../../../src/typography/strikethrough/Strikethrough.css.ts"],
4
+ "sourcesContent": ["import './Strikethrough.css';\nexport var strikethroughCSS = 'Strikethrough_strikethroughCSS__4oao6y0';"],
5
5
  "mappings": "AAAA,OAAO;AACA,IAAI,mBAAmB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- .Strong_strongCSS__1sqovlt0 {
1
+ .Strong_strongCSS__wxp4dd0 {
2
2
  font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
3
3
  overflow-wrap: break-word;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  {
2
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"],
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 * Use the `Strong` component to render text in bold type to emphasize it.\n * @public\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
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
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import "./Strong.css";
2
- var strongCSS = "Strong_strongCSS__1sqovlt0";
2
+ var strongCSS = "Strong_strongCSS__wxp4dd0";
3
3
  export {
4
4
  strongCSS
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/typography/Strong/Strong.css.ts"],
4
- "sourcesContent": ["import './Strong.css';\nexport var strongCSS = 'Strong_strongCSS__1sqovlt0';"],
3
+ "sources": ["../../../../src/typography/strong/Strong.css.ts"],
4
+ "sourcesContent": ["import './Strong.css';\nexport var strongCSS = 'Strong_strongCSS__wxp4dd0';"],
5
5
  "mappings": "AAAA,OAAO;AACA,IAAI,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,16 @@
1
- .Text_textCSS__ty6wu50 {
1
+ .Text_textCSS__rup8ap0 {
2
2
  margin-top: 0;
3
3
  margin-bottom: 0;
4
4
  min-width: 0;
5
5
  overflow-wrap: break-word;
6
6
  }
7
- .Text_textCSS_ellipsis_singleLine__ty6wu51 {
7
+ .Text_textCSS_ellipsis_singleLine__rup8ap1 {
8
8
  display: block;
9
9
  white-space: nowrap;
10
10
  text-overflow: ellipsis;
11
11
  overflow: hidden;
12
12
  }
13
- .Text_textCSS_ellipsis_multiLine__ty6wu52 {
13
+ .Text_textCSS_ellipsis_multiLine__rup8ap2 {
14
14
  display: -webkit-box;
15
15
  -webkit-line-clamp: var(--strato-ellipsis-line-clamp);
16
16
  -webkit-box-orient: vertical;
@@ -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 type { 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 type { StylingProps } from '../../core/types/styling-props.js';\nimport type { WithChildren } from '../../core/types/with-children.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * The props for the text component without any props coming from polymorphing.\n * @public\n */\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 * Use the `Text` component for text that is rendered without any semantic markup.\n * @public\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;AA+BtB,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
+ }
@@ -1,6 +1,6 @@
1
1
  import "./Text.css";
2
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: [] });
3
+ var textCSS = _7a468({ defaultClassName: "Text_textCSS__rup8ap0", variantClassNames: { ellipsis: { singleLine: "Text_textCSS_ellipsis_singleLine__rup8ap1", multiLine: "Text_textCSS_ellipsis_multiLine__rup8ap2" } }, defaultVariants: {}, compoundVariants: [] });
4
4
  export {
5
5
  textCSS
6
6
  };
@@ -1,7 +1,7 @@
1
1
  {
2
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:[]});"],
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__rup8ap0',variantClassNames:{ellipsis:{singleLine:'Text_textCSS_ellipsis_singleLine__rup8ap1',multiLine:'Text_textCSS_ellipsis_multiLine__rup8ap2'}},defaultVariants:{},compoundVariants:[]});"],
5
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
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- .TextEllipsis_textEllipsisCSS__1n6xzhd0 {
1
+ .TextEllipsis_textEllipsisCSS__1mnpbqs0 {
2
2
  display: inline-block;
3
3
  box-sizing: border-box;
4
4
  vertical-align: middle;
@@ -9,14 +9,14 @@
9
9
  text-decoration: inherit;
10
10
  width: 100%;
11
11
  }
12
- .TextEllipsis_textEllipsisCSS_truncationMode_start__1n6xzhd1 {
12
+ .TextEllipsis_textEllipsisCSS_truncationMode_start__1mnpbqs1 {
13
13
  text-overflow: ellipsis;
14
14
  direction: rtl;
15
15
  text-align: left;
16
16
  }
17
- .TextEllipsis_textEllipsisCSS_truncationMode_middle__1n6xzhd2 {
17
+ .TextEllipsis_textEllipsisCSS_truncationMode_middle__1mnpbqs2 {
18
18
  text-overflow: clip;
19
19
  }
20
- .TextEllipsis_textEllipsisCSS_truncationMode_end__1n6xzhd3 {
20
+ .TextEllipsis_textEllipsisCSS_truncationMode_end__1mnpbqs3 {
21
21
  text-overflow: ellipsis;
22
22
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/typography/text-ellipsis/TextEllipsis.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, {\n forwardRef,\n HTMLAttributes,\n RefObject,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport useResizeObserver from 'use-resize-observer';\n\nimport { textEllipsisCSS } from './TextEllipsis.sty.js';\nimport { _useFontsUpdated } from '../../core/hooks/useFontsUpdated.js';\nimport { useMergeRefs } from '../../core/hooks/useMergeRefs.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type _Font } from '../utils.js';\nimport { _centerEllipsizeText } from '../utils.js';\n\n/**\n * Available modes for how overly long text is truncated and where the ellipsis is placed.\n * @internal\n */\nexport type _TruncationMode = 'start' | 'middle' | 'end';\n\n/**\n * The props for the TextEllipsis component.\n * @public\n */\nexport interface TextEllipsisProps\n extends HTMLAttributes<HTMLSpanElement>,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** The children (as text) passed to the component. */\n children: string;\n /**\n * The mode used for for truncating the text, either at the start, in the middle or at the end.\n * @defaultValue 'end'\n */\n truncationMode?: 'start' | 'middle' | 'end';\n /** Gets called when text needs to get truncated due to lack of horizontal space. */\n onTextOverflow?: (ellipsized: boolean) => void;\n}\n\n/**\n * Returns an object containing all font-related CSS properties from\n * a given DOM element that are relevant for rendering formatted text\n * in a 2D canvas context.\n *\n * @param textWrapper - The HTML element to extract the CSS properties from\n */\nfunction getFontProps(textWrapper: HTMLSpanElement): _Font {\n const computedStyle = window.getComputedStyle(textWrapper, null);\n\n return {\n fontStyle: computedStyle.getPropertyValue('font-style'),\n fontWeight: computedStyle.getPropertyValue('font-weight'),\n fontSize: computedStyle.getPropertyValue('font-size'),\n fontFamily: computedStyle.getPropertyValue('font-family'),\n };\n}\n\n/**\n * Determines whether a CSS text-ellipsis is currently rendered in a container.\n * Note: `containerWidth` is only passed to avoid unnecessary reflows by calling `getBoundingClientRect()`\n */\nfunction isNativeEllipsisActive(\n textWrapper: HTMLSpanElement,\n containerWidth: number,\n): boolean {\n const textWidth =\n Math.floor(textWrapper.getBoundingClientRect().width * 100) / 100;\n\n return textWidth > containerWidth;\n}\n\n/**\n * Detects whether a given formatted text has enough space within its\n * parent container and applies or removes an ellipsis accordingly.\n *\n * @param originalText - The text to be truncated if its width exceeds <code>maxWidthInPx</code>\n * @param truncationMode - The mode used for for truncating the text, either at the start, in the middle or at the end\n * @param containerRef - Object ref pointing towards the root element of the TextEllipsis component\n * @param wasEllipsized - Whether an ellipsis was applied during the last render cycle\n * @param onTextOverflow - Callback that gets called whenever the state of the ellipsis changes since the last render cycle\n */\nfunction renderEllipsizedText(\n originalText: string,\n truncationMode: TextEllipsisProps['truncationMode'],\n containerRef: RefObject<HTMLSpanElement>,\n wasEllipsized: boolean,\n onTextOverflow?: (ellipsized: boolean) => void,\n): boolean {\n const containerElement = containerRef.current;\n const textWrapper: HTMLSpanElement | null =\n (containerElement?.firstElementChild as HTMLSpanElement) || null;\n\n if (containerElement !== null && textWrapper !== null) {\n if (textWrapper.textContent !== originalText) {\n textWrapper.textContent = originalText; // always reset to full text before measuring container width\n }\n\n const containerWidth =\n Math.ceil(containerElement.getBoundingClientRect().width * 100) / 100;\n\n if (truncationMode === 'middle') {\n if (isNativeEllipsisActive(textWrapper, containerWidth)) {\n const ellipsizedText = _centerEllipsizeText(\n originalText,\n getFontProps(textWrapper),\n containerWidth,\n );\n textWrapper.textContent = ellipsizedText;\n\n if (ellipsizedText !== originalText) {\n if (onTextOverflow && !wasEllipsized) {\n onTextOverflow(true);\n }\n\n return true;\n }\n }\n\n if (onTextOverflow && wasEllipsized) {\n onTextOverflow(false);\n }\n } else if (isNativeEllipsisActive(textWrapper, containerWidth)) {\n if (onTextOverflow && !wasEllipsized) {\n onTextOverflow(true);\n }\n\n return true;\n } else if (onTextOverflow && wasEllipsized) {\n onTextOverflow(false);\n }\n }\n\n return false;\n}\n\nconst ComputedTextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n const {\n children,\n truncationMode = 'end',\n onTextOverflow,\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 // resize observer is needed to re-render the component in case of resizing\n const { ref: observerContainerRef } = useResizeObserver<HTMLSpanElement>();\n const containerRef = useRef<HTMLSpanElement | null>(null);\n const ellipsisStateRef = useRef<boolean>(false);\n const mergedRef = useMergeRefs<HTMLSpanElement | null>([\n observerContainerRef,\n (instance: HTMLSpanElement) => {\n containerRef.current = instance;\n },\n forwardedRef,\n ]);\n const containerWidth = containerRef.current?.getBoundingClientRect().width;\n const fontsUpdated = _useFontsUpdated();\n\n useLayoutEffect(() => {\n ellipsisStateRef.current = renderEllipsizedText(\n children,\n truncationMode,\n containerRef,\n ellipsisStateRef.current,\n onTextOverflow,\n );\n }, [containerWidth, children, truncationMode, fontsUpdated, onTextOverflow]);\n\n return (\n <span\n ref={mergedRef}\n aria-label={children}\n data-ellipsis\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(textEllipsisCSS({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n <span>{children}</span>\n </span>\n );\n});\n\nconst CssTextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n const {\n children,\n truncationMode = 'end',\n onTextOverflow,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n } = props;\n\n return (\n <span\n ref={forwardedRef}\n aria-label={children}\n data-ellipsis\n data-testid={dataTestId}\n className={clsx(textEllipsisCSS({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n <span>{children}</span>\n </span>\n );\n});\n\n/**\n * Use the `TextEllipsis` component to truncate text and show an ellipsis whenever\n * there is insufficient space to render the entire text. While some of our Strato\n * components provide ellipsis out of the box, you need to take care of this yourself\n * when writing your own components.\n * @public\n */\nexport const TextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n // in case onTextOverflow is not defined and the ellipsis is start or end\n // we can use css only which is significantly more performant\n const cssOnlyEllipsis =\n !props.onTextOverflow && props.truncationMode !== 'middle';\n\n return cssOnlyEllipsis ? (\n <CssTextEllipsis ref={forwardedRef} {...props} />\n ) : (\n <ComputedTextEllipsis ref={forwardedRef} {...props} />\n );\n});\n\n(TextEllipsis as typeof TextEllipsis & { displayName: string }).displayName =\n 'TextEllipsis';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO;AAAA,EACL;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,OAAO,uBAAuB;AAE9B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAK7B,SAAS,4BAA4B;AAmCrC,SAAS,aAAa,aAAqC;AACzD,QAAM,gBAAgB,OAAO,iBAAiB,aAAa,IAAI;AAE/D,SAAO;AAAA,IACL,WAAW,cAAc,iBAAiB,YAAY;AAAA,IACtD,YAAY,cAAc,iBAAiB,aAAa;AAAA,IACxD,UAAU,cAAc,iBAAiB,WAAW;AAAA,IACpD,YAAY,cAAc,iBAAiB,aAAa;AAAA,EAC1D;AACF;AAMA,SAAS,uBACP,aACA,gBACS;AACT,QAAM,YACJ,KAAK,MAAM,YAAY,sBAAsB,EAAE,QAAQ,GAAG,IAAI;AAEhE,SAAO,YAAY;AACrB;AAYA,SAAS,qBACP,cACA,gBACA,cACA,eACA,gBACS;AACT,QAAM,mBAAmB,aAAa;AACtC,QAAM,cACH,kBAAkB,qBAAyC;AAE9D,MAAI,qBAAqB,QAAQ,gBAAgB,MAAM;AACrD,QAAI,YAAY,gBAAgB,cAAc;AAC5C,kBAAY,cAAc;AAAA,IAC5B;AAEA,UAAM,iBACJ,KAAK,KAAK,iBAAiB,sBAAsB,EAAE,QAAQ,GAAG,IAAI;AAEpE,QAAI,mBAAmB,UAAU;AAC/B,UAAI,uBAAuB,aAAa,cAAc,GAAG;AACvD,cAAM,iBAAiB;AAAA,UACrB;AAAA,UACA,aAAa,WAAW;AAAA,UACxB;AAAA,QACF;AACA,oBAAY,cAAc;AAE1B,YAAI,mBAAmB,cAAc;AACnC,cAAI,kBAAkB,CAAC,eAAe;AACpC,2BAAe,IAAI;AAAA,UACrB;AAEA,iBAAO;AAAA,QACT;AAAA,MACF;AAEA,UAAI,kBAAkB,eAAe;AACnC,uBAAe,KAAK;AAAA,MACtB;AAAA,IACF,WAAW,uBAAuB,aAAa,cAAc,GAAG;AAC9D,UAAI,kBAAkB,CAAC,eAAe;AACpC,uBAAe,IAAI;AAAA,MACrB;AAEA,aAAO;AAAA,IACT,WAAW,kBAAkB,eAAe;AAC1C,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,uBAAuC,2BAG3C,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AAGJ,QAAM,EAAE,KAAK,qBAAqB,IAAI,kBAAmC;AACzE,QAAM,eAAe,OAA+B,IAAI;AACxD,QAAM,mBAAmB,OAAgB,KAAK;AAC9C,QAAM,YAAY,aAAqC;AAAA,IACrD;AAAA,IACA,CAAC,aAA8B;AAC7B,mBAAa,UAAU;AAAA,IACzB;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,iBAAiB,aAAa,SAAS,sBAAsB,EAAE;AACrE,QAAM,eAAe,iBAAiB;AAEtC,kBAAgB,MAAM;AACpB,qBAAiB,UAAU;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,UAAU,gBAAgB,cAAc,cAAc,CAAC;AAE3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,cAAY;AAAA,MACZ,iBAAa;AAAA,MACb,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,WAAW,KAAK,gBAAgB,EAAE,eAAe,CAAC,GAAG,iBAAiB;AAAA,MACtE,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,IAEJ,oCAAC,cAAM,QAAS;AAAA,EAClB;AAEJ,CAAC;AAED,MAAM,kBAAkC,2BAGtC,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,GAAG;AAAA,EACL,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,cAAY;AAAA,MACZ,iBAAa;AAAA,MACb,eAAa;AAAA,MACb,WAAW,KAAK,gBAAgB,EAAE,eAAe,CAAC,GAAG,iBAAiB;AAAA,MACtE,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,IAEJ,oCAAC,cAAM,QAAS;AAAA,EAClB;AAEJ,CAAC;AASM,MAAM,eAA+B,2BAG1C,CAAC,OAAO,iBAAiB;AAGzB,QAAM,kBACJ,CAAC,MAAM,kBAAkB,MAAM,mBAAmB;AAEpD,SAAO,kBACL,oCAAC,mBAAgB,KAAK,cAAe,GAAG,OAAO,IAE/C,oCAAC,wBAAqB,KAAK,cAAe,GAAG,OAAO;AAExD,CAAC;AAEA,aAA+D,cAC9D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import "./TextEllipsis.css";
2
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ var textEllipsisCSS = _7a468({ defaultClassName: "TextEllipsis_textEllipsisCSS__1mnpbqs0", variantClassNames: { truncationMode: { start: "TextEllipsis_textEllipsisCSS_truncationMode_start__1mnpbqs1", middle: "TextEllipsis_textEllipsisCSS_truncationMode_middle__1mnpbqs2", end: "TextEllipsis_textEllipsisCSS_truncationMode_end__1mnpbqs3" } }, defaultVariants: {}, compoundVariants: [] });
4
+ export {
5
+ textEllipsisCSS
6
+ };
7
+ //# sourceMappingURL=TextEllipsis.sty.js.map