@dynatrace/strato-components 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/buttons/button/Button.css +16 -16
  2. package/buttons/button/Button.d.ts +4 -4
  3. package/buttons/button/Button.js +47 -34
  4. package/buttons/button/Button.sty.js +4 -4
  5. package/buttons/button/Label.d.ts +2 -2
  6. package/buttons/button/Label.js +6 -5
  7. package/buttons/button/Prefix.d.ts +2 -2
  8. package/buttons/button/Prefix.js +6 -15
  9. package/buttons/button/Suffix.d.ts +3 -3
  10. package/buttons/button/Suffix.js +6 -15
  11. package/buttons/intent-button/IntentButton.d.ts +2 -2
  12. package/buttons/intent-button/IntentButton.js +16 -21
  13. package/buttons/intent-button/useIntentButton.d.ts +4 -3
  14. package/content/progress/ProgressBar.css +71 -71
  15. package/content/progress/ProgressBar.d.ts +4 -5
  16. package/content/progress/ProgressBar.js +49 -41
  17. package/content/progress/ProgressBar.sty.js +5 -5
  18. package/content/progress/ProgressBarIcon.css +2 -2
  19. package/content/progress/ProgressBarIcon.d.ts +1 -2
  20. package/content/progress/ProgressBarIcon.js +6 -5
  21. package/content/progress/ProgressBarIcon.sty.js +1 -1
  22. package/content/progress/ProgressBarLabel.css +3 -3
  23. package/content/progress/ProgressBarLabel.d.ts +1 -2
  24. package/content/progress/ProgressBarLabel.js +6 -5
  25. package/content/progress/ProgressBarLabel.sty.js +1 -1
  26. package/content/progress/ProgressBarValue.css +5 -5
  27. package/content/progress/ProgressBarValue.d.ts +1 -2
  28. package/content/progress/ProgressBarValue.js +6 -5
  29. package/content/progress/ProgressBarValue.sty.js +1 -1
  30. package/content/progress/ProgressCircle.css +40 -40
  31. package/content/progress/ProgressCircle.d.ts +1 -2
  32. package/content/progress/ProgressCircle.js +60 -55
  33. package/content/progress/ProgressCircle.sty.js +5 -5
  34. package/content/progress/contexts/SharedProgressBarPropsContext.d.ts +1 -2
  35. package/content/progress/contexts/SharedProgressBarPropsContext.js +2 -12
  36. package/content/skeleton/Skeleton.css +6 -6
  37. package/content/skeleton/Skeleton.d.ts +2 -2
  38. package/content/skeleton/Skeleton.js +6 -5
  39. package/content/skeleton/Skeleton.sty.js +1 -1
  40. package/content/skeleton/SkeletonText.d.ts +2 -2
  41. package/content/skeleton/SkeletonText.js +9 -18
  42. package/core/components/app-root/AppRoot.d.ts +3 -3
  43. package/core/components/app-root/AppRoot.js +15 -24
  44. package/core/components/focus-scope/FocusScope.d.ts +1 -2
  45. package/core/components/focus-scope/FocusScope.js +6 -15
  46. package/core/hooks/useFontsUpdated.js +1 -1
  47. package/core/hooks/useMergeRefs.d.ts +2 -2
  48. package/core/providers/FocusProvider.d.ts +1 -2
  49. package/core/providers/FocusProvider.js +6 -15
  50. package/core/styles/focusRing.css +66 -66
  51. package/core/styles/focusRing.sty.js +2 -2
  52. package/core/styles/useFocusRing.d.ts +3 -3
  53. package/core/types/polymorph.d.ts +1 -1
  54. package/core/types/styling-props.d.ts +1 -1
  55. package/core/types/with-children.d.ts +1 -1
  56. package/core/utils/_is-string-children.d.ts +2 -2
  57. package/core/utils/_is-string-children.js +2 -12
  58. package/core/utils/colorUtils.css +60 -60
  59. package/core/utils/colorUtils.sty.js +2 -2
  60. package/esm/buttons/button/Button.css +16 -16
  61. package/esm/buttons/button/Button.js +49 -35
  62. package/esm/buttons/button/Button.js.map +2 -2
  63. package/esm/buttons/button/Button.sty.js +4 -4
  64. package/esm/buttons/button/Button.sty.js.map +1 -1
  65. package/esm/buttons/button/Label.js +6 -5
  66. package/esm/buttons/button/Label.js.map +2 -2
  67. package/esm/buttons/button/Prefix.js +6 -5
  68. package/esm/buttons/button/Prefix.js.map +2 -2
  69. package/esm/buttons/button/Suffix.js +6 -5
  70. package/esm/buttons/button/Suffix.js.map +2 -2
  71. package/esm/buttons/intent-button/IntentButton.js +16 -11
  72. package/esm/buttons/intent-button/IntentButton.js.map +2 -2
  73. package/esm/buttons/intent-button/useIntentButton.js +4 -1
  74. package/esm/buttons/intent-button/useIntentButton.js.map +2 -2
  75. package/esm/content/progress/ProgressBar.css +71 -71
  76. package/esm/content/progress/ProgressBar.js +53 -41
  77. package/esm/content/progress/ProgressBar.js.map +2 -2
  78. package/esm/content/progress/ProgressBar.sty.js +5 -5
  79. package/esm/content/progress/ProgressBar.sty.js.map +1 -1
  80. package/esm/content/progress/ProgressBarIcon.css +2 -2
  81. package/esm/content/progress/ProgressBarIcon.js +6 -5
  82. package/esm/content/progress/ProgressBarIcon.js.map +2 -2
  83. package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
  84. package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
  85. package/esm/content/progress/ProgressBarLabel.css +3 -3
  86. package/esm/content/progress/ProgressBarLabel.js +6 -5
  87. package/esm/content/progress/ProgressBarLabel.js.map +2 -2
  88. package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
  89. package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
  90. package/esm/content/progress/ProgressBarValue.css +5 -5
  91. package/esm/content/progress/ProgressBarValue.js +6 -5
  92. package/esm/content/progress/ProgressBarValue.js.map +2 -2
  93. package/esm/content/progress/ProgressBarValue.sty.js +1 -1
  94. package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
  95. package/esm/content/progress/ProgressCircle.css +40 -40
  96. package/esm/content/progress/ProgressCircle.js +60 -55
  97. package/esm/content/progress/ProgressCircle.js.map +2 -2
  98. package/esm/content/progress/ProgressCircle.sty.js +5 -5
  99. package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
  100. package/esm/content/progress/contexts/SharedProgressBarPropsContext.js +2 -2
  101. package/esm/content/progress/contexts/SharedProgressBarPropsContext.js.map +2 -2
  102. package/esm/content/skeleton/Skeleton.css +6 -6
  103. package/esm/content/skeleton/Skeleton.js +6 -5
  104. package/esm/content/skeleton/Skeleton.js.map +2 -2
  105. package/esm/content/skeleton/Skeleton.sty.js +1 -1
  106. package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
  107. package/esm/content/skeleton/SkeletonText.js +9 -8
  108. package/esm/content/skeleton/SkeletonText.js.map +2 -2
  109. package/esm/core/components/app-root/AppRoot.js +15 -14
  110. package/esm/core/components/app-root/AppRoot.js.map +2 -2
  111. package/esm/core/components/focus-scope/FocusScope.js +6 -5
  112. package/esm/core/components/focus-scope/FocusScope.js.map +2 -2
  113. package/esm/core/hooks/useFontsUpdated.js +1 -1
  114. package/esm/core/hooks/useFontsUpdated.js.map +2 -2
  115. package/esm/core/hooks/useMergeRefs.js +3 -1
  116. package/esm/core/hooks/useMergeRefs.js.map +2 -2
  117. package/esm/core/providers/FocusProvider.js +6 -5
  118. package/esm/core/providers/FocusProvider.js.map +2 -2
  119. package/esm/core/styles/focusRing.css +66 -66
  120. package/esm/core/styles/focusRing.sty.js +2 -2
  121. package/esm/core/styles/focusRing.sty.js.map +1 -1
  122. package/esm/core/styles/useFocusRing.js.map +1 -1
  123. package/esm/core/utils/_is-string-children.js +2 -2
  124. package/esm/core/utils/_is-string-children.js.map +2 -2
  125. package/esm/core/utils/colorUtils.css +60 -60
  126. package/esm/core/utils/colorUtils.sty.js +2 -2
  127. package/esm/core/utils/colorUtils.sty.js.map +1 -1
  128. package/esm/layouts/container/Container.css +4 -4
  129. package/esm/layouts/container/Container.js +7 -6
  130. package/esm/layouts/container/Container.js.map +2 -2
  131. package/esm/layouts/container/Container.sty.js +1 -1
  132. package/esm/layouts/container/Container.sty.js.map +1 -1
  133. package/esm/layouts/divider/Divider.css +6 -6
  134. package/esm/layouts/divider/Divider.js +3 -2
  135. package/esm/layouts/divider/Divider.js.map +2 -2
  136. package/esm/layouts/divider/Divider.sty.js +1 -1
  137. package/esm/layouts/divider/Divider.sty.js.map +1 -1
  138. package/esm/layouts/flex/Flex.js +6 -5
  139. package/esm/layouts/flex/Flex.js.map +2 -2
  140. package/esm/layouts/grid/Grid.js +6 -5
  141. package/esm/layouts/grid/Grid.js.map +2 -2
  142. package/esm/layouts/surface/Surface.css +39 -39
  143. package/esm/layouts/surface/Surface.js +17 -14
  144. package/esm/layouts/surface/Surface.js.map +2 -2
  145. package/esm/layouts/surface/Surface.sty.js +2 -2
  146. package/esm/layouts/surface/Surface.sty.js.map +1 -1
  147. package/esm/layouts/surface/variables.sty.js +1 -1
  148. package/esm/layouts/surface/variables.sty.js.map +1 -1
  149. package/esm/styles/colorUtils.css +60 -60
  150. package/esm/styles/colorUtils.sty.js +2 -2
  151. package/esm/styles/colorUtils.sty.js.map +1 -1
  152. package/esm/styles/container.css +47 -47
  153. package/esm/styles/container.sty.js +2 -2
  154. package/esm/styles/container.sty.js.map +1 -1
  155. package/esm/styles/ellipsis.css +1 -1
  156. package/esm/styles/ellipsis.sty.js +1 -1
  157. package/esm/styles/ellipsis.sty.js.map +1 -1
  158. package/esm/styles/field.css +153 -153
  159. package/esm/styles/field.sty.js +2 -2
  160. package/esm/styles/field.sty.js.map +1 -1
  161. package/esm/styles/getFlexStyles.js.map +1 -1
  162. package/esm/styles/getGridStyles.js.map +1 -1
  163. package/esm/styles/getLayoutSizeStyles.js.map +1 -1
  164. package/esm/styles/sprinkles.css +262 -262
  165. package/esm/styles/sprinkles.sty.js +1 -1
  166. package/esm/styles/sprinkles.sty.js.map +1 -1
  167. package/esm/styles/textStyle.css +8 -8
  168. package/esm/styles/textStyle.sty.js +1 -1
  169. package/esm/styles/textStyle.sty.js.map +1 -1
  170. package/esm/typography/block-quote/Blockquote.css +2 -2
  171. package/esm/typography/block-quote/Blockquote.js +6 -5
  172. package/esm/typography/block-quote/Blockquote.js.map +2 -2
  173. package/esm/typography/block-quote/Blockquote.sty.js +1 -1
  174. package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
  175. package/esm/typography/code/Code.css +1 -1
  176. package/esm/typography/code/Code.js +6 -5
  177. package/esm/typography/code/Code.js.map +2 -2
  178. package/esm/typography/code/Code.sty.js +1 -1
  179. package/esm/typography/code/Code.sty.js.map +1 -1
  180. package/esm/typography/emphasis/Emphasis.css +1 -1
  181. package/esm/typography/emphasis/Emphasis.js +6 -5
  182. package/esm/typography/emphasis/Emphasis.js.map +2 -2
  183. package/esm/typography/emphasis/Emphasis.sty.js +1 -1
  184. package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
  185. package/esm/typography/external-link/ExternalLink.css +6 -6
  186. package/esm/typography/external-link/ExternalLink.js +22 -16
  187. package/esm/typography/external-link/ExternalLink.js.map +2 -2
  188. package/esm/typography/external-link/ExternalLink.sty.js +1 -1
  189. package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
  190. package/esm/typography/heading/Heading.css +7 -7
  191. package/esm/typography/heading/Heading.js +6 -5
  192. package/esm/typography/heading/Heading.js.map +2 -2
  193. package/esm/typography/heading/Heading.sty.js +1 -1
  194. package/esm/typography/heading/Heading.sty.js.map +1 -1
  195. package/esm/typography/highlight/Highlight.css +1 -1
  196. package/esm/typography/highlight/Highlight.js +31 -18
  197. package/esm/typography/highlight/Highlight.js.map +3 -3
  198. package/esm/typography/highlight/Highlight.sty.js +1 -1
  199. package/esm/typography/highlight/Highlight.sty.js.map +1 -1
  200. package/esm/typography/link/Link.css +4 -4
  201. package/esm/typography/link/Link.js +6 -5
  202. package/esm/typography/link/Link.js.map +2 -2
  203. package/esm/typography/link/Link.sty.js +1 -1
  204. package/esm/typography/link/Link.sty.js.map +1 -1
  205. package/esm/typography/list/List.css +4 -4
  206. package/esm/typography/list/List.js +14 -9
  207. package/esm/typography/list/List.js.map +2 -2
  208. package/esm/typography/list/List.sty.js +2 -2
  209. package/esm/typography/list/List.sty.js.map +1 -1
  210. package/esm/typography/paragraph/Paragraph.css +3 -3
  211. package/esm/typography/paragraph/Paragraph.js +6 -5
  212. package/esm/typography/paragraph/Paragraph.js.map +2 -2
  213. package/esm/typography/paragraph/Paragraph.sty.js +1 -1
  214. package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
  215. package/esm/typography/strikethrough/Strikethrough.css +1 -1
  216. package/esm/typography/strikethrough/Strikethrough.js +6 -5
  217. package/esm/typography/strikethrough/Strikethrough.js.map +2 -2
  218. package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
  219. package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
  220. package/esm/typography/strong/Strong.css +1 -1
  221. package/esm/typography/strong/Strong.js +6 -5
  222. package/esm/typography/strong/Strong.js.map +2 -2
  223. package/esm/typography/strong/Strong.sty.js +1 -1
  224. package/esm/typography/strong/Strong.sty.js.map +1 -1
  225. package/esm/typography/text/Text.css +3 -3
  226. package/esm/typography/text/Text.js +6 -5
  227. package/esm/typography/text/Text.js.map +2 -2
  228. package/esm/typography/text/Text.sty.js +1 -1
  229. package/esm/typography/text/Text.sty.js.map +1 -1
  230. package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
  231. package/esm/typography/text-ellipsis/TextEllipsis.js +12 -11
  232. package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
  233. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
  234. package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
  235. package/layouts/container/Container.css +4 -4
  236. package/layouts/container/Container.js +7 -6
  237. package/layouts/container/Container.sty.js +1 -1
  238. package/layouts/divider/Divider.css +6 -6
  239. package/layouts/divider/Divider.d.ts +1 -2
  240. package/layouts/divider/Divider.js +3 -2
  241. package/layouts/divider/Divider.sty.js +1 -1
  242. package/layouts/flex/Flex.js +6 -5
  243. package/layouts/grid/Grid.d.ts +1 -1
  244. package/layouts/grid/Grid.js +6 -5
  245. package/layouts/surface/Surface.css +39 -39
  246. package/layouts/surface/Surface.js +17 -14
  247. package/layouts/surface/Surface.sty.js +2 -2
  248. package/layouts/surface/variables.sty.js +1 -1
  249. package/layouts/types/layout.types.d.ts +1 -1
  250. package/package.json +2 -2
  251. package/styles/colorUtils.css +60 -60
  252. package/styles/colorUtils.sty.js +2 -2
  253. package/styles/container.css +47 -47
  254. package/styles/container.sty.js +2 -2
  255. package/styles/ellipsis.css +1 -1
  256. package/styles/ellipsis.sty.js +1 -1
  257. package/styles/field.css +153 -153
  258. package/styles/field.sty.js +2 -2
  259. package/styles/getFlexStyles.d.ts +17 -17
  260. package/styles/getGridStyles.d.ts +22 -22
  261. package/styles/getLayoutSizeStyles.d.ts +1 -1
  262. package/styles/sprinkles.css +262 -262
  263. package/styles/sprinkles.sty.js +1 -1
  264. package/styles/textStyle.css +8 -8
  265. package/styles/textStyle.sty.js +1 -1
  266. package/typography/block-quote/Blockquote.css +2 -2
  267. package/typography/block-quote/Blockquote.d.ts +1 -2
  268. package/typography/block-quote/Blockquote.js +6 -5
  269. package/typography/block-quote/Blockquote.sty.js +1 -1
  270. package/typography/code/Code.css +1 -1
  271. package/typography/code/Code.d.ts +1 -2
  272. package/typography/code/Code.js +6 -5
  273. package/typography/code/Code.sty.js +1 -1
  274. package/typography/emphasis/Emphasis.css +1 -1
  275. package/typography/emphasis/Emphasis.d.ts +1 -2
  276. package/typography/emphasis/Emphasis.js +6 -5
  277. package/typography/emphasis/Emphasis.sty.js +1 -1
  278. package/typography/external-link/ExternalLink.css +6 -6
  279. package/typography/external-link/ExternalLink.d.ts +2 -2
  280. package/typography/external-link/ExternalLink.js +22 -16
  281. package/typography/external-link/ExternalLink.sty.js +1 -1
  282. package/typography/heading/Heading.css +7 -7
  283. package/typography/heading/Heading.d.ts +1 -2
  284. package/typography/heading/Heading.js +6 -5
  285. package/typography/heading/Heading.sty.js +1 -1
  286. package/typography/highlight/Highlight.css +1 -1
  287. package/typography/highlight/Highlight.d.ts +1 -1
  288. package/typography/highlight/Highlight.js +21 -17
  289. package/typography/highlight/Highlight.sty.js +1 -1
  290. package/typography/link/Link.css +4 -4
  291. package/typography/link/Link.d.ts +1 -1
  292. package/typography/link/Link.js +6 -5
  293. package/typography/link/Link.sty.js +1 -1
  294. package/typography/list/List.css +4 -4
  295. package/typography/list/List.d.ts +1 -2
  296. package/typography/list/List.js +10 -9
  297. package/typography/list/List.sty.js +2 -2
  298. package/typography/paragraph/Paragraph.css +3 -3
  299. package/typography/paragraph/Paragraph.d.ts +1 -2
  300. package/typography/paragraph/Paragraph.js +6 -5
  301. package/typography/paragraph/Paragraph.sty.js +1 -1
  302. package/typography/strikethrough/Strikethrough.css +1 -1
  303. package/typography/strikethrough/Strikethrough.d.ts +1 -2
  304. package/typography/strikethrough/Strikethrough.js +6 -5
  305. package/typography/strikethrough/Strikethrough.sty.js +1 -1
  306. package/typography/strong/Strong.css +1 -1
  307. package/typography/strong/Strong.d.ts +1 -2
  308. package/typography/strong/Strong.js +6 -5
  309. package/typography/strong/Strong.sty.js +1 -1
  310. package/typography/text/Text.css +3 -3
  311. package/typography/text/Text.js +6 -5
  312. package/typography/text/Text.sty.js +1 -1
  313. package/typography/text-ellipsis/TextEllipsis.css +6 -6
  314. package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
  315. package/typography/text-ellipsis/TextEllipsis.js +12 -11
  316. package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
