@dynatrace/strato-components 0.85.0 → 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 (282) hide show
  1. package/README.md +1 -1
  2. package/buttons/button/Button.css +93 -0
  3. package/buttons/button/Button.d.ts +94 -0
  4. package/buttons/button/Button.js +258 -0
  5. package/buttons/button/Button.sty.d.ts +51 -0
  6. package/buttons/button/Button.sty.js +33 -0
  7. package/buttons/button/Label.d.ts +16 -0
  8. package/buttons/button/Label.js +60 -0
  9. package/buttons/button/Prefix.d.ts +16 -0
  10. package/buttons/button/Prefix.js +54 -0
  11. package/buttons/button/Suffix.d.ts +16 -0
  12. package/buttons/button/Suffix.js +56 -0
  13. package/buttons/button/types/button-aria.d.ts +37 -0
  14. package/buttons/button/types/button-aria.js +15 -0
  15. package/buttons/button/utils/focus-without-scrolling.d.ts +5 -0
  16. package/buttons/button/utils/focus-without-scrolling.js +77 -0
  17. package/buttons/button/utils/is-virtual-event.d.ts +10 -0
  18. package/buttons/button/utils/is-virtual-event.js +32 -0
  19. package/buttons/index.d.ts +10 -0
  20. package/buttons/index.js +30 -0
  21. package/buttons/intent-button/IntentButton.d.ts +44 -0
  22. package/buttons/intent-button/IntentButton.js +102 -0
  23. package/buttons/intent-button/useIntentButton.d.ts +12 -0
  24. package/buttons/intent-button/useIntentButton.js +72 -0
  25. package/content/index.d.ts +4 -0
  26. package/content/index.js +5 -1
  27. package/content/progress/ProgressBar.js +1 -2
  28. package/content/progress/ProgressCircle.js +1 -2
  29. package/content/skeleton/Skeleton.css +33 -0
  30. package/content/skeleton/Skeleton.d.ts +30 -0
  31. package/content/skeleton/Skeleton.js +60 -0
  32. package/content/skeleton/Skeleton.sty.d.ts +10 -0
  33. package/content/skeleton/Skeleton.sty.js +25 -0
  34. package/content/skeleton/SkeletonText.d.ts +24 -0
  35. package/content/skeleton/SkeletonText.js +84 -0
  36. package/esm/buttons/button/Button.css +93 -0
  37. package/esm/buttons/button/Button.js +233 -0
  38. package/esm/buttons/button/Button.js.map +7 -0
  39. package/esm/buttons/button/Button.sty.js +15 -0
  40. package/esm/buttons/button/Button.sty.js.map +7 -0
  41. package/esm/buttons/button/Label.js +32 -0
  42. package/esm/buttons/button/Label.js.map +7 -0
  43. package/esm/buttons/button/Prefix.js +26 -0
  44. package/esm/buttons/button/Prefix.js.map +7 -0
  45. package/esm/buttons/button/Suffix.js +28 -0
  46. package/esm/buttons/button/Suffix.js.map +7 -0
  47. package/esm/buttons/button/types/button-aria.js +1 -0
  48. package/esm/buttons/button/types/button-aria.js.map +7 -0
  49. package/esm/buttons/button/utils/focus-without-scrolling.js +59 -0
  50. package/esm/buttons/button/utils/focus-without-scrolling.js.map +7 -0
  51. package/esm/buttons/button/utils/is-virtual-event.js +14 -0
  52. package/esm/buttons/button/utils/is-virtual-event.js.map +7 -0
  53. package/esm/buttons/index.js +15 -0
  54. package/esm/buttons/index.js.map +7 -0
  55. package/esm/buttons/intent-button/IntentButton.js +74 -0
  56. package/esm/buttons/intent-button/IntentButton.js.map +7 -0
  57. package/esm/buttons/intent-button/useIntentButton.js +57 -0
  58. package/esm/buttons/intent-button/useIntentButton.js.map +7 -0
  59. package/esm/content/index.js +5 -1
  60. package/esm/content/index.js.map +2 -2
  61. package/esm/content/progress/ProgressBar.js +2 -3
  62. package/esm/content/progress/ProgressBar.js.map +2 -2
  63. package/esm/content/progress/ProgressCircle.js +2 -3
  64. package/esm/content/progress/ProgressCircle.js.map +2 -2
  65. package/esm/content/skeleton/Skeleton.css +33 -0
  66. package/esm/content/skeleton/Skeleton.js +32 -0
  67. package/esm/content/skeleton/Skeleton.js.map +7 -0
  68. package/esm/content/skeleton/Skeleton.sty.js +7 -0
  69. package/esm/content/skeleton/Skeleton.sty.js.map +7 -0
  70. package/esm/content/skeleton/SkeletonText.js +56 -0
  71. package/esm/content/skeleton/SkeletonText.js.map +7 -0
  72. package/esm/index.js +1 -0
  73. package/esm/index.js.map +2 -2
  74. package/esm/layouts/{Divider → divider}/Divider.css +5 -5
  75. package/esm/layouts/{Divider → divider}/Divider.js.map +1 -1
  76. package/esm/layouts/{Divider → divider}/Divider.sty.js +1 -1
  77. package/esm/layouts/{Divider → divider}/Divider.sty.js.map +2 -2
  78. package/esm/layouts/helpers/spacingToCss.js +13 -0
  79. package/esm/layouts/helpers/spacingToCss.js.map +7 -0
  80. package/esm/layouts/hooks/useLayoutSizeProps.js +15 -0
  81. package/esm/layouts/hooks/useLayoutSizeProps.js.map +7 -0
  82. package/esm/layouts/hooks/useLayoutStyles.js +105 -0
  83. package/esm/layouts/hooks/useLayoutStyles.js.map +7 -0
  84. package/esm/layouts/hooks/useMarginProps.js +55 -0
  85. package/esm/layouts/hooks/useMarginProps.js.map +7 -0
  86. package/esm/layouts/hooks/usePaddingProps.js +59 -0
  87. package/esm/layouts/hooks/usePaddingProps.js.map +7 -0
  88. package/esm/layouts/index.js +6 -2
  89. package/esm/layouts/index.js.map +2 -2
  90. package/esm/layouts/surface/Surface.css +95 -0
  91. package/esm/layouts/surface/Surface.js +84 -0
  92. package/esm/layouts/surface/Surface.js.map +7 -0
  93. package/esm/layouts/surface/Surface.sty.js +10 -0
  94. package/esm/layouts/surface/Surface.sty.js.map +7 -0
  95. package/esm/layouts/surface/variables.sty.js +5 -0
  96. package/esm/layouts/surface/variables.sty.js.map +7 -0
  97. package/esm/layouts/types/layout.types.js +1 -0
  98. package/esm/layouts/types/layout.types.js.map +7 -0
  99. package/esm/styles/field.css +208 -0
  100. package/esm/styles/field.sty.js +9 -0
  101. package/esm/styles/field.sty.js.map +7 -0
  102. package/esm/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  103. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js.map +2 -2
  104. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  105. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js.map +2 -2
  106. package/{typography/Code → esm/typography/code}/Code.css +1 -1
  107. package/esm/typography/code/Code.js.map +7 -0
  108. package/esm/typography/{Code → code}/Code.sty.js +1 -1
  109. package/esm/typography/{Code → code}/Code.sty.js.map +2 -2
  110. package/esm/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  111. package/esm/typography/{Emphasis → emphasis}/Emphasis.js.map +2 -2
  112. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  113. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js.map +2 -2
  114. package/{typography/ExternalLink → esm/typography/external-link}/ExternalLink.css +6 -6
  115. package/esm/typography/external-link/ExternalLink.js.map +7 -0
  116. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  117. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js.map +2 -2
  118. package/esm/typography/{Heading → heading}/Heading.css +7 -7
  119. package/esm/typography/heading/Heading.js.map +7 -0
  120. package/esm/typography/heading/Heading.sty.js +7 -0
  121. package/esm/typography/{Heading → heading}/Heading.sty.js.map +2 -2
  122. package/esm/typography/{Highlight → highlight}/Highlight.css +1 -1
  123. package/esm/typography/{Highlight → highlight}/Highlight.js.map +2 -2
  124. package/esm/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  125. package/esm/typography/{Highlight → highlight}/Highlight.sty.js.map +2 -2
  126. package/esm/typography/index.js +13 -13
  127. package/esm/typography/index.js.map +1 -1
  128. package/{typography/Link → esm/typography/link}/Link.css +4 -4
  129. package/esm/typography/{Link → link}/Link.js +1 -1
  130. package/esm/typography/link/Link.js.map +7 -0
  131. package/esm/typography/{Link → link}/Link.sty.js +1 -1
  132. package/esm/typography/{Link → link}/Link.sty.js.map +2 -2
  133. package/esm/typography/{List → list}/List.css +4 -4
  134. package/esm/typography/{List → list}/List.js +1 -1
  135. package/esm/typography/{List → list}/List.js.map +2 -2
  136. package/esm/typography/{List → list}/List.sty.js +2 -2
  137. package/esm/typography/{List → list}/List.sty.js.map +2 -2
  138. package/esm/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  139. package/esm/typography/{Paragraph → paragraph}/Paragraph.js.map +2 -2
  140. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  141. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js.map +2 -2
  142. package/{typography/Strikethrough → esm/typography/strikethrough}/Strikethrough.css +1 -1
  143. package/esm/typography/strikethrough/Strikethrough.js.map +7 -0
  144. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  145. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js.map +2 -2
  146. package/{typography/Strong → esm/typography/strong}/Strong.css +1 -1
  147. package/esm/typography/{Strong → strong}/Strong.js.map +2 -2
  148. package/esm/typography/{Strong → strong}/Strong.sty.js +1 -1
  149. package/esm/typography/{Strong → strong}/Strong.sty.js.map +2 -2
  150. package/{typography/Text → esm/typography/text}/Text.css +3 -3
  151. package/esm/typography/text/Text.js.map +7 -0
  152. package/esm/typography/{Text → text}/Text.sty.js +1 -1
  153. package/esm/typography/{Text → text}/Text.sty.js.map +2 -2
  154. package/{typography/TextEllipsis → esm/typography/text-ellipsis}/TextEllipsis.css +4 -4
  155. package/esm/typography/text-ellipsis/TextEllipsis.js.map +7 -0
  156. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +7 -0
  157. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js.map +2 -2
  158. package/index.d.ts +1 -0
  159. package/index.js +1 -0
  160. package/lang/en.json +12 -0
  161. package/lang/ja.json +24 -0
  162. package/lang/uncompiled/en.json +8 -0
  163. package/lang/uncompiled/ja.json +14 -1
  164. package/layouts/{Divider → divider}/Divider.css +5 -5
  165. package/layouts/{Divider → divider}/Divider.sty.js +1 -1
  166. package/layouts/helpers/spacingToCss.d.ts +6 -0
  167. package/layouts/helpers/spacingToCss.js +29 -0
  168. package/layouts/hooks/useLayoutSizeProps.d.ts +6 -0
  169. package/layouts/hooks/useLayoutSizeProps.js +33 -0
  170. package/layouts/hooks/useLayoutStyles.d.ts +7 -0
  171. package/layouts/hooks/useLayoutStyles.js +123 -0
  172. package/layouts/hooks/useMarginProps.d.ts +7 -0
  173. package/layouts/hooks/useMarginProps.js +73 -0
  174. package/layouts/hooks/usePaddingProps.d.ts +7 -0
  175. package/layouts/hooks/usePaddingProps.js +77 -0
  176. package/layouts/index.d.ts +6 -2
  177. package/layouts/index.js +6 -2
  178. package/layouts/surface/Surface.css +95 -0
  179. package/layouts/surface/Surface.d.ts +46 -0
  180. package/layouts/surface/Surface.js +110 -0
  181. package/layouts/surface/Surface.sty.d.ts +43 -0
  182. package/layouts/surface/Surface.sty.js +28 -0
  183. package/layouts/surface/variables.sty.d.ts +1 -0
  184. package/layouts/surface/variables.sty.js +23 -0
  185. package/layouts/types/layout.types.d.ts +64 -0
  186. package/layouts/types/layout.types.js +15 -0
  187. package/package.json +11 -4
  188. package/styles/field.css +208 -0
  189. package/styles/field.sty.d.ts +102 -0
  190. package/styles/field.sty.js +27 -0
  191. package/styles/sprinkles.sty.d.ts +107 -107
  192. package/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  193. package/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  194. package/{esm/typography/Code → typography/code}/Code.css +1 -1
  195. package/typography/{Code → code}/Code.d.ts +2 -2
  196. package/typography/{Code → code}/Code.sty.js +1 -1
  197. package/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  198. package/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  199. package/{esm/typography/ExternalLink → typography/external-link}/ExternalLink.css +6 -6
  200. package/typography/{ExternalLink → external-link}/ExternalLink.d.ts +2 -2
  201. package/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  202. package/typography/{Heading → heading}/Heading.css +7 -7
  203. package/typography/{Heading → heading}/Heading.d.ts +3 -2
  204. package/typography/{Heading → heading}/Heading.sty.js +1 -1
  205. package/typography/{Highlight → highlight}/Highlight.css +1 -1
  206. package/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  207. package/typography/index.d.ts +26 -26
  208. package/typography/index.js +13 -13
  209. package/{esm/typography/Link → typography/link}/Link.css +4 -4
  210. package/typography/{Link → link}/Link.d.ts +2 -2
  211. package/typography/{Link → link}/Link.js +1 -1
  212. package/typography/{Link → link}/Link.sty.js +1 -1
  213. package/typography/{List → list}/List.css +4 -4
  214. package/typography/{List → list}/List.js +1 -1
  215. package/typography/{List → list}/List.sty.js +2 -2
  216. package/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  217. package/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  218. package/{esm/typography/Strikethrough → typography/strikethrough}/Strikethrough.css +1 -1
  219. package/typography/{Strikethrough → strikethrough}/Strikethrough.d.ts +2 -2
  220. package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  221. package/{esm/typography/Strong → typography/strong}/Strong.css +1 -1
  222. package/typography/{Strong → strong}/Strong.sty.js +1 -1
  223. package/{esm/typography/Text → typography/text}/Text.css +3 -3
  224. package/typography/{Text → text}/Text.d.ts +3 -2
  225. package/typography/{Text → text}/Text.sty.js +1 -1
  226. package/{esm/typography/TextEllipsis → typography/text-ellipsis}/TextEllipsis.css +4 -4
  227. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.d.ts +3 -3
  228. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js +1 -1
  229. package/esm/typography/Code/Code.js.map +0 -7
  230. package/esm/typography/ExternalLink/ExternalLink.js.map +0 -7
  231. package/esm/typography/Heading/Heading.js.map +0 -7
  232. package/esm/typography/Heading/Heading.sty.js +0 -7
  233. package/esm/typography/Link/Link.js.map +0 -7
  234. package/esm/typography/Strikethrough/Strikethrough.js.map +0 -7
  235. package/esm/typography/Text/Text.js.map +0 -7
  236. package/esm/typography/TextEllipsis/TextEllipsis.js.map +0 -7
  237. package/esm/typography/TextEllipsis/TextEllipsis.sty.js +0 -7
  238. package/esm/layouts/{Divider → divider}/Divider.js +0 -0
  239. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  240. package/esm/typography/{Code → code}/Code.js +0 -0
  241. package/esm/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  242. package/esm/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  243. package/esm/typography/{Heading → heading}/Heading.js +0 -0
  244. package/esm/typography/{Highlight → highlight}/Highlight.js +0 -0
  245. package/esm/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  246. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  247. package/esm/typography/{Strong → strong}/Strong.js +0 -0
  248. package/esm/typography/{Text → text}/Text.js +0 -0
  249. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  250. package/layouts/{Divider → divider}/Divider.d.ts +0 -0
  251. package/layouts/{Divider → divider}/Divider.js +0 -0
  252. package/layouts/{Divider → divider}/Divider.sty.d.ts +0 -0
  253. package/typography/{BlockQuote → block-quote}/Blockquote.d.ts +1 -1
  254. package/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  255. package/typography/{BlockQuote → block-quote}/Blockquote.sty.d.ts +0 -0
  256. package/typography/{Code → code}/Code.js +0 -0
  257. package/typography/{Code → code}/Code.sty.d.ts +0 -0
  258. package/typography/{Emphasis → emphasis}/Emphasis.d.ts +1 -1
  259. package/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  260. package/typography/{Emphasis → emphasis}/Emphasis.sty.d.ts +0 -0
  261. package/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  262. package/typography/{ExternalLink → external-link}/ExternalLink.sty.d.ts +0 -0
  263. package/typography/{Heading → heading}/Heading.js +0 -0
  264. package/typography/{Heading → heading}/Heading.sty.d.ts +0 -0
  265. package/typography/{Highlight → highlight}/Highlight.d.ts +1 -1
  266. package/typography/{Highlight → highlight}/Highlight.js +0 -0
  267. package/typography/{Highlight → highlight}/Highlight.sty.d.ts +0 -0
  268. package/typography/{Link → link}/Link.sty.d.ts +0 -0
  269. package/typography/{List → list}/List.d.ts +1 -1
  270. package/typography/{List → list}/List.sty.d.ts +0 -0
  271. package/typography/{Paragraph → paragraph}/Paragraph.d.ts +1 -1
  272. package/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  273. package/typography/{Paragraph → paragraph}/Paragraph.sty.d.ts +0 -0
  274. package/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  275. package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.d.ts +0 -0
  276. package/typography/{Strong → strong}/Strong.d.ts +1 -1
  277. /package/typography/{Strong → strong}/Strong.js +0 -0
  278. /package/typography/{Strong → strong}/Strong.sty.d.ts +0 -0
  279. /package/typography/{Text → text}/Text.js +0 -0
  280. /package/typography/{Text → text}/Text.sty.d.ts +0 -0
  281. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  282. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.d.ts +0 -0