@@ -1,5 +1,6 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import { isEmpty } from "lodash-es";
2
- import React, {
3
+ import {
3
4
  forwardRef,
4
5
  useEffect,
5
6
  useLayoutEffect,
@@ -62,7 +63,7 @@ const AppRoot = /* @__PURE__ */ forwardRef(
62
63
  setMessages((prev) => isEmpty(prev) ? prev : {});
63
64
  });
64
65
  }, [language]);
65
- return /* @__PURE__ */ React.createElement(
66
+ return /* @__PURE__ */ jsx(
66
67
  "div",
67
68
  {
68
69
  ref: forwardedRef,
@@ -71,18 +72,18 @@ const AppRoot = /* @__PURE__ */ forwardRef(
71
72
  style: consumerStyle,
72
73
  "data-theme": theme,
73
74
  "data-dtrum-mask": dataDtrumMask,
74
- "data-dtrum-allow": dataDtrumAllow
75
- },
76
- /* @__PURE__ */ React.createElement(
77
- IntlProvider,
78
- {
79
- locale: language,
80
- timeZone: timezone,
81
- messages,
82
- defaultLocale: defaultLanguage
83
- },
84
- /* @__PURE__ */ React.createElement(FocusProvider, null, children)
85
- )
75
+ "data-dtrum-allow": dataDtrumAllow,
76
+ children: /* @__PURE__ */ jsx(
77
+ IntlProvider,
78
+ {
79
+ locale: language,
80
+ timeZone: timezone,
81
+ messages,
82
+ defaultLocale: defaultLanguage,
83
+ children: /* @__PURE__ */ jsx(FocusProvider, { children })
84
+ }
85
+ )
86
+ }
86
87
  );
87
88
  }
88
89
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/core/components/app-root/AppRoot.tsx"],
4
- "sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { IntlProvider, type MessageFormatElement } from 'react-intl';\n\nimport 'wicg-inert';\nimport { getLanguage, getTimezone } from '@dynatrace-sdk/user-preferences';\n\nimport './AppRoot.sty.js';\nimport { useCurrentTheme } from '../../hooks/useCurrentTheme.js';\nimport { FocusProvider } from '../../providers/FocusProvider.js';\nimport { type DataTestId } from '../../types/data-props.js';\nimport { type MaskingProps } from '../../types/masking-props.js';\nimport { type StylingProps } from '../../types/styling-props.js';\n\n/**\n * Gets the href value set in the <base> element to prefix fetches correctly.\n * Will always end with a `/` value\n */\nfunction getBaseHref(): string {\n const baseElement = document.querySelector('base');\n const href = baseElement?.href ?? '/';\n return href.endsWith('/') ? href : `${href}/`;\n}\n\n/**\n * AppRoot component props.\n * @public\n */\nexport type AppRootProps = PropsWithChildren<\n DataTestId & StylingProps & MaskingProps\n>;\n\nconst defaultLanguage = 'en';\n\n/**\n * In order to have all the providers in place for rendering overlays, applying\n * global styles or internationalization, you need to wrap your app in the\n * `AppRoot`. If you're using the `dt-app` to create your app, this is\n * automatically taken care of and you can start working on your app without\n * further ado.\n * @public\n */\nexport const AppRoot = /* @__PURE__ */ forwardRef<HTMLDivElement, AppRootProps>(\n (props, forwardedRef) => {\n const {\n style: consumerStyle,\n className: consumerClassName,\n 'data-testid': dataTestId = 'app-root',\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n } = props;\n\n /** Messages that are used for the translation. */\n const [messages, setMessages] = useState<\n Record<string, string> | Record<string, MessageFormatElement[]>\n >({});\n\n const { children } = props;\n\n const theme = useCurrentTheme();\n const language = getLanguage();\n let timezone = getTimezone();\n try {\n new Intl.DateTimeFormat(language, { timeZone: timezone });\n } catch {\n // If the passed timezone is not valid, we can fall back to the browsers\n // configured one.\n timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** Inject the font link into the head */\n useLayoutEffect(() => {\n // Right now the font css file is not automatically injected into\n // the app index.html file. And as there are no static ways to @import\n // css with vanilla extract, we need to inject the link here.\n const link = document.createElement('link');\n\n link.rel = 'stylesheet';\n link.href = 'https://dt-cdn.net/fonts/fonts-v004.css';\n document.head.appendChild(link);\n return () => {\n document.head.removeChild(link);\n };\n }, []);\n\n /**\n * Synchronize the [data-theme] attribute to the root of the document\n * to have the design tokens defined in the cascade.\n */\n useLayoutEffect(() => {\n if (document !== undefined) {\n document.documentElement.setAttribute('data-theme', theme);\n }\n }, [theme]);\n\n useEffect(() => {\n if (language === 'en') {\n // Don't fetch translations for 'en' to avoid an additional render cycle.\n // The default messages are in english already.\n return;\n }\n\n fetch(`${getBaseHref()}lang/${language}.json`)\n .then((res) => {\n return res.json();\n })\n .then((receivedMessages) => {\n setMessages(receivedMessages);\n })\n .catch(() => {\n // Only set messages to a new empty object if the previous messages were not empty.\n // `setMessages({})` would make react believe that this is a new object and, hence, re-render.\n // By just returning `prev` if the messages were already empty, we can avoid the additional render.\n setMessages((prev) => (isEmpty(prev) ? prev : {}));\n });\n }, [language]);\n\n return (\n <div\n ref={forwardedRef}\n data-testid={dataTestId}\n className={consumerClassName}\n style={consumerStyle}\n data-theme={theme}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n >\n <IntlProvider\n locale={language}\n timeZone={timezone}\n messages={messages}\n defaultLocale={defaultLanguage}\n >\n <FocusProvider>{children}</FocusProvider>\n </IntlProvider>\n </div>\n );\n },\n);\n\n(AppRoot as typeof AppRoot & { displayName: string }).displayName = 'AppRoot';\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AACxB,OAAO;AAAA,EAEL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAA+C;AAExD,OAAO;AACP,SAAS,aAAa,mBAAmB;AAEzC,OAAO;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAS9B,SAAS,cAAsB;AAC7B,QAAM,cAAc,SAAS,cAAc,MAAM;AACjD,QAAM,OAAO,aAAa,QAAQ;AAClC,SAAO,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,IAAI;AAC5C;AAUA,MAAM,kBAAkB;AAUjB,MAAM,UAA0B;AAAA,EACrC,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,eAAe,aAAa;AAAA,MAC5B,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,IACtB,IAAI;AAGJ,UAAM,CAAC,UAAU,WAAW,IAAI,SAE9B,CAAC,CAAC;AAEJ,UAAM,EAAE,SAAS,IAAI;AAErB,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,WAAW,YAAY;AAC7B,QAAI,WAAW,YAAY;AAC3B,QAAI;AACF,UAAI,KAAK,eAAe,UAAU,EAAE,UAAU,SAAS,CAAC;AAAA,IAC1D,QAAQ;AAGN,iBAAW,KAAK,eAAe,EAAE,gBAAgB,EAAE;AAAA,IACrD;AAGA,oBAAgB,MAAM;AAIpB,YAAM,OAAO,SAAS,cAAc,MAAM;AAE1C,WAAK,MAAM;AACX,WAAK,OAAO;AACZ,eAAS,KAAK,YAAY,IAAI;AAC9B,aAAO,MAAM;AACX,iBAAS,KAAK,YAAY,IAAI;AAAA,MAChC;AAAA,IACF,GAAG,CAAC,CAAC;AAML,oBAAgB,MAAM;AACpB,UAAI,aAAa,QAAW;AAC1B,iBAAS,gBAAgB,aAAa,cAAc,KAAK;AAAA,MAC3D;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,cAAU,MAAM;AACd,UAAI,aAAa,MAAM;AAGrB;AAAA,MACF;AAEA,YAAM,GAAG,YAAY,CAAC,QAAQ,QAAQ,OAAO,EAC1C,KAAK,CAAC,QAAQ;AACb,eAAO,IAAI,KAAK;AAAA,MAClB,CAAC,EACA,KAAK,CAAC,qBAAqB;AAC1B,oBAAY,gBAAgB;AAAA,MAC9B,CAAC,EACA,MAAM,MAAM;AAIX,oBAAY,CAAC,SAAU,QAAQ,IAAI,IAAI,OAAO,CAAC,CAAE;AAAA,MACnD,CAAC;AAAA,IACL,GAAG,CAAC,QAAQ,CAAC;AAEb,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,eAAa;AAAA,QACb,WAAW;AAAA,QACX,OAAO;AAAA,QACP,cAAY;AAAA,QACZ,mBAAiB;AAAA,QACjB,oBAAkB;AAAA;AAAA,MAElB;AAAA,QAAC;AAAA;AAAA,UACC,QAAQ;AAAA,UACR,UAAU;AAAA,UACV;AAAA,UACA,eAAe;AAAA;AAAA,QAEf,oCAAC,qBAAe,QAAS;AAAA,MAC3B;AAAA,IACF;AAAA,EAEJ;AACF;AAEC,QAAqD,cAAc;",
4
+ "sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport {\n type PropsWithChildren,\n forwardRef,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { IntlProvider, type MessageFormatElement } from 'react-intl';\n\nimport 'wicg-inert';\nimport { getLanguage, getTimezone } from '@dynatrace-sdk/user-preferences';\n\nimport './AppRoot.sty.js';\nimport { useCurrentTheme } from '../../hooks/useCurrentTheme.js';\nimport { FocusProvider } from '../../providers/FocusProvider.js';\nimport { type DataTestId } from '../../types/data-props.js';\nimport { type MaskingProps } from '../../types/masking-props.js';\nimport { type StylingProps } from '../../types/styling-props.js';\n\n/**\n * Gets the href value set in the <base> element to prefix fetches correctly.\n * Will always end with a `/` value\n */\nfunction getBaseHref(): string {\n const baseElement = document.querySelector('base');\n const href = baseElement?.href ?? '/';\n return href.endsWith('/') ? href : `${href}/`;\n}\n\n/**\n * AppRoot component props.\n * @public\n */\nexport type AppRootProps = PropsWithChildren<\n DataTestId & StylingProps & MaskingProps\n>;\n\nconst defaultLanguage = 'en';\n\n/**\n * In order to have all the providers in place for rendering overlays, applying\n * global styles or internationalization, you need to wrap your app in the\n * `AppRoot`. If you're using the `dt-app` to create your app, this is\n * automatically taken care of and you can start working on your app without\n * further ado.\n * @public\n */\nexport const AppRoot = /* @__PURE__ */ forwardRef<HTMLDivElement, AppRootProps>(\n (props, forwardedRef) => {\n const {\n style: consumerStyle,\n className: consumerClassName,\n 'data-testid': dataTestId = 'app-root',\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n } = props;\n\n /** Messages that are used for the translation. */\n const [messages, setMessages] = useState<\n Record<string, string> | Record<string, MessageFormatElement[]>\n >({});\n\n const { children } = props;\n\n const theme = useCurrentTheme();\n const language = getLanguage();\n let timezone = getTimezone();\n try {\n new Intl.DateTimeFormat(language, { timeZone: timezone });\n } catch {\n // If the passed timezone is not valid, we can fall back to the browsers\n // configured one.\n timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** Inject the font link into the head */\n useLayoutEffect(() => {\n // Right now the font css file is not automatically injected into\n // the app index.html file. And as there are no static ways to @import\n // css with vanilla extract, we need to inject the link here.\n const link = document.createElement('link');\n\n link.rel = 'stylesheet';\n link.href = 'https://dt-cdn.net/fonts/fonts-v004.css';\n document.head.appendChild(link);\n return () => {\n document.head.removeChild(link);\n };\n }, []);\n\n /**\n * Synchronize the [data-theme] attribute to the root of the document\n * to have the design tokens defined in the cascade.\n */\n useLayoutEffect(() => {\n if (document !== undefined) {\n document.documentElement.setAttribute('data-theme', theme);\n }\n }, [theme]);\n\n useEffect(() => {\n if (language === 'en') {\n // Don't fetch translations for 'en' to avoid an additional render cycle.\n // The default messages are in english already.\n return;\n }\n\n fetch(`${getBaseHref()}lang/${language}.json`)\n .then((res) => {\n return res.json();\n })\n .then((receivedMessages) => {\n setMessages(receivedMessages);\n })\n .catch(() => {\n // Only set messages to a new empty object if the previous messages were not empty.\n // `setMessages({})` would make react believe that this is a new object and, hence, re-render.\n // By just returning `prev` if the messages were already empty, we can avoid the additional render.\n setMessages((prev) => (isEmpty(prev) ? prev : {}));\n });\n }, [language]);\n\n return (\n <div\n ref={forwardedRef}\n data-testid={dataTestId}\n className={consumerClassName}\n style={consumerStyle}\n data-theme={theme}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n >\n <IntlProvider\n locale={language}\n timeZone={timezone}\n messages={messages}\n defaultLocale={defaultLanguage}\n >\n <FocusProvider>{children}</FocusProvider>\n </IntlProvider>\n </div>\n );\n },\n);\n\n(AppRoot as typeof AppRoot & { displayName: string }).displayName = 'AppRoot';\n"],
5
+ "mappings": "AA2IU;AA3IV,SAAS,eAAe;AACxB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAA+C;AAExD,OAAO;AACP,SAAS,aAAa,mBAAmB;AAEzC,OAAO;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAS9B,SAAS,cAAsB;AAC7B,QAAM,cAAc,SAAS,cAAc,MAAM;AACjD,QAAM,OAAO,aAAa,QAAQ;AAClC,SAAO,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,IAAI;AAC5C;AAUA,MAAM,kBAAkB;AAUjB,MAAM,UAA0B;AAAA,EACrC,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,eAAe,aAAa;AAAA,MAC5B,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,IACtB,IAAI;AAGJ,UAAM,CAAC,UAAU,WAAW,IAAI,SAE9B,CAAC,CAAC;AAEJ,UAAM,EAAE,SAAS,IAAI;AAErB,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,WAAW,YAAY;AAC7B,QAAI,WAAW,YAAY;AAC3B,QAAI;AACF,UAAI,KAAK,eAAe,UAAU,EAAE,UAAU,SAAS,CAAC;AAAA,IAC1D,QAAQ;AAGN,iBAAW,KAAK,eAAe,EAAE,gBAAgB,EAAE;AAAA,IACrD;AAGA,oBAAgB,MAAM;AAIpB,YAAM,OAAO,SAAS,cAAc,MAAM;AAE1C,WAAK,MAAM;AACX,WAAK,OAAO;AACZ,eAAS,KAAK,YAAY,IAAI;AAC9B,aAAO,MAAM;AACX,iBAAS,KAAK,YAAY,IAAI;AAAA,MAChC;AAAA,IACF,GAAG,CAAC,CAAC;AAML,oBAAgB,MAAM;AACpB,UAAI,aAAa,QAAW;AAC1B,iBAAS,gBAAgB,aAAa,cAAc,KAAK;AAAA,MAC3D;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,cAAU,MAAM;AACd,UAAI,aAAa,MAAM;AAGrB;AAAA,MACF;AAEA,YAAM,GAAG,YAAY,CAAC,QAAQ,QAAQ,OAAO,EAC1C,KAAK,CAAC,QAAQ;AACb,eAAO,IAAI,KAAK;AAAA,MAClB,CAAC,EACA,KAAK,CAAC,qBAAqB;AAC1B,oBAAY,gBAAgB;AAAA,MAC9B,CAAC,EACA,MAAM,MAAM;AAIX,oBAAY,CAAC,SAAU,QAAQ,IAAI,IAAI,OAAO,CAAC,CAAE;AAAA,MACnD,CAAC;AAAA,IACL,GAAG,CAAC,QAAQ,CAAC;AAEb,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,eAAa;AAAA,QACb,WAAW;AAAA,QACX,OAAO;AAAA,QACP,cAAY;AAAA,QACZ,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAElB;AAAA,UAAC;AAAA;AAAA,YACC,QAAQ;AAAA,YACR,UAAU;AAAA,YACV;AAAA,YACA,eAAe;AAAA,YAEf,8BAAC,iBAAe,UAAS;AAAA;AAAA,QAC3B;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEC,QAAqD,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useRef } from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
2
3
  import { useActiveElement } from "../../hooks/useActiveElement.js";