@@ -0,0 +1,32 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { buttonLabelCSS } from "./Button.sty.js";
4
+ import { isStringChildren } from "../../core/utils/_is-string-children.js";
5
+ const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
6
+ const {
7
+ children,
8
+ className: consumerClassName,
9
+ style: consumerStyle,
10
+ "data-testid": dataTestId
11
+ } = props;
12
+ const textual = isStringChildren(children);
13
+ return /* @__PURE__ */ React.createElement(
14
+ "div",
15
+ {
16
+ ref: forwardedRef,
17
+ "data-testid": dataTestId,
18
+ className: clsx(
19
+ "strato-button-label",
20
+ buttonLabelCSS({ textual }),
21
+ consumerClassName
22
+ ),
23
+ style: consumerStyle
24
+ },
25
+ children
26
+ );
27
+ });
28
+ Label.displayName = "Button.Label";
29
+ export {
30
+ Label
31
+ };
32
+ //# sourceMappingURL=Label.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/buttons/button/Label.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef, type ReactNode } from 'react';\n\nimport { buttonLabelCSS } from './Button.sty.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { isStringChildren } from '../../core/utils/_is-string-children.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button Label.\n * @public\n */\nexport interface ButtonLabelProps extends StylingProps, DataTestId {\n /** Elements to be displayed in the Button Label slot. */\n children: ReactNode;\n}\n//#endregion\n\n/**\n * Button Label component.\n * @public\n */\nexport const Label = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n ButtonLabelProps\n>((props, forwardedRef) => {\n const {\n children,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n }: ButtonLabelProps = props;\n\n const textual = isStringChildren(children);\n\n return (\n <div\n ref={forwardedRef}\n data-testid={dataTestId}\n className={clsx(\n 'strato-button-label',\n buttonLabelCSS({ textual }),\n consumerClassName,\n )}\n style={consumerStyle}\n >\n {children}\n </div>\n );\n});\n\n(Label as typeof Label & { displayName: string }).displayName = 'Button.Label';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkC;AAElD,SAAS,sBAAsB;AAG/B,SAAS,wBAAwB;AAiB1B,MAAM,QAAwB,2BAGnC,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,EACjB,IAAsB;AAEtB,QAAM,UAAU,iBAAiB,QAAQ;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA,eAAe,EAAE,QAAQ,CAAC;AAAA,QAC1B;AAAA,MACF;AAAA,MACA,OAAO;AAAA;AAAA,IAEN;AAAA,EACH;AAEJ,CAAC;AAEA,MAAiD,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ import React, { forwardRef } from "react";
2
+ import { Flex } from "../../layouts/flex/Flex.js";
3
+ const Prefix = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
4
+ const {
5
+ children,
6
+ className: consumerClassName,
7
+ style: consumerStyle,
8
+ "data-testid": dataTestId
9
+ } = props;
10
+ return /* @__PURE__ */ React.createElement(
11
+ Flex,
12
+ {
13
+ "data-testid": dataTestId,
14
+ ref: forwardedRef,
15
+ gap: 0,
16
+ className: consumerClassName,
17
+ style: consumerStyle
18
+ },
19
+ children
20
+ );
21
+ });
22
+ Prefix.displayName = "Button.Prefix";
23
+ export {
24
+ Prefix
25
+ };
26
+ //# sourceMappingURL=Prefix.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/buttons/button/Prefix.tsx"],
4
+ "sourcesContent": ["import React, { forwardRef, type ReactNode } from 'react';\n\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { Flex } from '../../layouts/flex/Flex.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button Prefix.\n * @public\n */\nexport interface ButtonPrefixProps extends StylingProps, DataTestId {\n /** Elements to be displayed in the Button Prefix slot. */\n children: ReactNode;\n}\n//#endregion\n\n/**\n * Button Prefix component.\n * @public\n */\nexport const Prefix = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n ButtonPrefixProps\n>((props, forwardedRef) => {\n const {\n children,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n }: ButtonPrefixProps = props;\n\n return (\n <Flex\n data-testid={dataTestId}\n ref={forwardedRef}\n gap={0}\n className={consumerClassName}\n style={consumerStyle}\n >\n {children}\n </Flex>\n );\n});\n\n(Prefix as typeof Prefix & { displayName: string }).displayName =\n 'Button.Prefix';\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,kBAAkC;AAIlD,SAAS,YAAY;AAiBd,MAAM,SAAyB,2BAGpC,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,EACjB,IAAuB;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,WAAW;AAAA,MACX,OAAO;AAAA;AAAA,IAEN;AAAA,EACH;AAEJ,CAAC;AAEA,OAAmD,cAClD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import React, { forwardRef } from "react";
2
+ import { Flex } from "../../layouts/flex/Flex.js";
3
+ const Suffix = forwardRef(
4
+ (props, forwardedRef) => {
5
+ const {
6
+ children,
7
+ className: consumerClassName,
8
+ style: consumerStyle,
9
+ "data-testid": dataTestId
10
+ } = props;
11
+ return /* @__PURE__ */ React.createElement(
12
+ Flex,
13
+ {
14
+ "data-testid": dataTestId,
15
+ gap: 0,
16
+ ref: forwardedRef,
17
+ className: consumerClassName,
18
+ style: consumerStyle
19
+ },
20
+ children
21
+ );
22
+ }
23
+ );
24
+ Suffix.displayName = "Button.Suffix";
25
+ export {
26
+ Suffix
27
+ };
28
+ //# sourceMappingURL=Suffix.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/buttons/button/Suffix.tsx"],
4
+ "sourcesContent": ["import React, { forwardRef } from 'react';\n\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { Flex } from '../../layouts/flex/Flex.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button Suffix.\n * @public\n */\nexport interface ButtonSuffixProps extends StylingProps, DataTestId {\n /** Elements to be displayed in the Button Suffix slot. */\n children: React.ReactNode;\n}\n//#endregion\n\n/**\n * Button Suffix component.\n * @public\n */\nexport const Suffix = forwardRef<HTMLDivElement, ButtonSuffixProps>(\n (props, forwardedRef) => {\n const {\n children,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n }: ButtonSuffixProps = props;\n\n return (\n <Flex\n data-testid={dataTestId}\n gap={0}\n ref={forwardedRef}\n className={consumerClassName}\n style={consumerStyle}\n >\n {children}\n </Flex>\n );\n },\n);\n\n(Suffix as typeof Suffix & { displayName: string }).displayName =\n 'Button.Suffix';\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,kBAAkB;AAIlC,SAAS,YAAY;AAiBd,MAAM,SAAS;AAAA,EACpB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,IACjB,IAAuB;AAEvB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA;AAAA,MAEN;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,OAAmD,cAClD;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=button-aria.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ let supportsPreventScrollCached = null;
2
+ function supportsPreventScroll() {
3
+ if (supportsPreventScrollCached === null) {
4
+ supportsPreventScrollCached = false;
5
+ try {
6
+ const focusElem = document.createElement("div");
7
+ focusElem.focus({
8
+ get preventScroll() {
9
+ supportsPreventScrollCached = true;
10
+ return true;
11
+ }
12
+ });
13
+ } catch (e) {
14
+ }
15
+ }
16
+ return supportsPreventScrollCached;
17
+ }
18
+ function getScrollableElements(element) {
19
+ let parent = element.parentNode;
20
+ const scrollableElements = [];
21
+ const rootScrollingElement = document.scrollingElement || document.documentElement;
22
+ while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
23
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) {
24
+ scrollableElements.push({
25
+ element: parent,
26
+ scrollTop: parent.scrollTop,
27
+ scrollLeft: parent.scrollLeft
28
+ });
29
+ }
30
+ parent = parent.parentNode;
31
+ }
32
+ if (rootScrollingElement instanceof HTMLElement) {
33
+ scrollableElements.push({
34
+ element: rootScrollingElement,
35
+ scrollTop: rootScrollingElement.scrollTop,
36
+ scrollLeft: rootScrollingElement.scrollLeft
37
+ });
38
+ }
39
+ return scrollableElements;
40
+ }
41
+ function restoreScrollPosition(scrollableElements) {
42
+ for (const { element, scrollTop, scrollLeft } of scrollableElements) {
43
+ element.scrollTop = scrollTop;
44
+ element.scrollLeft = scrollLeft;
45
+ }
46
+ }
47
+ function focusWithoutScrolling(element) {
48
+ if (supportsPreventScroll()) {
49
+ element.focus({ preventScroll: true });
50
+ } else {
51
+ const scrollableElements = getScrollableElements(element);
52
+ element.focus();
53
+ restoreScrollPosition(scrollableElements);
54
+ }
55
+ }
56
+ export {
57
+ focusWithoutScrolling
58
+ };
59
+ //# sourceMappingURL=focus-without-scrolling.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/buttons/button/utils/focus-without-scrolling.ts"],
4
+ "sourcesContent": ["interface ScrollableElement {\n element: HTMLElement;\n scrollTop: number;\n scrollLeft: number;\n}\n\nlet supportsPreventScrollCached: boolean | null = null;\nfunction supportsPreventScroll() {\n if (supportsPreventScrollCached === null) {\n supportsPreventScrollCached = false;\n try {\n const focusElem = document.createElement('div');\n focusElem.focus({\n get preventScroll() {\n supportsPreventScrollCached = true;\n return true;\n },\n });\n } catch (e) {\n // Ignore\n }\n }\n\n return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(\n element: Element & HTMLOrSVGElement,\n): ScrollableElement[] {\n let parent = element.parentNode;\n const scrollableElements: ScrollableElement[] = [];\n const rootScrollingElement =\n document.scrollingElement || document.documentElement;\n\n while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push({\n element: parent,\n scrollTop: parent.scrollTop,\n scrollLeft: parent.scrollLeft,\n });\n }\n parent = parent.parentNode;\n }\n\n if (rootScrollingElement instanceof HTMLElement) {\n scrollableElements.push({\n element: rootScrollingElement,\n scrollTop: rootScrollingElement.scrollTop,\n scrollLeft: rootScrollingElement.scrollLeft,\n });\n }\n\n return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n for (const { element, scrollTop, scrollLeft } of scrollableElements) {\n element.scrollTop = scrollTop;\n element.scrollLeft = scrollLeft;\n }\n}\n\n/**\n * Focuses on the given element without triggering scrolling behavior.\n * @internal\n */\nexport function focusWithoutScrolling(element: Element & HTMLOrSVGElement) {\n if (supportsPreventScroll()) {\n element.focus({ preventScroll: true });\n } else {\n const scrollableElements = getScrollableElements(element);\n element.focus();\n restoreScrollPosition(scrollableElements);\n }\n}\n"],
5
+ "mappings": "AAMA,IAAI,8BAA8C;AAClD,SAAS,wBAAwB;AAC/B,MAAI,gCAAgC,MAAM;AACxC,kCAA8B;AAC9B,QAAI;AACF,YAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,gBAAU,MAAM;AAAA,QACd,IAAI,gBAAgB;AAClB,wCAA8B;AAC9B,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH,SAAS,GAAG;AAAA,IAEZ;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,sBACP,SACqB;AACrB,MAAI,SAAS,QAAQ;AACrB,QAAM,qBAA0C,CAAC;AACjD,QAAM,uBACJ,SAAS,oBAAoB,SAAS;AAExC,SAAO,kBAAkB,eAAe,WAAW,sBAAsB;AACvE,QACE,OAAO,eAAe,OAAO,gBAC7B,OAAO,cAAc,OAAO,aAC5B;AACA,yBAAmB,KAAK;AAAA,QACtB,SAAS;AAAA,QACT,WAAW,OAAO;AAAA,QAClB,YAAY,OAAO;AAAA,MACrB,CAAC;AAAA,IACH;AACA,aAAS,OAAO;AAAA,EAClB;AAEA,MAAI,gCAAgC,aAAa;AAC/C,uBAAmB,KAAK;AAAA,MACtB,SAAS;AAAA,MACT,WAAW,qBAAqB;AAAA,MAChC,YAAY,qBAAqB;AAAA,IACnC,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAEA,SAAS,sBAAsB,oBAAyC;AACtE,aAAW,EAAE,SAAS,WAAW,WAAW,KAAK,oBAAoB;AACnE,YAAQ,YAAY;AACpB,YAAQ,aAAa;AAAA,EACvB;AACF;AAMO,SAAS,sBAAsB,SAAqC;AACzE,MAAI,sBAAsB,GAAG;AAC3B,YAAQ,MAAM,EAAE,eAAe,KAAK,CAAC;AAAA,EACvC,OAAO;AACL,UAAM,qBAAqB,sBAAsB,OAAO;AACxD,YAAQ,MAAM;AACd,0BAAsB,kBAAkB;AAAA,EAC1C;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ function isVirtualClick(event) {
2
+ if (event.mozInputSource === 0 && event.isTrusted) {
3
+ return true;
4
+ }
5
+ return event.detail === 0 && !event.pointerType;
6
+ }
7
+ function isVirtualPointerEvent(event) {
8
+ return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
9
+ }
10
+ export {
11
+ isVirtualClick,
12
+ isVirtualPointerEvent
13
+ };
14
+ //# sourceMappingURL=is-virtual-event.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/buttons/button/utils/is-virtual-event.ts"],
4
+ "sourcesContent": ["/**\n * Determines whether the given event represents a virtual click.\n * @internal\n */\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // JAWS/NVDA with Firefox.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((event as any).mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\n/**\n * Determines whether the given event represents a virtual pointer event.\n * @internal\n */\nexport function isVirtualPointerEvent(event: PointerEvent) {\n // If the pointer size is zero, then we assume it's from a screen reader.\n // Android TalkBack double tap will sometimes return a event with width and height of 1\n // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n // Talkback double tap from Windows Firefox touch screen press\n return (\n (event.width === 0 && event.height === 0) ||\n (event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.pointerType === 'mouse')\n );\n}\n"],
5
+ "mappings": "AAIO,SAAS,eAAe,OAA2C;AAGxE,MAAK,MAAc,mBAAmB,KAAK,MAAM,WAAW;AAC1D,WAAO;AAAA,EACT;AACA,SAAO,MAAM,WAAW,KAAK,CAAE,MAAuB;AACxD;AAMO,SAAS,sBAAsB,OAAqB;AAOzD,SACG,MAAM,UAAU,KAAK,MAAM,WAAW,KACtC,MAAM,UAAU,KACf,MAAM,WAAW,KACjB,MAAM,aAAa,KACnB,MAAM,WAAW,KACjB,MAAM,gBAAgB;AAE5B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Button } from "./button/Button.js";
2
+ import { focusWithoutScrolling } from "./button/utils/focus-without-scrolling.js";
3
+ import {
4
+ isVirtualPointerEvent,
5
+ isVirtualClick
6
+ } from "./button/utils/is-virtual-event.js";
7
+ import { IntentButton } from "./intent-button/IntentButton.js";
8
+ export {
9
+ Button,
10
+ IntentButton,
11
+ focusWithoutScrolling as _focusWithoutScrolling,
12
+ isVirtualClick as _isVirtualClick,
13
+ isVirtualPointerEvent as _isVirtualPointerEvent
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/buttons/index.ts"],
4
+ "sourcesContent": ["export { Button } from './button/Button.js';\nexport type { ButtonOwnProps, ButtonProps } from './button/Button.js';\nexport type { ButtonLabelProps } from './button/Label.js';\nexport type { ButtonPrefixProps } from './button/Prefix.js';\nexport type { ButtonSuffixProps } from './button/Suffix.js';\nexport type {\n AriaButtonProps as _AriaButtonProps,\n ButtonAria as _ButtonAria,\n AriaBaseButtonProps as _AriaBaseButtonProps,\n} from './button/types/button-aria.js';\nexport { focusWithoutScrolling as _focusWithoutScrolling } from './button/utils/focus-without-scrolling.js';\nexport {\n isVirtualPointerEvent as _isVirtualPointerEvent,\n isVirtualClick as _isVirtualClick,\n} from './button/utils/is-virtual-event.js';\nexport { IntentButton } from './intent-button/IntentButton.js';\nexport type {\n IntentButtonProps,\n IntentButtonPropsBase,\n} from './intent-button/IntentButton.js';\n"],
5
+ "mappings": "AAAA,SAAS,cAAc;AAUvB,SAAkC,6BAA8B;AAChE;AAAA,EAC2B;AAAA,EACP;AAAA,OACb;AACP,SAAS,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,74 @@
1
+ import React, { forwardRef } from "react";
2
+ import { useIntl } from "react-intl";
3
+ import { OpenWithIcon } from "@dynatrace/strato-icons";
4
+ import { useIntentButton } from "./useIntentButton.js";
5
+ import { Button } from "../button/Button.js";
6
+ const IntentButton = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
7
+ const intl = useIntl();
8
+ const {
9
+ children,
10
+ payload,
11
+ appId,
12
+ intentId,
13
+ disabled,
14
+ onClick: onClickProp,
15
+ "aria-label": ariaLabelProp,
16
+ className: consumerClassName,
17
+ style: consumerStyle,
18
+ "data-testid": dataTestId,
19
+ "data-dtrum-mask": dataDtrumMask,
20
+ "data-dtrum-allow": dataDtrumAllow,
21
+ ...remainingProps
22
+ } = props;
23
+ const label = children?.trim();
24
+ const ariaLabel = ariaLabelProp || label || intl.formatMessage({
25
+ description: "Intent button open label",
26
+ defaultMessage: "Open with",
27
+ id: "JQOGuaGgqJObmSY1"
28
+ });
29
+ const intentButtonProps = useIntentButton(
30
+ payload,
31
+ appId,
32
+ intentId,
33
+ onClickProp
34
+ );
35
+ if (disabled) {
36
+ return /* @__PURE__ */ React.createElement(
37
+ Button,
38
+ {
39
+ disabled: true,
40
+ "data-testid": dataTestId,
41
+ "data-dtrum-mask": dataDtrumMask,
42
+ "data-dtrum-allow": dataDtrumAllow,
43
+ "aria-label": ariaLabel,
44
+ className: consumerClassName,
45
+ style: consumerStyle,
46
+ ...remainingProps
47
+ },
48
+ label,
49
+ /* @__PURE__ */ React.createElement(Button.Suffix, null, /* @__PURE__ */ React.createElement(OpenWithIcon, null))
50
+ );
51
+ }
52
+ return /* @__PURE__ */ React.createElement(
53
+ Button,
54
+ {
55
+ as: "a",
56
+ ref: forwardedRef,
57
+ "data-testid": dataTestId,
58
+ "data-dtrum-mask": dataDtrumMask,
59
+ "data-dtrum-allow": dataDtrumAllow,
60
+ "aria-label": ariaLabel ?? label,
61
+ className: consumerClassName,
62
+ style: consumerStyle,
63
+ ...remainingProps,
64
+ ...intentButtonProps
65
+ },
66
+ label,
67
+ /* @__PURE__ */ React.createElement(Button.Suffix, null, /* @__PURE__ */ React.createElement(OpenWithIcon, null))
68
+ );
69
+ });
70
+ IntentButton.displayName = "IntentButton";
71
+ export {
72
+ IntentButton
73
+ };
74
+ //# sourceMappingURL=IntentButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/buttons/intent-button/IntentButton.tsx"],
4
+ "sourcesContent": ["import React, { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { OpenWithIcon } from '@dynatrace/strato-icons';\nimport { type IntentPayload } from '@dynatrace-sdk/navigation';\n\nimport { useIntentButton } from './useIntentButton.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 StylingProps } from '../../core/types/styling-props.js';\nimport { Button, type ButtonOwnProps } from '../button/Button.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button.\n * @public\n */\nexport interface IntentButtonPropsBase\n extends Omit<ButtonOwnProps, 'loading' | 'type'>,\n AriaLabelingProps,\n DOMProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** Intent payload passed between apps.*/\n payload: IntentPayload;\n\n /** Intended for setting a custom button label. When nothing is set, no label is shown. */\n children?: string;\n}\n\n/**\n * Merge own props with ID props.\n * Props for recommending an app to receive the intent. Either both properties or none of them needs to be specified.\n * @public\n */\nexport type IntentButtonProps = IntentButtonPropsBase &\n (\n | {\n appId?: never;\n intentId?: never;\n }\n | {\n /**\n * ID of the app that will be launched to handle the intent.\n */\n appId: string;\n\n /**\n * ID of the action that will be passed to the app.\n */\n intentId: string;\n }\n );\n\n//#endregion\n\n/**\n * The `IntentButton` is a dedicated button component for sending\n * {@link https://developer.dynatrace.com/develop/intents/ | intents}.\n * It takes care of opening the intent dialog. An `IntentButton` only works\n * in the AppShell context.\n * @public\n */\nexport const IntentButton = /* @__PURE__ */ forwardRef<\n HTMLAnchorElement,\n IntentButtonProps\n>((props, forwardedRef) => {\n const intl = useIntl();\n const {\n children,\n payload,\n appId,\n intentId,\n disabled,\n onClick: onClickProp,\n 'aria-label': ariaLabelProp,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: IntentButtonProps = props;\n\n const label = children?.trim();\n\n const ariaLabel =\n ariaLabelProp ||\n label ||\n intl.formatMessage({\n description: 'Intent button open label',\n defaultMessage: 'Open with',\n id: 'JQOGuaGgqJObmSY1',\n });\n\n const intentButtonProps = useIntentButton(\n payload,\n appId,\n intentId,\n onClickProp,\n );\n\n // polymorph it back to a button in case it's disabled.\n // Keep the button focusable if disabled for better screen reader support.\n if (disabled) {\n return (\n <Button\n disabled\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel}\n className={consumerClassName}\n style={consumerStyle}\n {...remainingProps}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n }\n\n return (\n <Button\n as=\"a\"\n ref={forwardedRef}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel ?? label}\n className={consumerClassName}\n style={consumerStyle}\n {...remainingProps}\n {...intentButtonProps}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n});\n\n(IntentButton as typeof IntentButton & { displayName: string }).displayName =\n 'IntentButton';\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,eAAe;AAExB,SAAS,oBAAoB;AAG7B,SAAS,uBAAuB;AAMhC,SAAS,cAAmC;AAsDrC,MAAM,eAA+B,2BAG1C,CAAC,OAAO,iBAAiB;AACzB,QAAM,OAAO,QAAQ;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAuB;AAEvB,QAAM,QAAQ,UAAU,KAAK;AAE7B,QAAM,YACJ,iBACA,SACA,KAAK,cAAc;AAAA,IACjB,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,IAAI;AAAA,EACN,CAAC;AAEH,QAAM,oBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAIA,MAAI,UAAU;AACZ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAQ;AAAA,QACR,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,cAAY;AAAA,QACZ,WAAW;AAAA,QACX,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH;AAAA,MACD,oCAAC,OAAO,QAAP,MACC,oCAAC,kBAAa,CAChB;AAAA,IACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH,KAAK;AAAA,MACL,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,MACX,OAAO;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA;AAAA,IAEH;AAAA,IACD,oCAAC,OAAO,QAAP,MACC,oCAAC,kBAAa,CAChB;AAAA,EACF;AAEJ,CAAC;AAEA,aAA+D,cAC9D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,57 @@
1
+ import { useCallback, useMemo } from "react";
2
+ import {
3
+ getIntentLink,
4
+ sendIntent
5
+ } from "@dynatrace-sdk/navigation";
6
+ function useIntentButton(payload, appId, intentId, onClickProp) {
7
+ const href = useMemo(
8
+ () => (
9
+ // SDK documentation is invalid. appId & intentId are in fact mandatory.
10
+ // This is why the ternary is necessary to ensure to call the correct signature.
11
+ appId && intentId ? getIntentLink(payload, appId, intentId) : getIntentLink(payload)
12
+ ),
13
+ [appId, intentId, payload]
14
+ );
15
+ const triggerIntent = useCallback(() => {
16
+ appId && intentId ? sendIntent(payload, appId, intentId) : sendIntent(payload);
17
+ }, [appId, intentId, payload]);
18
+ const onClick = useCallback(
19
+ (event) => {
20
+ onClickProp?.(event);
21
+ if (event.isDefaultPrevented()) {
22
+ return;
23
+ }
24
+ const nativeEvent = event.nativeEvent;
25
+ if (nativeEvent.button !== 0 || nativeEvent.metaKey || nativeEvent.ctrlKey || nativeEvent.shiftKey) {
26
+ return;
27
+ }
28
+ event.preventDefault();
29
+ triggerIntent();
30
+ },
31
+ [onClickProp, triggerIntent]
32
+ );
33
+ const onKeyDown = useCallback(
34
+ (event) => {
35
+ const nativeEvent = event.nativeEvent;
36
+ if (nativeEvent.code !== "Space" && nativeEvent.code !== "Enter") {
37
+ return;
38
+ }
39
+ event.preventDefault();
40
+ if (nativeEvent.metaKey || nativeEvent.ctrlKey) {
41
+ window.open(href);
42
+ return;
43
+ }
44
+ if (nativeEvent.shiftKey) {
45
+ window.open(href, "_blank", "menubar");
46
+ return;
47
+ }
48
+ triggerIntent();
49
+ },
50
+ [href, triggerIntent]
51
+ );
52
+ return { href, onClick, onKeyDown };
53
+ }
54
+ export {
55
+ useIntentButton
56
+ };
57
+ //# sourceMappingURL=useIntentButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/buttons/intent-button/useIntentButton.ts"],
4
+ "sourcesContent": ["import { useCallback, useMemo } from 'react';\n\nimport {\n getIntentLink,\n type IntentPayload,\n sendIntent,\n} from '@dynatrace-sdk/navigation';\n\n/**\n * return shared intent button logic\n * @param payload - an intent payload\n * @returns intentLink and triggerIntent\n * @internal\n */\nexport function useIntentButton(\n payload: IntentPayload,\n appId?: string,\n intentId?: string,\n onClickProp?: React.MouseEventHandler,\n) {\n /**\n * Contains the url created via the getIntentLink SDK method.\n * @returns a url to be used\n */\n const href = useMemo(\n () =>\n // SDK documentation is invalid. appId & intentId are in fact mandatory.\n // This is why the ternary is necessary to ensure to call the correct signature.\n appId && intentId\n ? getIntentLink(payload, appId, intentId)\n : getIntentLink(payload),\n [appId, intentId, payload],\n );\n\n /**\n * Sends intent to shell.\n * @returns void\n */\n const triggerIntent = useCallback(() => {\n // SDK documentation is invalid. appId & intentId are in fact mandatory.\n // This is why the ternary is necessary to ensure to call the correct signature.\n appId && intentId\n ? sendIntent(payload, appId, intentId)\n : sendIntent(payload);\n }, [appId, intentId, payload]);\n\n /**\n * Mouse event handler, send intent on left button click without using any modifiers.\n */\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n onClickProp?.(event);\n if (event.isDefaultPrevented()) {\n // already handled\n return;\n }\n\n const nativeEvent = event.nativeEvent;\n\n if (\n nativeEvent.button !== 0 ||\n nativeEvent.metaKey ||\n nativeEvent.ctrlKey ||\n nativeEvent.shiftKey\n ) {\n return; // let the browser handle the event\n }\n\n event.preventDefault();\n triggerIntent();\n },\n [onClickProp, triggerIntent],\n );\n\n /**\n * KeyDown event handler, sent intent on Space and ENTER\n */\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const nativeEvent = event.nativeEvent;\n\n if (nativeEvent.code !== 'Space' && nativeEvent.code !== 'Enter') {\n return; // let the browser handle the event\n }\n\n event.preventDefault();\n\n // open intent link in new tab while pressing ctrl/meta\n if (nativeEvent.metaKey || nativeEvent.ctrlKey) {\n window.open(href);\n return;\n }\n\n // open intent link in new window\n if (nativeEvent.shiftKey) {\n window.open(href, '_blank', 'menubar');\n return;\n }\n\n // let the shell handle the intent\n triggerIntent();\n },\n [href, triggerIntent],\n );\n\n return { href, onClick, onKeyDown };\n}\n"],
5
+ "mappings": "AAAA,SAAS,aAAa,eAAe;AAErC;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAQA,SAAS,gBACd,SACA,OACA,UACA,aACA;AAKA,QAAM,OAAO;AAAA,IACX;AAAA;AAAA;AAAA,MAGE,SAAS,WACL,cAAc,SAAS,OAAO,QAAQ,IACtC,cAAc,OAAO;AAAA;AAAA,IAC3B,CAAC,OAAO,UAAU,OAAO;AAAA,EAC3B;AAMA,QAAM,gBAAgB,YAAY,MAAM;AAGtC,aAAS,WACL,WAAW,SAAS,OAAO,QAAQ,IACnC,WAAW,OAAO;AAAA,EACxB,GAAG,CAAC,OAAO,UAAU,OAAO,CAAC;AAK7B,QAAM,UAAU;AAAA,IACd,CAAC,UAA4B;AAC3B,oBAAc,KAAK;AACnB,UAAI,MAAM,mBAAmB,GAAG;AAE9B;AAAA,MACF;AAEA,YAAM,cAAc,MAAM;AAE1B,UACE,YAAY,WAAW,KACvB,YAAY,WACZ,YAAY,WACZ,YAAY,UACZ;AACA;AAAA,MACF;AAEA,YAAM,eAAe;AACrB,oBAAc;AAAA,IAChB;AAAA,IACA,CAAC,aAAa,aAAa;AAAA,EAC7B;AAKA,QAAM,YAAY;AAAA,IAChB,CAAC,UAA+B;AAC9B,YAAM,cAAc,MAAM;AAE1B,UAAI,YAAY,SAAS,WAAW,YAAY,SAAS,SAAS;AAChE;AAAA,MACF;AAEA,YAAM,eAAe;AAGrB,UAAI,YAAY,WAAW,YAAY,SAAS;AAC9C,eAAO,KAAK,IAAI;AAChB;AAAA,MACF;AAGA,UAAI,YAAY,UAAU;AACxB,eAAO,KAAK,MAAM,UAAU,SAAS;AACrC;AAAA,MACF;AAGA,oBAAc;AAAA,IAChB;AAAA,IACA,CAAC,MAAM,aAAa;AAAA,EACtB;AAEA,SAAO,EAAE,MAAM,SAAS,UAAU;AACpC;",
6
+ "names": []
7
+ }
@@ -1,7 +1,11 @@
1
1
  import { ProgressBar } from "./progress/ProgressBar.js";