3
4
  import { useFocusContext } from "../../hooks/useFocusContext.js";
4
5
  import { focusFirstDescendant } from "../../utils/focus-management/focus-first-descendant.js";
@@ -36,14 +37,14 @@ const FocusScope = (props) => {
36
37
  triggerElementCopy.focus();
37
38
  };
38
39
  }, [contain, autoFocus]);
39
- return /* @__PURE__ */ React.createElement(
40
+ return /* @__PURE__ */ jsx(
40
41
  "div",
41
42
  {
42
43
  style: { display: "contents" },
43
44
  ref: wrapperRef,
44
- "aria-labelledby": triggerElement.current.id
45
- },
46
- children
45
+ "aria-labelledby": triggerElement.current.id,
46
+ children
47
+ }
47
48
  );
48
49
  };
49
50
  FocusScope.displayName = "FocusScope";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/core/components/focus-scope/FocusScope.tsx"],
4
- "sourcesContent": ["import React, { useEffect, useRef } from 'react';\n\nimport { useActiveElement } from '../../hooks/useActiveElement.js';\nimport { useFocusContext } from '../../hooks/useFocusContext.js';\nimport type { WithChildren } from '../../types/with-children.js';\nimport { focusFirstDescendant } from '../../utils/focus-management/focus-first-descendant.js';\n\n// #region Types\n\n/**\n * Prop definition of the `FocusScope` component.\n * @public\n */\nexport interface FocusScopeProps extends WithChildren {\n /**\n * If set to true, the focus scope automatically focuses the first focusable element inside.\n * @defaultValue false\n */\n autoFocus?: boolean;\n /**\n * If set to true, the focus scope traps the focus inside.\n * @defaultValue false\n */\n contain?: boolean;\n}\n// #endregion Types\n\n/**\n * The `FocusScope` helps you manage the focus when opening any overlay. If you\n * want to create a custom overlay, you can wrap the content of your overlay in the\n * `FocusScope` to help you make the overlay accessible and handle focus\n * appropriately.\n * @public\n */\nexport const FocusScope = (props: FocusScopeProps) => {\n const { autoFocus, contain, children } = props;\n const focusContext = useFocusContext();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const focusedElement = useActiveElement();\n const triggerElement = useRef(focusedElement);\n\n useEffect(() => {\n if (contain || autoFocus) {\n focusFirstDescendant(wrapperRef.current);\n }\n\n if (contain) {\n focusContext.setBackgroundInertness(true);\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n focusContext.setBackgroundInertness(false);\n // The focus must be restored on the trigger after removing the inert prop on\n // AppRoot (rendering complete). SetTimeout creates a macrotask to change queueing order.\n window.setTimeout(() => triggerElementCopy.focus(), 0);\n };\n }\n\n if (!autoFocus && !contain) {\n document.addEventListener('keydown', (e) => {\n if (e.key !== 'Tab') {\n return;\n }\n\n if (e.target === triggerElement.current) {\n e.preventDefault();\n focusFirstDescendant(wrapperRef.current);\n }\n });\n }\n\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n // restore focus on trigger when unmounting the focusscope\n triggerElementCopy.focus();\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contain, autoFocus]);\n\n return (\n <div\n style={{ display: 'contents' }}\n ref={wrapperRef}\n aria-labelledby={triggerElement.current.id}\n // Prevents that focus is lost when clicking on non-focusable items inside (atm used in the internal Drawer).\n // Probably worth considering moving that to the focusScope when redoing the overlays.\n // tabIndex={-1}\n >\n {children}\n </div>\n );\n};\n\nFocusScope.displayName = 'FocusScope';\n"],
5
- "mappings": "AAAA,OAAO,SAAS,WAAW,cAAc;AAEzC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,SAAS,4BAA4B;AA6B9B,MAAM,aAAa,CAAC,UAA2B;AACpD,QAAM,EAAE,WAAW,SAAS,SAAS,IAAI;AACzC,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,iBAAiB,iBAAiB;AACxC,QAAM,iBAAiB,OAAO,cAAc;AAE5C,YAAU,MAAM;AACd,QAAI,WAAW,WAAW;AACxB,2BAAqB,WAAW,OAAO;AAAA,IACzC;AAEA,QAAI,SAAS;AACX,mBAAa,uBAAuB,IAAI;AACxC,YAAMA,sBAAqB,eAAe;AAE1C,aAAO,MAAM;AACX,qBAAa,uBAAuB,KAAK;AAGzC,eAAO,WAAW,MAAMA,oBAAmB,MAAM,GAAG,CAAC;AAAA,MACvD;AAAA,IACF;AAEA,QAAI,CAAC,aAAa,CAAC,SAAS;AAC1B,eAAS,iBAAiB,WAAW,CAAC,MAAM;AAC1C,YAAI,EAAE,QAAQ,OAAO;AACnB;AAAA,QACF;AAEA,YAAI,EAAE,WAAW,eAAe,SAAS;AACvC,YAAE,eAAe;AACjB,+BAAqB,WAAW,OAAO;AAAA,QACzC;AAAA,MACF,CAAC;AAAA,IACH;AAEA,UAAM,qBAAqB,eAAe;AAE1C,WAAO,MAAM;AAEX,yBAAmB,MAAM;AAAA,IAC3B;AAAA,EAGF,GAAG,CAAC,SAAS,SAAS,CAAC;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,WAAW;AAAA,MAC7B,KAAK;AAAA,MACL,mBAAiB,eAAe,QAAQ;AAAA;AAAA,IAKvC;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;",
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react';\n\nimport { useActiveElement } from '../../hooks/useActiveElement.js';\nimport { useFocusContext } from '../../hooks/useFocusContext.js';\nimport type { WithChildren } from '../../types/with-children.js';\nimport { focusFirstDescendant } from '../../utils/focus-management/focus-first-descendant.js';\n\n// #region Types\n\n/**\n * Prop definition of the `FocusScope` component.\n * @public\n */\nexport interface FocusScopeProps extends WithChildren {\n /**\n * If set to true, the focus scope automatically focuses the first focusable element inside.\n * @defaultValue false\n */\n autoFocus?: boolean;\n /**\n * If set to true, the focus scope traps the focus inside.\n * @defaultValue false\n */\n contain?: boolean;\n}\n// #endregion Types\n\n/**\n * The `FocusScope` helps you manage the focus when opening any overlay. If you\n * want to create a custom overlay, you can wrap the content of your overlay in the\n * `FocusScope` to help you make the overlay accessible and handle focus\n * appropriately.\n * @public\n */\nexport const FocusScope = (props: FocusScopeProps) => {\n const { autoFocus, contain, children } = props;\n const focusContext = useFocusContext();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const focusedElement = useActiveElement();\n const triggerElement = useRef(focusedElement);\n\n useEffect(() => {\n if (contain || autoFocus) {\n focusFirstDescendant(wrapperRef.current);\n }\n\n if (contain) {\n focusContext.setBackgroundInertness(true);\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n focusContext.setBackgroundInertness(false);\n // The focus must be restored on the trigger after removing the inert prop on\n // AppRoot (rendering complete). SetTimeout creates a macrotask to change queueing order.\n window.setTimeout(() => triggerElementCopy.focus(), 0);\n };\n }\n\n if (!autoFocus && !contain) {\n document.addEventListener('keydown', (e) => {\n if (e.key !== 'Tab') {\n return;\n }\n\n if (e.target === triggerElement.current) {\n e.preventDefault();\n focusFirstDescendant(wrapperRef.current);\n }\n });\n }\n\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n // restore focus on trigger when unmounting the focusscope\n triggerElementCopy.focus();\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contain, autoFocus]);\n\n return (\n <div\n style={{ display: 'contents' }}\n ref={wrapperRef}\n aria-labelledby={triggerElement.current.id}\n // Prevents that focus is lost when clicking on non-focusable items inside (atm used in the internal Drawer).\n // Probably worth considering moving that to the focusScope when redoing the overlays.\n // tabIndex={-1}\n >\n {children}\n </div>\n );\n};\n\nFocusScope.displayName = 'FocusScope';\n"],
5
+ "mappings": "AAkFI;AAlFJ,SAAS,WAAW,cAAc;AAElC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,SAAS,4BAA4B;AA6B9B,MAAM,aAAa,CAAC,UAA2B;AACpD,QAAM,EAAE,WAAW,SAAS,SAAS,IAAI;AACzC,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,iBAAiB,iBAAiB;AACxC,QAAM,iBAAiB,OAAO,cAAc;AAE5C,YAAU,MAAM;AACd,QAAI,WAAW,WAAW;AACxB,2BAAqB,WAAW,OAAO;AAAA,IACzC;AAEA,QAAI,SAAS;AACX,mBAAa,uBAAuB,IAAI;AACxC,YAAMA,sBAAqB,eAAe;AAE1C,aAAO,MAAM;AACX,qBAAa,uBAAuB,KAAK;AAGzC,eAAO,WAAW,MAAMA,oBAAmB,MAAM,GAAG,CAAC;AAAA,MACvD;AAAA,IACF;AAEA,QAAI,CAAC,aAAa,CAAC,SAAS;AAC1B,eAAS,iBAAiB,WAAW,CAAC,MAAM;AAC1C,YAAI,EAAE,QAAQ,OAAO;AACnB;AAAA,QACF;AAEA,YAAI,EAAE,WAAW,eAAe,SAAS;AACvC,YAAE,eAAe;AACjB,+BAAqB,WAAW,OAAO;AAAA,QACzC;AAAA,MACF,CAAC;AAAA,IACH;AAEA,UAAM,qBAAqB,eAAe;AAE1C,WAAO,MAAM;AAEX,yBAAmB,MAAM;AAAA,IAC3B;AAAA,EAGF,GAAG,CAAC,SAAS,SAAS,CAAC;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,WAAW;AAAA,MAC7B,KAAK;AAAA,MACL,mBAAiB,eAAe,QAAQ;AAAA,MAKvC;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;",
6
6
  "names": ["triggerElementCopy"]