2
2
  import { ProgressCircle } from "./progress/ProgressCircle.js";
3
+ import { Skeleton } from "./skeleton/Skeleton.js";
4
+ import { SkeletonText } from "./skeleton/SkeletonText.js";
3
5
  export {
4
6
  ProgressBar,
5
- ProgressCircle
7
+ ProgressCircle,
8
+ Skeleton,
9
+ SkeletonText
6
10
  };
7
11
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/content/index.ts"],
4
- "sourcesContent": ["export { ProgressBar } from './progress/ProgressBar.js';\nexport type { ProgressBarProps } from './progress/ProgressBar.js';\nexport type { ProgressBarIconProps } from './progress/ProgressBarIcon.js';\nexport type { ProgressBarLabelProps } from './progress/ProgressBarLabel.js';\nexport type { ProgressBarValueProps } from './progress/ProgressBarValue.js';\nexport { ProgressCircle } from './progress/ProgressCircle.js';\nexport type { ProgressCircleProps } from './progress/ProgressCircle.js';\n"],
5
- "mappings": "AAAA,SAAS,mBAAmB;AAK5B,SAAS,sBAAsB;",
4
+ "sourcesContent": ["export { ProgressBar } from './progress/ProgressBar.js';\nexport type { ProgressBarProps } from './progress/ProgressBar.js';\nexport type { ProgressBarIconProps } from './progress/ProgressBarIcon.js';\nexport type { ProgressBarLabelProps } from './progress/ProgressBarLabel.js';\nexport type { ProgressBarValueProps } from './progress/ProgressBarValue.js';\nexport { ProgressCircle } from './progress/ProgressCircle.js';\nexport type { ProgressCircleProps } from './progress/ProgressCircle.js';\nexport { Skeleton } from './skeleton/Skeleton.js';\nexport type { SkeletonProps } from './skeleton/Skeleton.js';\nexport { SkeletonText } from './skeleton/SkeletonText.js';\nexport type { SkeletonTextProps } from './skeleton/SkeletonText.js';\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAK5B,SAAS,sBAAsB;AAE/B,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import clsx from "clsx";
2
- import React, { forwardRef } from "react";
2
+ import React, { forwardRef, useId } from "react";
3
3
  import { isElement } from "react-is";
4
4
  import Spacings from "@dynatrace/strato-design-tokens/spacings";
5
5
  import { SharedProgressBarPropsContext } from "./contexts/SharedProgressBarPropsContext.js";
@@ -9,7 +9,6 @@ import { ProgressBarIcon } from "./ProgressBarIcon.js";
9
9
  import { ProgressBarLabel } from "./ProgressBarLabel.js";
10
10
  import { ProgressBarValue } from "./ProgressBarValue.js";
11
11
  import { useAriaLabelingProps } from "../../core/hooks/useAriaLabelingProps.js";
12
- import { useId } from "../../core/hooks/useId.js";
13
12
  import { useSafeForwardProps } from "../../core/hooks/useSafeForwardProps.js";
14
13
  import { colorUtilsCSS } from "../../styles/colorUtils.sty.js";
15
14
  function getProgressBarSlots(children) {
@@ -67,7 +66,7 @@ const _ProgressBar = forwardRef(
67
66
  );
68
67
  const ariaLabelingProps = useAriaLabelingProps(remainingProps);
69
68
  const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);
70
- const generatedId = useId({ prefix: "progress-bar" });
69
+ const generatedId = useId();
71
70
  const id = propId ?? generatedId;
72
71
  if (!slots.label && !ariaLabelingProps["aria-label"] && !ariaLabelingProps["aria-labelledby"]) {
73
72
  // eslint-disable-next-line no-console
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/content/progress/ProgressBar.tsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport React, { CSSProperties, forwardRef } from 'react';\nimport { isElement } from 'react-is';\n\nimport Spacings from '@dynatrace/strato-design-tokens/spacings';\n\nimport { SharedProgressBarPropsContext } from './contexts/SharedProgressBarPropsContext.js';\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport { progressBarFillCSS, progressCSS } from './ProgressBar.sty.js';\nimport { ProgressBarIcon } from './ProgressBarIcon.js';\nimport { ProgressBarLabel } from './ProgressBarLabel.js';\nimport { ProgressBarValue } from './ProgressBarValue.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 RoleVariantType } from '../../core/types/role-variant.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { colorUtilsCSS } from '../../styles/colorUtils.sty.js';\n\n/**\n * Accepted properties for ProgressBar.\n * @public\n */\nexport interface ProgressBarProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The minimum allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the density of the rendering.\n * @defaultValue 'default'\n */\n density?: 'default' | 'condensed';\n /**\n * Controls the appearance of the progress.\n * @defaultValue 'primary'\n */\n variant?: RoleVariantType;\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * By default, the value will be given as a percentage. If the value is not a percentage, you should provide aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\ntype ProgressBarSlots = {\n value?: React.ReactNode;\n label?: React.ReactNode;\n icon?: React.ReactNode;\n};\n\nfunction getProgressBarSlots(children: React.ReactNode) {\n const slots: ProgressBarSlots = {\n value: null,\n label: null,\n icon: null,\n };\n\n React.Children.forEach(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case ProgressBarLabel:\n slots.label = child;\n break;\n case ProgressBarIcon:\n slots.icon = child;\n break;\n case ProgressBarValue:\n default:\n slots.value = child;\n break;\n }\n } else {\n if (!slots.value) {\n slots.value = child;\n }\n }\n });\n\n return slots;\n}\n\nconst _ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n max = 100,\n min = 0,\n density = 'default',\n variant = 'primary',\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressBarProps = props;\n\n const slots = getProgressBarSlots(children);\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId({ prefix: 'progress-bar' });\n const id = propId ?? generatedId;\n\n if (\n !slots.label &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n const progressStyles: CSSProperties = {};\n if (!isIndeterminate && value !== undefined) {\n const percentage = (value - min) / (max - min);\n progressStyles['width'] = `${Math.round(percentage * 100)}%`;\n }\n\n return (\n <SharedProgressBarPropsContext.Provider value={{ id, variant, density }}>\n {/* TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n <div\n className={consumerClassName}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: Spacings.Size6,\n width: '100%',\n ...consumerStyle,\n }}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n {...forwardProps}\n >\n {/* //TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n gap: Spacings.Size8,\n }}\n >\n {density === 'condensed' ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'flex-end',\n flex: 1,\n gap: Spacings.Size16,\n minWidth: 0,\n }}\n >\n {/* //TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n {slots.label}\n {density === 'condensed' && slots.value}\n </div>\n ) : (\n slots.label\n )}\n {slots.icon}\n </div>\n <div\n className={progressCSS({ size: density, variant })}\n id={id}\n {...progressAriaProps}\n {...ariaLabelingProps}\n >\n <div\n className={clsx(\n colorUtilsCSS({\n color: variant,\n variant: variant === 'onAccent' ? 'default' : 'accent',\n }),\n progressBarFillCSS({\n indeterminate: isIndeterminate,\n }),\n )}\n style={progressStyles}\n />\n </div>\n {density === 'default' && slots.value}\n </div>\n </SharedProgressBarPropsContext.Provider>\n );\n },\n);\n\n(_ProgressBar as typeof _ProgressBar & { displayName: string }).displayName =\n 'ProgressBar';\n\n/**\n * Use the `ProgressBar` component to show your users that a system operation such as downloading, uploading, or processing is progressing.\n * The `ProgressBar` can be used to visualize determinate or indeterminate progress.\n * @public\n */\nexport const ProgressBar = Object.assign(_ProgressBar, {\n Value: ProgressBarValue,\n Label: ProgressBarLabel,\n Icon: ProgressBarIcon,\n});\n"],
5
- "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAwB,kBAAkB;AACjD,SAAS,iBAAiB;AAE1B,OAAO,cAAc;AAErB,SAAS,qCAAqC;AAC9C,SAAS,4BAA4B;AACrC,SAAS,oBAAoB,mBAAmB;AAChD,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,2BAA2B;AAQpC,SAAS,qBAAqB;AAqD9B,SAAS,oBAAoB,UAA2B;AACtD,QAAM,QAA0B;AAAA,IAC9B,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAEA,QAAM,SAAS,QAAQ,UAAU,CAAC,UAAU;AAC1C,QAAI,UAAU,KAAK,GAAG;AACpB,cAAQ,MAAM,MAAM;AAAA,QAClB,KAAK;AACH,gBAAM,QAAQ;AACd;AAAA,QACF,KAAK;AACH,gBAAM,OAAO;AACb;AAAA,QACF,KAAK;AAAA,QACL;AACE,gBAAM,QAAQ;AACd;AAAA,MACJ;AAAA,IACF,OAAO;AACL,UAAI,CAAC,MAAM,OAAO;AAChB,cAAM,QAAQ;AAAA,MAChB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAU;AAAA,MACV;AAAA,MACA,IAAI;AAAA,MACJ,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,mBAAmB;AAAA,M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;AAAA,cACZ,MAAM;AAAA,cACN,KAAK,SAAS;AAAA,cACd,UAAU;AAAA,YACZ;AAAA;AAAA,UAGC,MAAM;AAAA,UACN,YAAY,eAAe,MAAM;AAAA,QACpC,IAEA,MAAM;AAAA,QAEP,MAAM;AAAA,MACT;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,YAAY,EAAE,MAAM,SAAS,QAAQ,CAAC;AAAA,UACjD;AAAA,UACC,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT,cAAc;AAAA,gBACZ,OAAO;AAAA,gBACP,SAAS,YAAY,aAAa,YAAY;AAAA,cAChD,CAAC;AAAA,cACD,mBAAmB;AAAA,gBACjB,eAAe;AAAA,cACjB,CAAC;AAAA,YACH;AAAA,YACA,OAAO;AAAA;AAAA,QACT;AAAA,MACF;AAAA,MACC,YAAY,aAAa,MAAM;AAAA,IAClC,CACF;AAAA,EAEJ;AACF;AAEC,aAA+D,cAC9D;AAOK,MAAM,cAAc,OAAO,OAAO,cAAc;AAAA,EACrD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR,CAAC;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { CSSProperties, forwardRef, useId } from 'react';\nimport { isElement } from 'react-is';\n\nimport Spacings from '@dynatrace/strato-design-tokens/spacings';\n\nimport { SharedProgressBarPropsContext } from './contexts/SharedProgressBarPropsContext.js';\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport { progressBarFillCSS, progressCSS } from './ProgressBar.sty.js';\nimport { ProgressBarIcon } from './ProgressBarIcon.js';\nimport { ProgressBarLabel } from './ProgressBarLabel.js';\nimport { ProgressBarValue } from './ProgressBarValue.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 RoleVariantType } from '../../core/types/role-variant.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { colorUtilsCSS } from '../../styles/colorUtils.sty.js';\n\n/**\n * Accepted properties for ProgressBar.\n * @public\n */\nexport interface ProgressBarProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The minimum allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the density of the rendering.\n * @defaultValue 'default'\n */\n density?: 'default' | 'condensed';\n /**\n * Controls the appearance of the progress.\n * @defaultValue 'primary'\n */\n variant?: RoleVariantType;\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * By default, the value will be given as a percentage. If the value is not a percentage, you should provide aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\ntype ProgressBarSlots = {\n value?: React.ReactNode;\n label?: React.ReactNode;\n icon?: React.ReactNode;\n};\n\nfunction getProgressBarSlots(children: React.ReactNode) {\n const slots: ProgressBarSlots = {\n value: null,\n label: null,\n icon: null,\n };\n\n React.Children.forEach(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case ProgressBarLabel:\n slots.label = child;\n break;\n case ProgressBarIcon:\n slots.icon = child;\n break;\n case ProgressBarValue:\n default:\n slots.value = child;\n break;\n }\n } else {\n if (!slots.value) {\n slots.value = child;\n }\n }\n });\n\n return slots;\n}\n\nconst _ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n max = 100,\n min = 0,\n density = 'default',\n variant = 'primary',\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressBarProps = props;\n\n const slots = getProgressBarSlots(children);\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId();\n const id = propId ?? generatedId;\n\n if (\n !slots.label &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n const progressStyles: CSSProperties = {};\n if (!isIndeterminate && value !== undefined) {\n const percentage = (value - min) / (max - min);\n progressStyles['width'] = `${Math.round(percentage * 100)}%`;\n }\n\n return (\n <SharedProgressBarPropsContext.Provider value={{ id, variant, density }}>\n {/* TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n <div\n className={consumerClassName}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: Spacings.Size6,\n width: '100%',\n ...consumerStyle,\n }}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n {...forwardProps}\n >\n {/* //TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n gap: Spacings.Size8,\n }}\n >\n {density === 'condensed' ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'flex-end',\n flex: 1,\n gap: Spacings.Size16,\n minWidth: 0,\n }}\n >\n {/* //TODO: this can be replaced by using the FLEX component. Using the flex component currently causes a circular from core -> layout -> core */}\n {slots.label}\n {density === 'condensed' && slots.value}\n </div>\n ) : (\n slots.label\n )}\n {slots.icon}\n </div>\n <div\n className={progressCSS({ size: density, variant })}\n id={id}\n {...progressAriaProps}\n {...ariaLabelingProps}\n >\n <div\n className={clsx(\n colorUtilsCSS({\n color: variant,\n variant: variant === 'onAccent' ? 'default' : 'accent',\n }),\n progressBarFillCSS({\n indeterminate: isIndeterminate,\n }),\n )}\n style={progressStyles}\n />\n </div>\n {density === 'default' && slots.value}\n </div>\n </SharedProgressBarPropsContext.Provider>\n );\n },\n);\n\n(_ProgressBar as typeof _ProgressBar & { displayName: string }).displayName =\n 'ProgressBar';\n\n/**\n * Use the `ProgressBar` component to show your users that a system operation such as downloading, uploading, or processing is progressing.\n * The `ProgressBar` can be used to visualize determinate or indeterminate progress.\n * @public\n */\nexport const ProgressBar = Object.assign(_ProgressBar, {\n Value: ProgressBarValue,\n Label: ProgressBarLabel,\n Icon: ProgressBarIcon,\n});\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAwB,YAAY,aAAa;AACxD,SAAS,iBAAiB;AAE1B,OAAO,cAAc;AAErB,SAAS,qCAAqC;AAC9C,SAAS,4BAA4B;AACrC,SAAS,oBAAoB,mBAAmB;AAChD,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AAQpC,SAAS,qBAAqB;AAqD9B,SAAS,oBAAoB,UAA2B;AACtD,QAAM,QAA0B;AAAA,IAC9B,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAEA,QAAM,SAAS,QAAQ,UAAU,CAAC,UAAU;AAC1C,QAAI,UAAU,KAAK,GAAG;AACpB,cAAQ,MAAM,MAAM;AAAA,QAClB,KAAK;AACH,gBAA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;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import clsx from "clsx";
2
- import React, { forwardRef } from "react";
2
+ import React, { forwardRef, useId } from "react";
3
3
  import { useProgressAriaProps } from "./hooks/useProgressAriaProps.js";
4
4
  import {
5
5
  progressCircleBackgroundCSS,
@@ -10,7 +10,6 @@ import {
10
10
  ProgressCircleSVGCSS
11
11
  } from "./ProgressCircle.sty.js";
12
12
  import { useAriaLabelingProps } from "../../core/hooks/useAriaLabelingProps.js";
13
- import { useId } from "../../core/hooks/useId.js";
14
13
  import { useSafeForwardProps } from "../../core/hooks/useSafeForwardProps.js";
15
14
  import { colorUtilsCSS } from "../../styles/colorUtils.sty.js";
16
15
  import { containerColorsCSS } from "../../styles/container.sty.js";
@@ -46,7 +45,7 @@ const ProgressCircle = forwardRef(
46
45
  );
47
46
  const ariaLabelingProps = useAriaLabelingProps(remainingProps);
48
47
  const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);
49
- const generatedId = useId({ prefix: "progress-circle" });
48
+ const generatedId = useId();
50
49
  const id = propId ?? generatedId;
51
50
  const circleStyles = {};
52
51
  const rootProps = {};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/content/progress/ProgressCircle.tsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport React, { CSSProperties, forwardRef } from 'react';\n\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport {\n progressCircleBackgroundCSS,\n progressCircleChildCSS,\n progressCircleContainerCSS,\n progressCircleCSS,\n progressCircleRootCSS,\n ProgressCircleSVGCSS,\n} from './ProgressCircle.sty.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 RoleVariantType } from '../../core/types/role-variant.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { colorUtilsCSS } from '../../styles/colorUtils.sty.js';\nimport { containerColorsCSS } from '../../styles/container.sty.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * Accepted properties for ProgressCircle.\n * @public\n */\nexport interface ProgressCircleProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The smallest allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the size of the rendered progress.\n * @defaultValue 'large'\n */\n size?: 'small' | 'large';\n /**\n * Controls the appearance of the progress.\n * @defaultValue 'primary'\n */\n variant?: RoleVariantType;\n\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * Default the value as percentage will be provided. If the value is not a percentage please provide the aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\nconst progressCircleSizes = {\n small: 20,\n large: 40,\n};\nconst progressCircleThickness = 5;\n\n/**\n * The `ProgressCircle` component is used to indicate the progress or completion status of a task or process.\n * @public\n * */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n min = 0,\n max = 100,\n size = 'large',\n variant = 'primary',\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressCircleProps = props;\n\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId({ prefix: 'progress-circle' });\n const id = propId ?? generatedId;\n\n const circleStyles: CSSProperties = {};\n const rootProps = {};\n\n if (!isIndeterminate && value !== undefined) {\n const circumference =\n 2 *\n Math.PI *\n ((progressCircleSizes[size] - progressCircleThickness) / 2);\n circleStyles['strokeDasharray'] = circumference.toFixed(3);\n const dashOffset = Number(\n (((max - value) / max) * circumference).toFixed(3),\n );\n circleStyles['strokeDashoffset'] = `${\n dashOffset >= 0 ? dashOffset : 0\n }px`;\n }\n\n if (\n !children &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n return (\n <div\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n className={clsx(\n consumerClassName,\n containerColorsCSS({\n color: 'neutral',\n variant: variant === 'onAccent' ? 'accent' : 'default',\n }),\n progressCircleContainerCSS({ size }),\n )}\n style={consumerStyle}\n {...forwardProps}\n >\n <span\n id={id}\n className={clsx(\n colorUtilsCSS({ color: variant, variant: 'accent' }),\n progressCircleRootCSS,\n )}\n style={{\n height: `${progressCircleSizes[size]}px`,\n width: `${progressCircleSizes[size]}px`,\n }}\n {...ariaLabelingProps}\n {...progressAriaProps}\n {...rootProps}\n >\n <svg\n className={ProgressCircleSVGCSS}\n viewBox={`0 0 ${progressCircleSizes[size]} ${progressCircleSizes[size]}`}\n width=\"100%\"\n height=\"100%\"\n >\n <circle\n fill=\"none\"\n className={clsx(progressCircleBackgroundCSS({ variant }))}\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n <circle\n style={circleStyles}\n className={progressCircleCSS({ indeterminate: isIndeterminate })}\n fill=\"none\"\n pathLength={\n isIndeterminate ? 360 : circleStyles['strokeDasharray']\n }\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n </svg>\n </span>\n {children && (\n <label\n className={clsx(\n progressCircleChildCSS,\n textStyleCSS({ textStyle: size === 'small' ? 'small' : 'base' }),\n )}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </div>\n );\n },\n);\n\n(\n ProgressCircle as typeof ProgressCircle & { displayName: string }\n).displayName = 'ProgressCircle';\n"],
5
- "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAwB,kBAAkB;AAEjD,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,2BAA2B;AAQpC,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAgD7B,MAAM,sBAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,OAAO;AACT;AACA,MAAM,0BAA0B;AAMzB,MAAM,iBAAiB;AAAA,EAC5B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV;AAAA,MACA,IAAI;AAAA,MACJ,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,GAAG;AAAA,IACL,I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AAG,oBAAoB,IAAI,CAAC;AAAA,YACpC,OAAO,GAAG,oBAAoB,IAAI,CAAC;AAAA,UACrC;AAAA,UACC,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,YACX,SAAS,OAAO,oBAAoB,IAAI,CAAC,IAAI,oBAAoB,IAAI,CAAC;AAAA,YACtE,OAAM;AAAA,YACN,QAAO;AAAA;AAAA,UAEP;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAW,KAAK,4BAA4B,EAAE,QAAQ,CAAC,CAAC;AAAA,cACxD,IAAI,oBAAoB,IAAI,IAAI;AAAA,cAChC,IAAI,oBAAoB,IAAI,IAAI;AAAA,cAChC,IAAI,oBAAoB,IAAI,IAAI,2BAA2B;AAAA,cAC3D,aAAa;AAAA;AAAA,UACf;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,cACP,WAAW,kBAAkB,EAAE,eAAe,gBAAgB,CAAC;AAAA,cAC/D,MAAK;AAAA,cACL,YACE,kBAAkB,MAAM,aAAa,iBAAiB;AAAA,cAExD,IAAI,oBAAoB,IAAI,IAAI;AAAA,cAChC,IAAI,oBAAoB,IAAI,IAAI;AAAA,cAChC,IAAI,oBAAoB,IAAI,IAAI,2BAA2B;AAAA,cAC3D,aAAa;AAAA;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,MACC,YACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,aAAa,EAAE,WAAW,SAAS,UAAU,UAAU,OAAO,CAAC;AAAA,UACjE;AAAA,UACA,SAAS;AAAA;AAAA,QAER;AAAA,MACH;AAAA,IAEJ;AAAA,EAEJ;AACF;AAGE,eACA,cAAc;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { CSSProperties, forwardRef, useId } from 'react';\n\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport {\n progressCircleBackgroundCSS,\n progressCircleChildCSS,\n progressCircleContainerCSS,\n progressCircleCSS,\n progressCircleRootCSS,\n ProgressCircleSVGCSS,\n} from './ProgressCircle.sty.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 RoleVariantType } from '../../core/types/role-variant.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { colorUtilsCSS } from '../../styles/colorUtils.sty.js';\nimport { containerColorsCSS } from '../../styles/container.sty.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * Accepted properties for ProgressCircle.\n * @public\n */\nexport interface ProgressCircleProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The smallest allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the size of the rendered progress.\n * @defaultValue 'large'\n */\n size?: 'small' | 'large';\n /**\n * Controls the appearance of the progress.\n * @defaultValue 'primary'\n */\n variant?: RoleVariantType;\n\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * Default the value as percentage will be provided. If the value is not a percentage please provide the aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\nconst progressCircleSizes = {\n small: 20,\n large: 40,\n};\nconst progressCircleThickness = 5;\n\n/**\n * The `ProgressCircle` component is used to indicate the progress or completion status of a task or process.\n * @public\n * */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n min = 0,\n max = 100,\n size = 'large',\n variant = 'primary',\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressCircleProps = props;\n\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId();\n const id = propId ?? generatedId;\n\n const circleStyles: CSSProperties = {};\n const rootProps = {};\n\n if (!isIndeterminate && value !== undefined) {\n const circumference =\n 2 *\n Math.PI *\n ((progressCircleSizes[size] - progressCircleThickness) / 2);\n circleStyles['strokeDasharray'] = circumference.toFixed(3);\n const dashOffset = Number(\n (((max - value) / max) * circumference).toFixed(3),\n );\n circleStyles['strokeDashoffset'] = `${\n dashOffset >= 0 ? dashOffset : 0\n }px`;\n }\n\n if (\n !children &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n return (\n <div\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n className={clsx(\n consumerClassName,\n containerColorsCSS({\n color: 'neutral',\n variant: variant === 'onAccent' ? 'accent' : 'default',\n }),\n progressCircleContainerCSS({ size }),\n )}\n style={consumerStyle}\n {...forwardProps}\n >\n <span\n id={id}\n className={clsx(\n colorUtilsCSS({ color: variant, variant: 'accent' }),\n progressCircleRootCSS,\n )}\n style={{\n height: `${progressCircleSizes[size]}px`,\n width: `${progressCircleSizes[size]}px`,\n }}\n {...ariaLabelingProps}\n {...progressAriaProps}\n {...rootProps}\n >\n <svg\n className={ProgressCircleSVGCSS}\n viewBox={`0 0 ${progressCircleSizes[size]} ${progressCircleSizes[size]}`}\n width=\"100%\"\n height=\"100%\"\n >\n <circle\n fill=\"none\"\n className={clsx(progressCircleBackgroundCSS({ variant }))}\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n <circle\n style={circleStyles}\n className={progressCircleCSS({ indeterminate: isIndeterminate })}\n fill=\"none\"\n pathLength={\n isIndeterminate ? 360 : circleStyles['strokeDasharray']\n }\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n </svg>\n </span>\n {children && (\n <label\n className={clsx(\n progressCircleChildCSS,\n textStyleCSS({ textStyle: size === 'small' ? 'small' : 'base' }),\n )}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </div>\n );\n },\n);\n\n(\n ProgressCircle as typeof ProgressCircle & { displayName: string }\n).displayName = 'ProgressCircle';\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAwB,YAAY,aAAa;AAExD,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AAQpC,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAgD7B,MAAM,sBAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,OAAO;AACT;AACA,MAAM,0BAA0B;AAMzB,MAAM,iBAAiB;AAAA,EAC5B,CAAC,O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