7
7
  }
@@ -2,7 +2,7 @@ import { isEqual } from "lodash-es";
2
2
  import { useRef, useState } from "react";
3
3
  function useFontsUpdated(callback) {
4
4
  const [fontsUpdated, setFontsUpdated] = useState(false);
5
- const prevFontFamilies = useRef();
5
+ const prevFontFamilies = useRef([]);
6
6
  const fontFamilies = [];
7
7
  const firstRender = useRef(true);
8
8
  if (document.fonts) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/hooks/useFontsUpdated.ts"],
4
- "sourcesContent": ["import { isEqual } from 'lodash-es';\nimport { useRef, useState } from 'react';\n\n/**\n * Hook that checks if the initially loaded fonts were updated.\n * Used to trigger remeasuring in the DataTable (autoWidth) and TextEllipsis once all fonts are loaded.\n *\n * @param callback - optionally pass a function to be executed once when the fonts were updated\n * @returns boolean whether the fonts have changed\n * @internal\n */\nexport function useFontsUpdated(callback?: () => void): boolean {\n const [fontsUpdated, setFontsUpdated] = useState(false);\n const prevFontFamilies = useRef<string[]>();\n const fontFamilies: string[] = [];\n const firstRender = useRef(true);\n\n if (document.fonts) {\n // gather the font families that are already loaded\n if (firstRender.current) {\n const loadedFontFamilies: string[] = [];\n document.fonts.forEach((fontFace: FontFace) =>\n loadedFontFamilies.push(`${fontFace.family} ${fontFace.weight}`),\n );\n prevFontFamilies.current = loadedFontFamilies;\n firstRender.current = false;\n }\n\n document.fonts.ready.then((fontFaceSet: FontFaceSet) => {\n fontFaceSet.forEach((fontFace: FontFace) =>\n fontFamilies.push(`${fontFace.family} ${fontFace.weight}`),\n );\n\n if (!isEqual(prevFontFamilies.current, fontFamilies)) {\n prevFontFamilies.current = fontFamilies;\n callback?.();\n setFontsUpdated(true);\n }\n });\n }\n\n return fontsUpdated;\n}\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AACxB,SAAS,QAAQ,gBAAgB;AAU1B,SAAS,gBAAgB,UAAgC;AAC9D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,mBAAmB,OAAiB;AAC1C,QAAM,eAAyB,CAAC;AAChC,QAAM,cAAc,OAAO,IAAI;AAE/B,MAAI,SAAS,OAAO;AAElB,QAAI,YAAY,SAAS;AACvB,YAAM,qBAA+B,CAAC;AACtC,eAAS,MAAM;AAAA,QAAQ,CAAC,aACtB,mBAAmB,KAAK,GAAG,SAAS,MAAM,IAAI,SAAS,MAAM,EAAE;AAAA,MACjE;AACA,uBAAiB,UAAU;AAC3B,kBAAY,UAAU;AAAA,IACxB;AAEA,aAAS,MAAM,MAAM,KAAK,CAAC,gBAA6B;AACtD,kBAAY;AAAA,QAAQ,CAAC,aACnB,aAAa,KAAK,GAAG,SAAS,MAAM,IAAI,SAAS,MAAM,EAAE;AAAA,MAC3D;AAEA,UAAI,CAAC,QAAQ,iBAAiB,SAAS,YAAY,GAAG;AACpD,yBAAiB,UAAU;AAC3B,mBAAW;AACX,wBAAgB,IAAI;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { isEqual } from 'lodash-es';\nimport { useRef, useState } from 'react';\n\n/**\n * Hook that checks if the initially loaded fonts were updated.\n * Used to trigger remeasuring in the DataTable (autoWidth) and TextEllipsis once all fonts are loaded.\n *\n * @param callback - optionally pass a function to be executed once when the fonts were updated\n * @returns boolean whether the fonts have changed\n * @internal\n */\nexport function useFontsUpdated(callback?: () => void): boolean {\n const [fontsUpdated, setFontsUpdated] = useState(false);\n const prevFontFamilies = useRef<string[]>([]);\n const fontFamilies: string[] = [];\n const firstRender = useRef(true);\n\n if (document.fonts) {\n // gather the font families that are already loaded\n if (firstRender.current) {\n const loadedFontFamilies: string[] = [];\n document.fonts.forEach((fontFace: FontFace) =>\n loadedFontFamilies.push(`${fontFace.family} ${fontFace.weight}`),\n );\n prevFontFamilies.current = loadedFontFamilies;\n firstRender.current = false;\n }\n\n document.fonts.ready.then((fontFaceSet: FontFaceSet) => {\n fontFaceSet.forEach((fontFace: FontFace) =>\n fontFamilies.push(`${fontFace.family} ${fontFace.weight}`),\n );\n\n if (!isEqual(prevFontFamilies.current, fontFamilies)) {\n prevFontFamilies.current = fontFamilies;\n callback?.();\n setFontsUpdated(true);\n }\n });\n }\n\n return fontsUpdated;\n}\n"],
5
+ "mappings": "AAAA,SAAS,eAAe;AACxB,SAAS,QAAQ,gBAAgB;AAU1B,SAAS,gBAAgB,UAAgC;AAC9D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,mBAAmB,OAAiB,CAAC,CAAC;AAC5C,QAAM,eAAyB,CAAC;AAChC,QAAM,cAAc,OAAO,IAAI;AAE/B,MAAI,SAAS,OAAO;AAElB,QAAI,YAAY,SAAS;AACvB,YAAM,qBAA+B,CAAC;AACtC,eAAS,MAAM;AAAA,QAAQ,CAAC,aACtB,mBAAmB,KAAK,GAAG,SAAS,MAAM,IAAI,SAAS,MAAM,EAAE;AAAA,MACjE;AACA,uBAAiB,UAAU;AAC3B,kBAAY,UAAU;AAAA,IACxB;AAEA,aAAS,MAAM,MAAM,KAAK,CAAC,gBAA6B;AACtD,kBAAY;AAAA,QAAQ,CAAC,aACnB,aAAa,KAAK,GAAG,SAAS,MAAM,IAAI,SAAS,MAAM,EAAE;AAAA,MAC3D;AAEA,UAAI,CAAC,QAAQ,iBAAiB,SAAS,YAAY,GAAG;AACpD,yBAAiB,UAAU;AAC3B,mBAAW;AACX,wBAAgB,IAAI;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,6 @@
1
- import { useCallback } from "react";
1
+ import {
2
+ useCallback
3
+ } from "react";
2
4
  function useMergeRefs(refs) {
3
5
  return useCallback((value) => {
4
6
  for (const ref of refs) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/hooks/useMergeRefs.ts"],
4
- "sourcesContent": ["import React, { useCallback } from 'react';\n\n/**\n * If you have multiple references (e.g. from different hooks) you need to apply to\n * the same element, you can use the `useMergeRefs` hook to combine them into one\n * reference.\n */\nexport function useMergeRefs<T = unknown>(\n refs: Array<\n | React.MutableRefObject<T>\n | React.LegacyRef<T>\n | React.Dispatch<React.SetStateAction<T | null>>\n | undefined\n >,\n): React.RefCallback<T> {\n return useCallback((value) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== undefined && ref !== null) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n }, refs); // eslint-disable-line react-hooks/exhaustive-deps\n}\n"],
5
- "mappings": "AAAA,SAAgB,mBAAmB;AAO5B,SAAS,aACd,MAMsB;AACtB,SAAO,YAAY,CAAC,UAAU;AAC5B,eAAW,OAAO,MAAM;AACtB,UAAI,OAAO,QAAQ,YAAY;AAC7B,YAAI,KAAK;AAAA,MACX,WAAW,QAAQ,UAAa,QAAQ,MAAM;AAC5C,QAAC,IAAyC,UAAU;AAAA,MACtD;AAAA,IACF;AAAA,EACF,GAAG,IAAI;AACT;",
4
+ "sourcesContent": ["import {\n useCallback,\n type MutableRefObject,\n type LegacyRef,\n type SetStateAction,\n type Dispatch,\n type RefCallback,\n} from 'react';\n\n/**\n * If you have multiple references (e.g. from different hooks) you need to apply to\n * the same element, you can use the `useMergeRefs` hook to combine them into one\n * reference.\n */\nexport function useMergeRefs<T = unknown>(\n refs: Array<\n | MutableRefObject<T>\n | LegacyRef<T>\n | Dispatch<SetStateAction<T | null>>\n | undefined\n >,\n): RefCallback<T> {\n return useCallback((value) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== undefined && ref !== null) {\n (ref as MutableRefObject<T | null>).current = value;\n }\n }\n }, refs); // eslint-disable-line react-hooks/exhaustive-deps\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAMK;AAOA,SAAS,aACd,MAMgB;AAChB,SAAO,YAAY,CAAC,UAAU;AAC5B,eAAW,OAAO,MAAM;AACtB,UAAI,OAAO,QAAQ,YAAY;AAC7B,YAAI,KAAK;AAAA,MACX,WAAW,QAAQ,UAAa,QAAQ,MAAM;AAC5C,QAAC,IAAmC,UAAU;AAAA,MAChD;AAAA,IACF;AAAA,EACF,GAAG,IAAI;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
1
- import React, { useCallback, useEffect, useState } from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useState } from "react";
2
3
  import { FocusContext } from "../contexts/FocusContext.js";
3
4
  import { useFocusContext } from "../hooks/useFocusContext.js";
4
5
  import { mergeProps } from "../utils/merge-props.js";
@@ -97,7 +98,7 @@ const FocusProvider = ({ children }) => {
97
98
  tabIndex: -1,
98
99
  "aria-hidden": true
99
100
  } : { inert: void 0, tabIndex: void 0, "aria-hidden": false };
100
- return /* @__PURE__ */ React.createElement(
101
+ return /* @__PURE__ */ jsx(
101
102
  FocusContext.Provider,
102
103
  {
103
104
  value: {
@@ -106,9 +107,9 @@ const FocusProvider = ({ children }) => {
106
107
  setBackgroundInertness,
107
108
  modality
108
109
  })
109
- }
110
- },
111
- /* @__PURE__ */ React.createElement("div", { ...focusProps }, children)
110
+ },
111
+ children: /* @__PURE__ */ jsx("div", { ...focusProps, children })
112
+ }
112
113
  );
113
114
  };
114
115
  FocusProvider["displayName"] = "FocusProvider";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/providers/FocusProvider.tsx"],
4
- "sourcesContent": ["import React, { useCallback, useEffect, useState } from 'react';\n\nimport { FocusContext } from '../contexts/FocusContext.js';\nimport { useFocusContext } from '../hooks/useFocusContext.js';\nimport type { WithChildren } from '../types/with-children.js';\nimport { mergeProps } from '../utils/merge-props.js';\n\n// list of modifier keys commonly used in a mouse or keyboard combination,\n// see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#modifier_keys.\nconst ignoreMap = [\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'FnLock',\n 'Hyper',\n 'Meta', // Command (Mac), in some browsers also Windows-key\n 'NumLock',\n 'OS', // Windows-key\n 'ScrollLock',\n 'Super', // Virtual keyboard key\n 'Symbol',\n 'SymbolLock',\n];\n\n/** Look-up map of all event types and the corresponding modalities. */\nconst eventTypeMap: Record<string, string> = {\n keydown: 'keyboard',\n keyup: 'keyboard',\n mousedown: 'mouse',\n mousemove: 'mouse',\n MSPointerDown: 'pointer',\n MSPointerMove: 'pointer',\n pointerdown: 'pointer',\n pointermove: 'pointer',\n touchstart: 'touch',\n touchend: 'touch',\n wheel: 'wheel',\n};\n\n/**\n * Type defining the modality options for the focus handling.\n * @internal\n */\nexport type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';\n\n/**\n * All navigational keys that should be considered keyboard users,\n * see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#navigation_keys\n */\nconst navigationalKeys = [\n 'Tab',\n 'Esc',\n 'Escape',\n ' ',\n 'ArrowDown',\n 'Down',\n 'ArrowUp',\n 'Up',\n 'ArrowLeft',\n 'Left',\n 'ArrowRight',\n 'Right',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n];\n\n/**\n * Provider that can be reused in components for storing the focus context props.\n * Loosely inspired by [what-input-js](https://github.com/ten1seven/what-input/blob/main/src/scripts/what-input.js).\n * @internal\n */\nexport const FocusProvider = ({ children }: WithChildren) => {\n const [backgroundInertness, setBackgroundInertness] = useState(false);\n const focusContext = useFocusContext();\n const [modality, setModality] = useState<Modality>('unknown');\n\n const setKeyboardInputModality = useCallback((event: KeyboardEvent) => {\n if (ignoreMap.includes(event.key)) {\n setModality('pointer');\n return;\n }\n\n if (!event.target || navigationalKeys.includes(event.key)) {\n setModality('keyboard');\n }\n }, []);\n\n const setMouseInputModality = useCallback((event: MouseEvent) => {\n switch (eventTypeMap[event.type]) {\n case 'touch':\n case 'pen':\n return setModality('touch');\n case 'mouse':\n case 'pointer':\n case 'wheel':\n return setModality('pointer');\n default:\n return 'unknown';\n }\n }, []);\n\n useEffect(() => {\n window.addEventListener('pointerdown', setMouseInputModality);\n // we need to rely on the keydown event (already in the capture phase) here so we don't break usages where the event default behavior is prevented or propagation is stopped,\n // which would otherwise get the wrong, initial, modality (unknown); by using the capture phase, we can ensure we set the modality correctly before the other events occur\n window.addEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.addEventListener('wheel', setMouseInputModality);\n\n return () => {\n window.removeEventListener('pointerdown', setMouseInputModality);\n window.removeEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.removeEventListener('wheel', setMouseInputModality);\n };\n }, [setKeyboardInputModality, setMouseInputModality]);\n\n const focusProps = backgroundInertness\n ? {\n inert: 'true',\n tabIndex: -1,\n 'aria-hidden': true,\n }\n : { inert: undefined, tabIndex: undefined, 'aria-hidden': false };\n\n return (\n <FocusContext.Provider\n value={{\n ...mergeProps(focusContext, {\n backgroundInertness,\n setBackgroundInertness,\n modality,\n }),\n }}\n >\n <div {...focusProps}>{children}</div>\n </FocusContext.Provider>\n );\n};\n\nFocusProvider['displayName'] = 'FocusProvider';\n"],
5
- "mappings": "AAAA,OAAO,SAAS,aAAa,WAAW,gBAAgB;AAExD,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,SAAS,kBAAkB;AAI3B,MAAM,YAAY;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AACF;AAGA,MAAM,eAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW;AAAA,EACX,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AACT;AAYA,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,MAAM,gBAAgB,CAAC,EAAE,SAAS,MAAoB;AAC3D,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AACpE,QAAM,eAAe,gBAAgB;AACrC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,SAAS;AAE5D,QAAM,2BAA2B,YAAY,CAAC,UAAyB;AACrE,QAAI,UAAU,SAAS,MAAM,GAAG,GAAG;AACjC,kBAAY,SAAS;AACrB;AAAA,IACF;AAEA,QAAI,CAAC,MAAM,UAAU,iBAAiB,SAAS,MAAM,GAAG,GAAG;AACzD,kBAAY,UAAU;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,wBAAwB,YAAY,CAAC,UAAsB;AAC/D,YAAQ,aAAa,MAAM,IAAI,GAAG;AAAA,MAChC,KAAK;AAAA,MACL,KAAK;AACH,eAAO,YAAY,OAAO;AAAA,MAC5B,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,YAAY,SAAS;AAAA,MAC9B;AACE,eAAO;AAAA,IACX;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,WAAO,iBAAiB,eAAe,qBAAqB;AAG5D,WAAO,iBAAiB,WAAW,0BAA0B;AAAA,MAC3D,SAAS;AAAA,IACX,CAAC;AACD,WAAO,iBAAiB,SAAS,qBAAqB;AAEtD,WAAO,MAAM;AACX,aAAO,oBAAoB,eAAe,qBAAqB;AAC/D,aAAO,oBAAoB,WAAW,0BAA0B;AAAA,QAC9D,SAAS;AAAA,MACX,CAAC;AACD,aAAO,oBAAoB,SAAS,qBAAqB;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,0BAA0B,qBAAqB,CAAC;AAEpD,QAAM,aAAa,sBACf;AAAA,IACE,OAAO;AAAA,IACP,UAAU;AAAA,IACV,eAAe;AAAA,EACjB,IACA,EAAE,OAAO,QAAW,UAAU,QAAW,eAAe,MAAM;AAElE,SACE;AAAA,IAAC,aAAa;AAAA,IAAb;AAAA,MACC,OAAO;AAAA,QACL,GAAG,WAAW,cAAc;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,IAEA,oCAAC,SAAK,GAAG,cAAa,QAAS;AAAA,EACjC;AAEJ;AAEA,cAAc,aAAa,IAAI;",
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react';\n\nimport { FocusContext } from '../contexts/FocusContext.js';\nimport { useFocusContext } from '../hooks/useFocusContext.js';\nimport type { WithChildren } from '../types/with-children.js';\nimport { mergeProps } from '../utils/merge-props.js';\n\n// list of modifier keys commonly used in a mouse or keyboard combination,\n// see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#modifier_keys.\nconst ignoreMap = [\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'FnLock',\n 'Hyper',\n 'Meta', // Command (Mac), in some browsers also Windows-key\n 'NumLock',\n 'OS', // Windows-key\n 'ScrollLock',\n 'Super', // Virtual keyboard key\n 'Symbol',\n 'SymbolLock',\n];\n\n/** Look-up map of all event types and the corresponding modalities. */\nconst eventTypeMap: Record<string, string> = {\n keydown: 'keyboard',\n keyup: 'keyboard',\n mousedown: 'mouse',\n mousemove: 'mouse',\n MSPointerDown: 'pointer',\n MSPointerMove: 'pointer',\n pointerdown: 'pointer',\n pointermove: 'pointer',\n touchstart: 'touch',\n touchend: 'touch',\n wheel: 'wheel',\n};\n\n/**\n * Type defining the modality options for the focus handling.\n * @internal\n */\nexport type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';\n\n/**\n * All navigational keys that should be considered keyboard users,\n * see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#navigation_keys\n */\nconst navigationalKeys = [\n 'Tab',\n 'Esc',\n 'Escape',\n ' ',\n 'ArrowDown',\n 'Down',\n 'ArrowUp',\n 'Up',\n 'ArrowLeft',\n 'Left',\n 'ArrowRight',\n 'Right',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n];\n\n/**\n * Provider that can be reused in components for storing the focus context props.\n * Loosely inspired by [what-input-js](https://github.com/ten1seven/what-input/blob/main/src/scripts/what-input.js).\n * @internal\n */\nexport const FocusProvider = ({ children }: WithChildren) => {\n const [backgroundInertness, setBackgroundInertness] = useState(false);\n const focusContext = useFocusContext();\n const [modality, setModality] = useState<Modality>('unknown');\n\n const setKeyboardInputModality = useCallback((event: KeyboardEvent) => {\n if (ignoreMap.includes(event.key)) {\n setModality('pointer');\n return;\n }\n\n if (!event.target || navigationalKeys.includes(event.key)) {\n setModality('keyboard');\n }\n }, []);\n\n const setMouseInputModality = useCallback((event: MouseEvent) => {\n switch (eventTypeMap[event.type]) {\n case 'touch':\n case 'pen':\n return setModality('touch');\n case 'mouse':\n case 'pointer':\n case 'wheel':\n return setModality('pointer');\n default:\n return 'unknown';\n }\n }, []);\n\n useEffect(() => {\n window.addEventListener('pointerdown', setMouseInputModality);\n // we need to rely on the keydown event (already in the capture phase) here so we don't break usages where the event default behavior is prevented or propagation is stopped,\n // which would otherwise get the wrong, initial, modality (unknown); by using the capture phase, we can ensure we set the modality correctly before the other events occur\n window.addEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.addEventListener('wheel', setMouseInputModality);\n\n return () => {\n window.removeEventListener('pointerdown', setMouseInputModality);\n window.removeEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.removeEventListener('wheel', setMouseInputModality);\n };\n }, [setKeyboardInputModality, setMouseInputModality]);\n\n const focusProps = backgroundInertness\n ? {\n inert: 'true',\n tabIndex: -1,\n 'aria-hidden': true,\n }\n : { inert: undefined, tabIndex: undefined, 'aria-hidden': false };\n\n return (\n <FocusContext.Provider\n value={{\n ...mergeProps(focusContext, {\n backgroundInertness,\n setBackgroundInertness,\n modality,\n }),\n }}\n >\n <div {...focusProps}>{children}</div>\n </FocusContext.Provider>\n );\n};\n\nFocusProvider['displayName'] = 'FocusProvider';\n"],
5
+ "mappings": "AA6IM;AA7IN,SAAS,aAAa,WAAW,gBAAgB;AAEjD,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,SAAS,kBAAkB;AAI3B,MAAM,YAAY;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AACF;AAGA,MAAM,eAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW;AAAA,EACX,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AACT;AAYA,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,MAAM,gBAAgB,CAAC,EAAE,SAAS,MAAoB;AAC3D,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AACpE,QAAM,eAAe,gBAAgB;AACrC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,SAAS;AAE5D,QAAM,2BAA2B,YAAY,CAAC,UAAyB;AACrE,QAAI,UAAU,SAAS,MAAM,GAAG,GAAG;AACjC,kBAAY,SAAS;AACrB;AAAA,IACF;AAEA,QAAI,CAAC,MAAM,UAAU,iBAAiB,SAAS,MAAM,GAAG,GAAG;AACzD,kBAAY,UAAU;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,wBAAwB,YAAY,CAAC,UAAsB;AAC/D,YAAQ,aAAa,MAAM,IAAI,GAAG;AAAA,MAChC,KAAK;AAAA,MACL,KAAK;AACH,eAAO,YAAY,OAAO;AAAA,MAC5B,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,YAAY,SAAS;AAAA,MAC9B;AACE,eAAO;AAAA,IACX;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,WAAO,iBAAiB,eAAe,qBAAqB;AAG5D,WAAO,iBAAiB,WAAW,0BAA0B;AAAA,MAC3D,SAAS;AAAA,IACX,CAAC;AACD,WAAO,iBAAiB,SAAS,qBAAqB;AAEtD,WAAO,MAAM;AACX,aAAO,oBAAoB,eAAe,qBAAqB;AAC/D,aAAO,oBAAoB,WAAW,0BAA0B;AAAA,QAC9D,SAAS;AAAA,MACX,CAAC;AACD,aAAO,oBAAoB,SAAS,qBAAqB;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,0BAA0B,qBAAqB,CAAC;AAEpD,QAAM,aAAa,sBACf;AAAA,IACE,OAAO;AAAA,IACP,UAAU;AAAA,IACV,eAAe;AAAA,EACjB,IACA,EAAE,OAAO,QAAW,UAAU,QAAW,eAAe,MAAM;AAElE,SACE;AAAA,IAAC,aAAa;AAAA,IAAb;AAAA,MACC,OAAO;AAAA,QACL,GAAG,WAAW,cAAc;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MAEA,8BAAC,SAAK,GAAG,YAAa,UAAS;AAAA;AAAA,EACjC;AAEJ;AAEA,cAAc,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,75 +1,75 @@
1
- ._z2r50s3-1-5-1 {
1
+ ._z2r50s3-1-6-0 {
2
2
  outline: none;
3
3
  }
4
- ._z2r50s3-1-5-1:focus-visible {
4
+ ._z2r50s3-1-6-0:focus-visible {
5
5
  outline: none;
6
6
  }
7
- ._z2r50s4-1-5-1 {
7
+ ._z2r50s4-1-6-0 {
8
8
  border-radius: var(--dt-borders-radius-field-subdued, 4px);
9
- box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-5-1);
10
- background-color: var(--_z2r50s2-1-5-1);
11
- }
12
- ._z2r50s5-1-5-1._z2r50s5-1-5-1 {
13
- box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-5-1), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-5-1);
14
- }
15
- ._z2r50s6-1-5-1 {
16
- --_z2r50s0-1-5-1: var(--dt-colors-border-neutral-accent, #545587);
17
- --_z2r50s1-1-5-1: var(--dt-colors-border-neutral-default, #d2d3e1);
18
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
19
- }
20
- ._z2r50s7-1-5-1 {
21
- --_z2r50s0-1-5-1: var(--dt-colors-border-primary-accent, #454cc9);
22
- --_z2r50s1-1-5-1: var(--dt-colors-border-primary-default, #ccd3f3);
23
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
24
- }
25
- ._z2r50s8-1-5-1 {
26
- --_z2r50s0-1-5-1: var(--dt-colors-border-success-accent, #2c6360);
27
- --_z2r50s1-1-5-1: var(--dt-colors-border-success-default, #cad6d7);
28
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-success-emphasized, #d4dddf);
29
- }
30
- ._z2r50s9-1-5-1 {
31
- --_z2r50s0-1-5-1: var(--dt-colors-border-warning-accent, #805100);
32
- --_z2r50s1-1-5-1: var(--dt-colors-border-warning-default, #f4e5d5);
33
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
34
- }
35
- ._z2r50sa-1-5-1 {
36
- --_z2r50s0-1-5-1: var(--dt-colors-border-critical-accent, #b80031);
37
- --_z2r50s1-1-5-1: var(--dt-colors-border-critical-default, #f1cdcf);
38
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
39
- }
40
- ._z2r50sb-1-5-1:focus-within {
9
+ box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-0);
10
+ background-color: var(--_z2r50s2-1-6-0);
11
+ }
12
+ ._z2r50s5-1-6-0._z2r50s5-1-6-0 {
13
+ box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-6-0);
14
+ }
15
+ ._z2r50s6-1-6-0 {
16
+ --_z2r50s0-1-6-0: var(--dt-colors-border-neutral-accent, #545587);
17
+ --_z2r50s1-1-6-0: var(--dt-colors-border-neutral-default, #d2d3e1);
18
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
19
+ }
20
+ ._z2r50s7-1-6-0 {
21
+ --_z2r50s0-1-6-0: var(--dt-colors-border-primary-accent, #454cc9);
22
+ --_z2r50s1-1-6-0: var(--dt-colors-border-primary-default, #ccd3f3);
23
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
24
+ }
25
+ ._z2r50s8-1-6-0 {
26
+ --_z2r50s0-1-6-0: var(--dt-colors-border-success-accent, #2c6360);
27
+ --_z2r50s1-1-6-0: var(--dt-colors-border-success-default, #cad6d7);
28
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-success-emphasized, #d4dddf);
29
+ }
30
+ ._z2r50s9-1-6-0 {
31
+ --_z2r50s0-1-6-0: var(--dt-colors-border-warning-accent, #805100);
32
+ --_z2r50s1-1-6-0: var(--dt-colors-border-warning-default, #f4e5d5);
33
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
34
+ }
35
+ ._z2r50sa-1-6-0 {
36
+ --_z2r50s0-1-6-0: var(--dt-colors-border-critical-accent, #b80031);
37
+ --_z2r50s1-1-6-0: var(--dt-colors-border-critical-default, #f1cdcf);
38
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
39
+ }
40
+ ._z2r50sb-1-6-0:focus-within {
41
41
  outline: none;
42
42
  }
43
- ._z2r50sc-1-5-1:focus-within {
43
+ ._z2r50sc-1-6-0:focus-within {
44
44
  border-radius: var(--dt-borders-radius-field-subdued, 4px);
45
- box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-5-1);
46
- background-color: var(--_z2r50s2-1-5-1);
47
- }
48
- ._z2r50sd-1-5-1:focus-within {
49
- box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-5-1), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-5-1);
50
- }
51
- ._z2r50se-1-5-1 {
52
- --_z2r50s0-1-5-1: var(--dt-colors-border-neutral-accent, #545587);
53
- --_z2r50s1-1-5-1: var(--dt-colors-border-neutral-default, #d2d3e1);
54
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
55
- }
56
- ._z2r50sf-1-5-1 {
57
- --_z2r50s0-1-5-1: var(--dt-colors-border-primary-accent, #454cc9);
58
- --_z2r50s1-1-5-1: var(--dt-colors-border-primary-default, #ccd3f3);
59
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
60
- }
61
- ._z2r50sg-1-5-1 {
62
- --_z2r50s0-1-5-1: var(--dt-colors-border-success-accent, #2c6360);
63
- --_z2r50s1-1-5-1: var(--dt-colors-border-success-default, #cad6d7);
64
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-success-emphasized, #d4dddf);
65
- }
66
- ._z2r50sh-1-5-1 {
67
- --_z2r50s0-1-5-1: var(--dt-colors-border-warning-accent, #805100);
68
- --_z2r50s1-1-5-1: var(--dt-colors-border-warning-default, #f4e5d5);
69
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
70
- }
71
- ._z2r50si-1-5-1 {
72
- --_z2r50s0-1-5-1: var(--dt-colors-border-critical-accent, #b80031);
73
- --_z2r50s1-1-5-1: var(--dt-colors-border-critical-default, #f1cdcf);
74
- --_z2r50s2-1-5-1: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
45
+ box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-0);
46
+ background-color: var(--_z2r50s2-1-6-0);
47
+ }
48
+ ._z2r50sd-1-6-0:focus-within {
49
+ box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-6-0);
50
+ }
51
+ ._z2r50se-1-6-0 {
52
+ --_z2r50s0-1-6-0: var(--dt-colors-border-neutral-accent, #545587);
53
+ --_z2r50s1-1-6-0: var(--dt-colors-border-neutral-default, #d2d3e1);
54
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
55
+ }
56
+ ._z2r50sf-1-6-0 {
57
+ --_z2r50s0-1-6-0: var(--dt-colors-border-primary-accent, #454cc9);
58
+ --_z2r50s1-1-6-0: var(--dt-colors-border-primary-default, #ccd3f3);
59
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
60
+ }
61
+ ._z2r50sg-1-6-0 {
62
+ --_z2r50s0-1-6-0: var(--dt-colors-border-success-accent, #2c6360);
63
+ --_z2r50s1-1-6-0: var(--dt-colors-border-success-default, #cad6d7);
64
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-success-emphasized, #d4dddf);
65
+ }
66
+ ._z2r50sh-1-6-0 {
67
+ --_z2r50s0-1-6-0: var(--dt-colors-border-warning-accent, #805100);
68
+ --_z2r50s1-1-6-0: var(--dt-colors-border-warning-default, #f4e5d5);
69
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
70
+ }
71
+ ._z2r50si-1-6-0 {
72
+ --_z2r50s0-1-6-0: var(--dt-colors-border-critical-accent, #b80031);
73
+ --_z2r50s1-1-6-0: var(--dt-colors-border-critical-default, #f1cdcf);
74
+ --_z2r50s2-1-6-0: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
75
75
  }
@@ -1,7 +1,7 @@
1
1
  import "./focusRing.css";
2
2
  import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
- var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-5-1", variantClassNames: { minimal: { true: "_z2r50s4-1-5-1", false: "_z2r50s5-1-5-1" }, variant: { neutral: "_z2r50s6-1-5-1", primary: "_z2r50s7-1-5-1", success: "_z2r50s8-1-5-1", warning: "_z2r50s9-1-5-1", critical: "_z2r50sa-1-5-1" } }, defaultVariants: {}, compoundVariants: [] });
4
- var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-5-1", variantClassNames: { minimal: { true: "_z2r50sc-1-5-1", false: "_z2r50sd-1-5-1" }, variant: { neutral: "_z2r50se-1-5-1", primary: "_z2r50sf-1-5-1", success: "_z2r50sg-1-5-1", warning: "_z2r50sh-1-5-1", critical: "_z2r50si-1-5-1" } }, defaultVariants: {}, compoundVariants: [] });
3
+ var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-6-0", variantClassNames: { minimal: { true: "_z2r50s4-1-6-0", false: "_z2r50s5-1-6-0" }, variant: { neutral: "_z2r50s6-1-6-0", primary: "_z2r50s7-1-6-0", success: "_z2r50s8-1-6-0", warning: "_z2r50s9-1-6-0", critical: "_z2r50sa-1-6-0" } }, defaultVariants: {}, compoundVariants: [] });
4
+ var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-6-0", variantClassNames: { minimal: { true: "_z2r50sc-1-6-0", false: "_z2r50sd-1-6-0" }, variant: { neutral: "_z2r50se-1-6-0", primary: "_z2r50sf-1-6-0", success: "_z2r50sg-1-6-0", warning: "_z2r50sh-1-6-0", critical: "_z2r50si-1-6-0" } }, defaultVariants: {}, compoundVariants: [] });
5
5
  export {
6
6
  focusRingCSS,
7
7
  focusRingFocusWithinCSS
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/styles/focusRing.css.ts"],
4
- "sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-5-1',variantClassNames:{minimal:{true:'_z2r50s4-1-5-1',false:'_z2r50s5-1-5-1'},variant:{neutral:'_z2r50s6-1-5-1',primary:'_z2r50s7-1-5-1',success:'_z2r50s8-1-5-1',warning:'_z2r50s9-1-5-1',critical:'_z2r50sa-1-5-1'}},defaultVariants:{},compoundVariants:[]});\nexport var focusRingFocusWithinCSS = _7a468({defaultClassName:'_z2r50sb-1-5-1',variantClassNames:{minimal:{true:'_z2r50sc-1-5-1',false:'_z2r50sd-1-5-1'},variant:{neutral:'_z2r50se-1-5-1',primary:'_z2r50sf-1-5-1',success:'_z2r50sg-1-5-1',warning:'_z2r50sh-1-5-1',critical:'_z2r50si-1-5-1'}},defaultVariants:{},compoundVariants:[]});"],
4
+ "sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-6-0',variantClassNames:{minimal:{true:'_z2r50s4-1-6-0',false:'_z2r50s5-1-6-0'},variant:{neutral:'_z2r50s6-1-6-0',primary:'_z2r50s7-1-6-0',success:'_z2r50s8-1-6-0',warning:'_z2r50s9-1-6-0',critical:'_z2r50sa-1-6-0'}},defaultVariants:{},compoundVariants:[]});\nexport var focusRingFocusWithinCSS = _7a468({defaultClassName:'_z2r50sb-1-6-0',variantClassNames:{minimal:{true:'_z2r50sc-1-6-0',false:'_z2r50sd-1-6-0'},variant:{neutral:'_z2r50se-1-6-0',primary:'_z2r50sf-1-6-0',success:'_z2r50sg-1-6-0',warning:'_z2r50sh-1-6-0',critical:'_z2r50si-1-6-0'}},defaultVariants:{},compoundVariants:[]});"],
5
5
  "mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,kBAAiB,OAAM,iBAAgB,GAAE,SAAQ,EAAC,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,UAAS,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACvT,IAAI,0BAA0B,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,kBAAiB,OAAM,iBAAgB,GAAE,SAAQ,EAAC,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,UAAS,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/styles/useFocusRing.ts"],
4
- "sourcesContent": ["import {\n FocusEvent,\n FocusEventHandler,\n useCallback,\n useEffect,\n useState,\n} from 'react';\n\nimport { focusRingCSS, focusRingFocusWithinCSS } from './focusRing.sty.js';\nimport { _useFocusContext } from '../index.js';\n\n/** @internal */\nexport type VariantType =\n | 'neutral'\n | 'primary'\n | 'success'\n | 'warning'\n | 'critical';\n/** @internal */\nexport type UseFocusRingProps = {\n /**\n * A minimal focus outline is available for smaller content elements like links. This variant is applied when set to true.\n * @defaultValue false\n */\n isMinimal?: boolean;\n\n /**\n * Whether or not the modality should be ignored, so that the focus ring is also present if users clicks the element (not just by tabbing to it).\n * @defaultValue false\n */\n ignoreModality?: boolean;\n\n /**\n * The styling variant of the element.\n * @defaultValue neutral\n */\n variant?: VariantType;\n\n /**\n * Apply the focus ring styling if an embedded element gains the focus\n */\n focusWithin?: boolean;\n\n /**\n * Whether the element is disabled. If disabled changes to true, the focus will be removed.\n */\n disabled?: boolean;\n};\n\nexport type FocusRingProps = {\n /** The focus styles that depend on modality. */\n focusClassName: string;\n /** Focus handlers used to manage the focus state. Must be applied to the element that receives the focus.*/\n focusProps: {\n onFocus: (e: FocusEvent) => void;\n onBlur: (e: FocusEvent) => void;\n };\n /** Whether or not the element got focus via keyboard. */\n isFocusVisible: boolean;\n};\n\n/**\n * Custom hook used to determine focus styling depending on modality.\n * Returns the css classes (vanilla) that can be applied to the component in order to show the correct focus outline.\n * @internal\n */\nexport function useFocusRing(props: UseFocusRingProps = {}): FocusRingProps {\n const {\n variant = 'neutral',\n ignoreModality = false,\n isMinimal = false,\n focusWithin = false,\n disabled = false,\n } = props;\n const [isFocused, setIsFocused] = useState(false);\n const { modality } = _useFocusContext();\n\n useEffect(() => {\n if (disabled) {\n setIsFocused(false);\n }\n }, [disabled]);\n\n const onBlur = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is unfocused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(false);\n }\n }, []);\n\n const onFocus = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is focused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(true);\n }\n }, []);\n\n const focusProps = {\n onFocus,\n onBlur,\n };\n\n if (\n ((ignoreModality || modality === 'keyboard') && isFocused) ||\n focusWithin\n ) {\n if (isMinimal) {\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: true, variant })\n : focusRingCSS({ minimal: true, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: false, variant })\n : focusRingCSS({ minimal: false, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin ? focusRingFocusWithinCSS() : focusRingCSS(),\n isFocusVisible: false,\n focusProps,\n };\n}\n"],
4
+ "sourcesContent": ["import {\n type FocusEvent as ReactFocusEvent,\n type FocusEventHandler,\n useCallback,\n useEffect,\n useState,\n} from 'react';\n\nimport { focusRingCSS, focusRingFocusWithinCSS } from './focusRing.sty.js';\nimport { _useFocusContext } from '../index.js';\n\n/** @internal */\nexport type VariantType =\n | 'neutral'\n | 'primary'\n | 'success'\n | 'warning'\n | 'critical';\n/** @internal */\nexport type UseFocusRingProps = {\n /**\n * A minimal focus outline is available for smaller content elements like links. This variant is applied when set to true.\n * @defaultValue false\n */\n isMinimal?: boolean;\n\n /**\n * Whether or not the modality should be ignored, so that the focus ring is also present if users clicks the element (not just by tabbing to it).\n * @defaultValue false\n */\n ignoreModality?: boolean;\n\n /**\n * The styling variant of the element.\n * @defaultValue neutral\n */\n variant?: VariantType;\n\n /**\n * Apply the focus ring styling if an embedded element gains the focus\n */\n focusWithin?: boolean;\n\n /**\n * Whether the element is disabled. If disabled changes to true, the focus will be removed.\n */\n disabled?: boolean;\n};\n\nexport type FocusRingProps = {\n /** The focus styles that depend on modality. */\n focusClassName: string;\n /** Focus handlers used to manage the focus state. Must be applied to the element that receives the focus.*/\n focusProps: {\n onFocus: (e: ReactFocusEvent) => void;\n onBlur: (e: ReactFocusEvent) => void;\n };\n /** Whether or not the element got focus via keyboard. */\n isFocusVisible: boolean;\n};\n\n/**\n * Custom hook used to determine focus styling depending on modality.\n * Returns the css classes (vanilla) that can be applied to the component in order to show the correct focus outline.\n * @internal\n */\nexport function useFocusRing(props: UseFocusRingProps = {}): FocusRingProps {\n const {\n variant = 'neutral',\n ignoreModality = false,\n isMinimal = false,\n focusWithin = false,\n disabled = false,\n } = props;\n const [isFocused, setIsFocused] = useState(false);\n const { modality } = _useFocusContext();\n\n useEffect(() => {\n if (disabled) {\n setIsFocused(false);\n }\n }, [disabled]);\n\n const onBlur = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is unfocused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(false);\n }\n }, []);\n\n const onFocus = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is focused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(true);\n }\n }, []);\n\n const focusProps = {\n onFocus,\n onBlur,\n };\n\n if (\n ((ignoreModality || modality === 'keyboard') && isFocused) ||\n focusWithin\n ) {\n if (isMinimal) {\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: true, variant })\n : focusRingCSS({ minimal: true, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: false, variant })\n : focusRingCSS({ minimal: false, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin ? focusRingFocusWithinCSS() : focusRingCSS(),\n isFocusVisible: false,\n focusProps,\n };\n}\n"],
5
5
  "mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,cAAc,+BAA+B;AACtD,SAAS,wBAAwB;AAyD1B,SAAS,aAAa,QAA2B,CAAC,GAAmB;AAC1E,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,WAAW;AAAA,EACb,IAAI;AACJ,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,EAAE,SAAS,IAAI,iBAAiB;AAEtC,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,QAAM,SAAS,YAA+B,CAAC,MAAM;AAEnD,QAAI,EAAE,kBAAkB,EAAE,QAAQ;AAChC,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,YAA+B,CAAC,MAAM;AAEpD,QAAI,EAAE,kBAAkB,EAAE,QAAQ;AAChC,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,EACF;AAEA,OACI,kBAAkB,aAAa,eAAe,aAChD,aACA;AACA,QAAI,WAAW;AACb,aAAO;AAAA,QACL,gBAAgB,cACZ,wBAAwB,EAAE,SAAS,MAAM,QAAQ,CAAC,IAClD,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC;AAAA,QAC3C,gBAAgB,CAAC;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,MACL,gBAAgB,cACZ,wBAAwB,EAAE,SAAS,OAAO,QAAQ,CAAC,IACnD,aAAa,EAAE,SAAS,OAAO,QAAQ,CAAC;AAAA,MAC5C,gBAAgB,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,gBAAgB,cAAc,wBAAwB,IAAI,aAAa;AAAA,IACvE,gBAAgB;AAAA,IAChB;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,8 @@
1
- import React from "react";
1
+ import { Children } from "react";
2
2
  import { FormattedMessage } from "react-intl";
3
3
  import { isElement } from "react-is";
4
4
  function isStringChildren(children) {
5
- const childrenArray = React.Children.toArray(children);
5
+ const childrenArray = Children.toArray(children);
6
6
  if (!childrenArray.some(isElement)) {
7
7
  return true;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/utils/_is-string-children.ts"],
4
- "sourcesContent": ["import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { isElement } from 'react-is';\n\n/**\n * Returns whether children only consist of text nodes.\n * @internal\n */\nexport function isStringChildren(\n children: React.ReactNode,\n): children is string {\n const childrenArray = React.Children.toArray(children);\n\n if (!childrenArray.some(isElement)) {\n return true; // All children are strings\n }\n\n return childrenArray.every(\n (child) =>\n !isElement(child) ||\n (isElement(child) && child.type && child.type === FormattedMessage),\n );\n}\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAMnB,SAAS,iBACd,UACoB;AACpB,QAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;AAErD,MAAI,CAAC,cAAc,KAAK,SAAS,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,cAAc;AAAA,IACnB,CAAC,UACC,CAAC,UAAU,KAAK,KACf,UAAU,KAAK,KAAK,MAAM,QAAQ,MAAM,SAAS;AAAA,EACtD;AACF;",
4
+ "sourcesContent": ["import { type ReactNode, Children } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { isElement } from 'react-is';\n\n/**\n * Returns whether children only consist of text nodes.\n * @internal\n */\nexport function isStringChildren(children: ReactNode): children is string {\n const childrenArray = Children.toArray(children);\n\n if (!childrenArray.some(isElement)) {\n return true; // All children are strings\n }\n\n return childrenArray.every(\n (child) =>\n !isElement(child) ||\n (isElement(child) && child.type && child.type === FormattedMessage),\n );\n}\n"],
5
+ "mappings": "AAAA,SAAyB,gBAAgB;AACzC,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAMnB,SAAS,iBAAiB,UAAyC;AACxE,QAAM,gBAAgB,SAAS,QAAQ,QAAQ;AAE/C,MAAI,CAAC,cAAc,KAAK,SAAS,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,cAAc;AAAA,IACnB,CAAC,UACC,CAAC,UAAU,KAAK,KACf,UAAU,KAAK,KAAK,MAAM,QAAQ,MAAM,SAAS;AAAA,EACtD;AACF;",
6
6
  "names": []
7
7
  }