@dynatrace/strato-components 0.85.10 → 0.85.32

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 (250) hide show
  1. package/buttons/button/Button.css +1 -0
  2. package/buttons/button/Button.d.ts +4 -4
  3. package/buttons/button/Label.d.ts +1 -1
  4. package/buttons/button/Prefix.d.ts +1 -1
  5. package/buttons/button/Suffix.d.ts +1 -1
  6. package/buttons/index.d.ts +2 -0
  7. package/buttons/index.js +2 -0
  8. package/buttons/intent-button/IntentButton.d.ts +44 -0
  9. package/buttons/intent-button/IntentButton.js +102 -0
  10. package/buttons/intent-button/useIntentButton.d.ts +12 -0
  11. package/buttons/intent-button/useIntentButton.js +72 -0
  12. package/content/index.d.ts +4 -0
  13. package/content/index.js +5 -1
  14. package/content/progress/ProgressBar.d.ts +4 -4
  15. package/content/progress/ProgressBarIcon.d.ts +1 -1
  16. package/content/progress/ProgressBarLabel.d.ts +1 -1
  17. package/content/progress/ProgressBarValue.d.ts +1 -1
  18. package/content/progress/ProgressCircle.d.ts +1 -1
  19. package/content/skeleton/Skeleton.css +33 -0
  20. package/content/skeleton/Skeleton.d.ts +30 -0
  21. package/content/skeleton/Skeleton.js +60 -0
  22. package/content/skeleton/Skeleton.sty.d.ts +10 -0
  23. package/content/skeleton/Skeleton.sty.js +25 -0
  24. package/content/skeleton/SkeletonText.d.ts +24 -0
  25. package/content/skeleton/SkeletonText.js +84 -0
  26. package/core/components/app-root/AppRoot.d.ts +2 -2
  27. package/core/components/focus-scope/FocusScope.d.ts +1 -1
  28. package/core/contexts/FocusContext.d.ts +1 -2
  29. package/core/providers/FocusProvider.d.ts +2 -3
  30. package/esm/buttons/button/Button.css +1 -0
  31. package/esm/buttons/index.js +2 -0
  32. package/esm/buttons/index.js.map +2 -2
  33. package/esm/buttons/intent-button/IntentButton.js +74 -0
  34. package/esm/buttons/intent-button/IntentButton.js.map +7 -0
  35. package/esm/buttons/intent-button/useIntentButton.js +57 -0
  36. package/esm/buttons/intent-button/useIntentButton.js.map +7 -0
  37. package/esm/content/index.js +5 -1
  38. package/esm/content/index.js.map +2 -2
  39. package/esm/content/skeleton/Skeleton.css +33 -0
  40. package/esm/content/skeleton/Skeleton.js +32 -0
  41. package/esm/content/skeleton/Skeleton.js.map +7 -0
  42. package/esm/content/skeleton/Skeleton.sty.js +7 -0
  43. package/esm/content/skeleton/Skeleton.sty.js.map +7 -0
  44. package/esm/content/skeleton/SkeletonText.js +56 -0
  45. package/esm/content/skeleton/SkeletonText.js.map +7 -0
  46. package/esm/core/components/focus-scope/FocusScope.js.map +1 -1
  47. package/esm/core/contexts/FocusContext.js.map +2 -2
  48. package/esm/core/providers/FocusProvider.js.map +2 -2
  49. package/esm/layouts/{Divider → divider}/Divider.css +5 -5
  50. package/esm/layouts/{Divider → divider}/Divider.js.map +1 -1
  51. package/esm/layouts/{Divider → divider}/Divider.sty.js +1 -1
  52. package/esm/layouts/{Divider → divider}/Divider.sty.js.map +2 -2
  53. package/esm/layouts/helpers/spacingToCss.js +13 -0
  54. package/esm/layouts/helpers/spacingToCss.js.map +7 -0
  55. package/esm/layouts/hooks/useBreakpoint.js +44 -0
  56. package/esm/layouts/hooks/useBreakpoint.js.map +7 -0
  57. package/esm/layouts/hooks/useLayoutSizeProps.js +15 -0
  58. package/esm/layouts/hooks/useLayoutSizeProps.js.map +7 -0
  59. package/esm/layouts/hooks/useLayoutStyles.js +105 -0
  60. package/esm/layouts/hooks/useLayoutStyles.js.map +7 -0
  61. package/esm/layouts/hooks/useMarginProps.js +55 -0
  62. package/esm/layouts/hooks/useMarginProps.js.map +7 -0
  63. package/esm/layouts/hooks/usePaddingProps.js +59 -0
  64. package/esm/layouts/hooks/usePaddingProps.js.map +7 -0
  65. package/esm/layouts/index.js +8 -2
  66. package/esm/layouts/index.js.map +2 -2
  67. package/esm/layouts/surface/Surface.css +95 -0
  68. package/esm/layouts/surface/Surface.js +84 -0
  69. package/esm/layouts/surface/Surface.js.map +7 -0
  70. package/esm/layouts/surface/Surface.sty.js +10 -0
  71. package/esm/layouts/surface/Surface.sty.js.map +7 -0
  72. package/esm/layouts/surface/variables.sty.js +5 -0
  73. package/esm/layouts/surface/variables.sty.js.map +7 -0
  74. package/esm/layouts/types/layout.types.js +1 -0
  75. package/esm/layouts/types/layout.types.js.map +7 -0
  76. package/esm/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  77. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js.map +2 -2
  78. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  79. package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js.map +2 -2
  80. package/{typography/Code → esm/typography/code}/Code.css +1 -1
  81. package/esm/typography/{Code → code}/Code.js.map +2 -2
  82. package/esm/typography/{Code → code}/Code.sty.js +1 -1
  83. package/esm/typography/{Code → code}/Code.sty.js.map +2 -2
  84. package/esm/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  85. package/esm/typography/{Emphasis → emphasis}/Emphasis.js.map +2 -2
  86. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  87. package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js.map +2 -2
  88. package/{typography/ExternalLink → esm/typography/external-link}/ExternalLink.css +6 -6
  89. package/esm/typography/{ExternalLink → external-link}/ExternalLink.js.map +2 -2
  90. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  91. package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js.map +2 -2
  92. package/esm/typography/{Heading → heading}/Heading.css +7 -7
  93. package/esm/typography/heading/Heading.js.map +7 -0
  94. package/esm/typography/heading/Heading.sty.js +7 -0
  95. package/esm/typography/{Heading → heading}/Heading.sty.js.map +2 -2
  96. package/esm/typography/{Highlight → highlight}/Highlight.css +1 -1
  97. package/esm/typography/{Highlight → highlight}/Highlight.js.map +2 -2
  98. package/esm/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  99. package/esm/typography/{Highlight → highlight}/Highlight.sty.js.map +2 -2
  100. package/esm/typography/index.js +13 -13
  101. package/esm/typography/index.js.map +1 -1
  102. package/{typography/Link → esm/typography/link}/Link.css +4 -4
  103. package/esm/typography/{Link → link}/Link.js +1 -1
  104. package/esm/typography/link/Link.js.map +7 -0
  105. package/esm/typography/{Link → link}/Link.sty.js +1 -1
  106. package/esm/typography/{Link → link}/Link.sty.js.map +2 -2
  107. package/esm/typography/{List → list}/List.css +4 -4
  108. package/esm/typography/{List → list}/List.js +1 -1
  109. package/esm/typography/{List → list}/List.js.map +2 -2
  110. package/esm/typography/{List → list}/List.sty.js +2 -2
  111. package/esm/typography/{List → list}/List.sty.js.map +2 -2
  112. package/esm/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  113. package/esm/typography/{Paragraph → paragraph}/Paragraph.js.map +2 -2
  114. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  115. package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js.map +2 -2
  116. package/{typography/Strikethrough → esm/typography/strikethrough}/Strikethrough.css +1 -1
  117. package/esm/typography/strikethrough/Strikethrough.js.map +7 -0
  118. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  119. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js.map +2 -2
  120. package/{typography/Strong → esm/typography/strong}/Strong.css +1 -1
  121. package/esm/typography/{Strong → strong}/Strong.js.map +2 -2
  122. package/esm/typography/{Strong → strong}/Strong.sty.js +1 -1
  123. package/esm/typography/{Strong → strong}/Strong.sty.js.map +2 -2
  124. package/{typography/Text → esm/typography/text}/Text.css +3 -3
  125. package/esm/typography/text/Text.js.map +7 -0
  126. package/esm/typography/{Text → text}/Text.sty.js +1 -1
  127. package/esm/typography/{Text → text}/Text.sty.js.map +2 -2
  128. package/{typography/TextEllipsis → esm/typography/text-ellipsis}/TextEllipsis.css +4 -4
  129. package/esm/typography/text-ellipsis/TextEllipsis.js.map +7 -0
  130. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +7 -0
  131. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js.map +2 -2
  132. package/lang/en.json +6 -0
  133. package/lang/ja.json +24 -0
  134. package/lang/uncompiled/en.json +4 -0
  135. package/lang/uncompiled/ja.json +14 -1
  136. package/layouts/{Divider → divider}/Divider.css +5 -5
  137. package/layouts/{Divider → divider}/Divider.d.ts +1 -1
  138. package/layouts/{Divider → divider}/Divider.sty.js +1 -1
  139. package/layouts/helpers/spacingToCss.d.ts +6 -0
  140. package/layouts/helpers/spacingToCss.js +29 -0
  141. package/layouts/hooks/useBreakpoint.d.ts +27 -0
  142. package/layouts/hooks/useBreakpoint.js +62 -0
  143. package/layouts/hooks/useLayoutSizeProps.d.ts +6 -0
  144. package/layouts/hooks/useLayoutSizeProps.js +33 -0
  145. package/layouts/hooks/useLayoutStyles.d.ts +7 -0
  146. package/layouts/hooks/useLayoutStyles.js +123 -0
  147. package/layouts/hooks/useMarginProps.d.ts +7 -0
  148. package/layouts/hooks/useMarginProps.js +73 -0
  149. package/layouts/hooks/usePaddingProps.d.ts +7 -0
  150. package/layouts/hooks/usePaddingProps.js +77 -0
  151. package/layouts/index.d.ts +7 -2
  152. package/layouts/index.js +8 -2
  153. package/layouts/surface/Surface.css +95 -0
  154. package/layouts/surface/Surface.d.ts +46 -0
  155. package/layouts/surface/Surface.js +110 -0
  156. package/layouts/surface/Surface.sty.d.ts +43 -0
  157. package/layouts/surface/Surface.sty.js +28 -0
  158. package/layouts/surface/variables.sty.d.ts +1 -0
  159. package/layouts/surface/variables.sty.js +23 -0
  160. package/layouts/types/layout.types.d.ts +64 -0
  161. package/layouts/types/layout.types.js +15 -0
  162. package/package.json +11 -4
  163. package/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
  164. package/typography/{BlockQuote → block-quote}/Blockquote.d.ts +2 -2
  165. package/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
  166. package/{esm/typography/Code → typography/code}/Code.css +1 -1
  167. package/typography/{Code → code}/Code.d.ts +2 -2
  168. package/typography/{Code → code}/Code.sty.js +1 -1
  169. package/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
  170. package/typography/{Emphasis → emphasis}/Emphasis.d.ts +2 -2
  171. package/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
  172. package/{esm/typography/ExternalLink → typography/external-link}/ExternalLink.css +6 -6
  173. package/typography/{ExternalLink → external-link}/ExternalLink.d.ts +2 -2
  174. package/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
  175. package/typography/{Heading → heading}/Heading.css +7 -7
  176. package/typography/{Heading → heading}/Heading.d.ts +4 -3
  177. package/typography/{Heading → heading}/Heading.sty.js +1 -1
  178. package/typography/{Highlight → highlight}/Highlight.css +1 -1
  179. package/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
  180. package/typography/index.d.ts +26 -26
  181. package/typography/index.js +13 -13
  182. package/{esm/typography/Link → typography/link}/Link.css +4 -4
  183. package/typography/{Link → link}/Link.js +1 -1
  184. package/typography/{Link → link}/Link.sty.js +1 -1
  185. package/typography/{List → list}/List.css +4 -4
  186. package/typography/{List → list}/List.d.ts +2 -2
  187. package/typography/{List → list}/List.js +1 -1
  188. package/typography/{List → list}/List.sty.js +2 -2
  189. package/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
  190. package/typography/{Paragraph → paragraph}/Paragraph.d.ts +2 -2
  191. package/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
  192. package/{esm/typography/Strikethrough → typography/strikethrough}/Strikethrough.css +1 -1
  193. package/typography/{Strikethrough → strikethrough}/Strikethrough.d.ts +3 -3
  194. package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
  195. package/{esm/typography/Strong → typography/strong}/Strong.css +1 -1
  196. package/typography/{Strong → strong}/Strong.d.ts +2 -2
  197. package/typography/{Strong → strong}/Strong.sty.js +1 -1
  198. package/{esm/typography/Text → typography/text}/Text.css +3 -3
  199. package/typography/{Text → text}/Text.d.ts +5 -3
  200. package/typography/{Text → text}/Text.sty.js +1 -1
  201. package/{esm/typography/TextEllipsis → typography/text-ellipsis}/TextEllipsis.css +4 -4
  202. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.d.ts +4 -4
  203. package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js +1 -1
  204. package/esm/typography/Heading/Heading.js.map +0 -7
  205. package/esm/typography/Heading/Heading.sty.js +0 -7
  206. package/esm/typography/Link/Link.js.map +0 -7
  207. package/esm/typography/Strikethrough/Strikethrough.js.map +0 -7
  208. package/esm/typography/Text/Text.js.map +0 -7
  209. package/esm/typography/TextEllipsis/TextEllipsis.js.map +0 -7
  210. package/esm/typography/TextEllipsis/TextEllipsis.sty.js +0 -7
  211. package/esm/layouts/{Divider → divider}/Divider.js +0 -0
  212. package/esm/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  213. package/esm/typography/{Code → code}/Code.js +0 -0
  214. package/esm/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  215. package/esm/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  216. package/esm/typography/{Heading → heading}/Heading.js +0 -0
  217. package/esm/typography/{Highlight → highlight}/Highlight.js +0 -0
  218. package/esm/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  219. package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  220. package/esm/typography/{Strong → strong}/Strong.js +0 -0
  221. package/esm/typography/{Text → text}/Text.js +0 -0
  222. package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  223. package/layouts/{Divider → divider}/Divider.js +0 -0
  224. package/layouts/{Divider → divider}/Divider.sty.d.ts +0 -0
  225. package/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
  226. package/typography/{BlockQuote → block-quote}/Blockquote.sty.d.ts +0 -0
  227. package/typography/{Code → code}/Code.js +0 -0
  228. package/typography/{Code → code}/Code.sty.d.ts +0 -0
  229. package/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
  230. package/typography/{Emphasis → emphasis}/Emphasis.sty.d.ts +0 -0
  231. package/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
  232. package/typography/{ExternalLink → external-link}/ExternalLink.sty.d.ts +0 -0
  233. package/typography/{Heading → heading}/Heading.js +0 -0
  234. package/typography/{Heading → heading}/Heading.sty.d.ts +0 -0
  235. package/typography/{Highlight → highlight}/Highlight.d.ts +1 -1
  236. package/typography/{Highlight → highlight}/Highlight.js +0 -0
  237. package/typography/{Highlight → highlight}/Highlight.sty.d.ts +0 -0
  238. package/typography/{Link → link}/Link.d.ts +1 -1
  239. /package/typography/{Link → link}/Link.sty.d.ts +0 -0
  240. /package/typography/{List → list}/List.sty.d.ts +0 -0
  241. /package/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
  242. /package/typography/{Paragraph → paragraph}/Paragraph.sty.d.ts +0 -0
  243. /package/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
  244. /package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.d.ts +0 -0
  245. /package/typography/{Strong → strong}/Strong.js +0 -0
  246. /package/typography/{Strong → strong}/Strong.sty.d.ts +0 -0
  247. /package/typography/{Text → text}/Text.js +0 -0
  248. /package/typography/{Text → text}/Text.sty.d.ts +0 -0
  249. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
  250. /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.d.ts +0 -0
@@ -17,11 +17,11 @@ export interface FocusScopeProps extends WithChildren {
17
17
  contain?: boolean;
18
18
  }
19
19
  /**
20
- * @internal
21
20
  * The `FocusScope` helps you manage the focus when opening any overlay. If you
22
21
  * want to create a custom overlay, you can wrap the content of your overlay in the
23
22
  * `FocusScope` to help you make the overlay accessible and handle focus
24
23
  * appropriately.
24
+ * @internal
25
25
  */
26
26
  export declare const FocusScope: {
27
27
  (props: FocusScopeProps): React.JSX.Element;
@@ -9,11 +9,10 @@ export type FocusContextProps = {
9
9
  setBackgroundInertness: (value: boolean) => void;
10
10
  };
11
11
  /**
12
- * @internal
13
- *
14
12
  * This context keeps all information needed for proper focus management.
15
13
  * @param modality - currently used pointer device
16
14
  * @param backgroundInertness - if the background (behind overlays) is currently inert (inactive)
17
15
  * @param setBackgroundInertness - updates the backgrounds active status
16
+ * @internal
18
17
  */
19
18
  export declare const FocusContext: import("react").Context<FocusContextProps>;
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { WithChildren } from '../types/with-children.js';
3
3
  /**
4
- * @internal
5
4
  * Type defining the modality options for the focus handling.
5
+ * @internal
6
6
  */
7
7
  export type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';
8
8
  /**
9
- * @internal
10
- *
11
9
  * Provider that can be reused in components for storing the focus context props.
12
10
  * Loosely inspired by [what-input-js](https://github.com/ten1seven/what-input/blob/main/src/scripts/what-input.js).
11
+ * @internal
13
12
  */
14
13
  export declare const FocusProvider: {
15
14
  ({ children }: WithChildren): React.JSX.Element;
@@ -14,6 +14,7 @@
14
14
  max-width: 100%;
15
15
  height: max-content;
16
16
  cursor: pointer;
17
+ box-sizing: border-box;
17
18
  border-color: transparent;
18
19
  border-style: solid;
19
20
  border-width: 0;
@@ -4,8 +4,10 @@ import {
4
4
  isVirtualPointerEvent,
5
5
  isVirtualClick
6
6
  } from "./button/utils/is-virtual-event.js";
7
+ import { IntentButton } from "./intent-button/IntentButton.js";
7
8
  export {
8
9
  Button,
10
+ IntentButton,
9
11
  focusWithoutScrolling as _focusWithoutScrolling,
10
12
  isVirtualClick as _isVirtualClick,
11
13
  isVirtualPointerEvent as _isVirtualPointerEvent
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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';\n"],
5
- "mappings": "AAAA,SAAS,cAAc;AAUvB,SAAkC,6BAA8B;AAChE;AAAA,EAC2B;AAAA,EACP;AAAA,OACb;",
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
6
  "names": []
7
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
  }
@@ -0,0 +1,33 @@
1
+ @keyframes Skeleton_skeletonAnimationKeyframes__1a1ozfd0 {
2
+ 0% {
3
+ transform: translateX(-100%) scaleX(0);
4
+ }
5
+ 100% {
6
+ transform: translateX(100%) scaleX(1.5);
7
+ }
8
+ }
9
+ .Skeleton_skeletonPlaceholderCSS__1a1ozfd1 {
10
+ position: relative;
11
+ overflow: hidden;
12
+ background-color: var(--dt-colors-background-field-neutral-disabled, #dadbe780);
13
+ }
14
+ .Skeleton_skeletonPlaceholderCSS__1a1ozfd1:after {
15
+ content: "";
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ background-color: var(--dt-colors-background-field-neutral-disabled, #dadbe780);
22
+ animation-iteration-count: infinite;
23
+ transform-origin: left center;
24
+ animation-name: Skeleton_skeletonAnimationKeyframes__1a1ozfd0;
25
+ animation-duration: var(--dt-timings-slow-gentle, 800ms);
26
+ animation-timing-function: var(--dt-easings-fast-in-slow-out, cubic-bezier(0.4, 0, 0.2, 1));
27
+ }
28
+ .Skeleton_skeletonPlaceholderCSS_variant_default__1a1ozfd2 {
29
+ border-radius: var(--dt-borders-radius-container-subdued, 8px);
30
+ }
31
+ .Skeleton_skeletonPlaceholderCSS_variant_rounded__1a1ozfd3 {
32
+ border-radius: 9999px;
33
+ }
@@ -0,0 +1,32 @@
1
+ import clsx from "clsx";
2
+ import React, { forwardRef } from "react";
3
+ import { skeletonPlaceholderCSS } from "./Skeleton.sty.js";
4
+ const Skeleton = forwardRef(
5
+ (props, forwardedRef) => {
6
+ const {
7
+ children,
8
+ variant = "default",
9
+ width = "100%",
10
+ height = "100%",
11
+ className: consumerClassName,
12
+ style: consumerStyle,
13
+ "data-testid": dataTestId,
14
+ ...remainingProps
15
+ } = props;
16
+ return /* @__PURE__ */ React.createElement(
17
+ "div",
18
+ {
19
+ "data-testid": dataTestId,
20
+ ref: forwardedRef,
21
+ className: clsx(skeletonPlaceholderCSS({ variant }), consumerClassName),
22
+ style: { width, height, ...consumerStyle },
23
+ ...remainingProps
24
+ },
25
+ children
26
+ );
27
+ }
28
+ );
29
+ export {
30
+ Skeleton
31
+ };
32
+ //# sourceMappingURL=Skeleton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/content/skeleton/Skeleton.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { CSSProperties, forwardRef } from 'react';\n\nimport { skeletonPlaceholderCSS } from './Skeleton.sty.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\n\n/**\n * Accepted properties for Skeleton\n * @public\n */\nexport interface SkeletonProps extends WithChildren, StylingProps, DataTestId {\n /**\n * Defines the shape of the Skeleton.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'rounded';\n /**\n * Width of the Skeleton placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Height of the Skeleton placeholder.\n * @defaultValue 100%\n */\n height?: CSSProperties['height'];\n}\n\n/**\n * The `Skeleton` component renders a colored block with an animated background, indicating that something is loading.\n * @public\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n (props, forwardedRef) => {\n const {\n children,\n variant = 'default',\n width = '100%',\n height = '100%',\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonProps = props;\n\n return (\n <div\n data-testid={dataTestId}\n ref={forwardedRef}\n className={clsx(skeletonPlaceholderCSS({ variant }), consumerClassName)}\n style={{ width: width, height: height, ...consumerStyle }}\n {...remainingProps}\n >\n {children}\n </div>\n );\n },\n);\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAwB,kBAAkB;AAEjD,SAAS,8BAA8B;AA+BhC,MAAM,WAAW;AAAA,EACtB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,GAAG;AAAA,IACL,IAAmB;AAEnB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,KAAK;AAAA,QACL,WAAW,KAAK,uBAAuB,EAAE,QAAQ,CAAC,GAAG,iBAAiB;AAAA,QACtE,OAAO,EAAE,OAAc,QAAgB,GAAG,cAAc;AAAA,QACvD,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import "./Skeleton.css";
2
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ var skeletonPlaceholderCSS = _7a468({ defaultClassName: "Skeleton_skeletonPlaceholderCSS__1a1ozfd1", variantClassNames: { variant: { "default": "Skeleton_skeletonPlaceholderCSS_variant_default__1a1ozfd2", rounded: "Skeleton_skeletonPlaceholderCSS_variant_rounded__1a1ozfd3" } }, defaultVariants: {}, compoundVariants: [] });
4
+ export {
5
+ skeletonPlaceholderCSS
6
+ };
7
+ //# sourceMappingURL=Skeleton.sty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/content/skeleton/Skeleton.css.ts"],
4
+ "sourcesContent": ["import './Skeleton.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var skeletonPlaceholderCSS = _7a468({defaultClassName:'Skeleton_skeletonPlaceholderCSS__1a1ozfd1',variantClassNames:{variant:{'default':'Skeleton_skeletonPlaceholderCSS_variant_default__1a1ozfd2',rounded:'Skeleton_skeletonPlaceholderCSS_variant_rounded__1a1ozfd3'}},defaultVariants:{},compoundVariants:[]});"],
5
+ "mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,yBAAyB,OAAO,EAAC,kBAAiB,6CAA4C,mBAAkB,EAAC,SAAQ,EAAC,WAAU,6DAA4D,SAAQ,4DAA2D,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
1
+ import React, { forwardRef } from "react";
2
+ import { Skeleton } from "./Skeleton.js";
3
+ import { Flex } from "../../layouts/flex/Flex.js";
4
+ const SkeletonText = forwardRef(
5
+ (props, forwardedRef) => {
6
+ const {
7
+ width = "100%",
8
+ lines = 3,
9
+ className: consumerClassName,
10
+ style: consumerStyle,
11
+ "data-testid": dataTestId,
12
+ ...remainingProps
13
+ } = props;
14
+ const getSkeletonLinesMargin = (line, lines2) => {
15
+ if (lines2 === 1) {
16
+ return 0;
17
+ }
18
+ return (line + 2) % 3 * 12;
19
+ };
20
+ const getSkeletonLines = (lines2) => {
21
+ const render = [];
22
+ for (let line = 0; line < lines2; line++) {
23
+ const width2 = `calc(100% - ${getSkeletonLinesMargin(line, lines2)}px)`;
24
+ render.push(
25
+ /* @__PURE__ */ React.createElement(
26
+ Skeleton,
27
+ {
28
+ key: `${lines2}-${line}`,
29
+ width: width2,
30
+ height: "12px"
31
+ }
32
+ )
33
+ );
34
+ }
35
+ return render;
36
+ };
37
+ return /* @__PURE__ */ React.createElement(
38
+ Flex,
39
+ {
40
+ "data-testid": dataTestId,
41
+ ref: forwardedRef,
42
+ flexDirection: "column",
43
+ gap: 8,
44
+ paddingY: 4,
45
+ className: consumerClassName,
46
+ style: { width, ...consumerStyle },
47
+ ...remainingProps
48
+ },
49
+ getSkeletonLines(lines)
50
+ );
51
+ }
52
+ );
53
+ export {
54
+ SkeletonText
55
+ };
56
+ //# sourceMappingURL=SkeletonText.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/content/skeleton/SkeletonText.tsx"],
4
+ "sourcesContent": ["import React, { type CSSProperties, forwardRef } from 'react';\n\nimport { Skeleton } from './Skeleton.js';\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/**\n * Accepted properties for SkeletonText\n * @public\n */\nexport interface SkeletonTextProps extends StylingProps, DataTestId {\n /**\n * Width of the SkeletonText placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Number of Lines of the SkeletonText placeholder.\n * @defaultValue 3\n */\n lines?: number;\n}\n\n/**\n * The `SkeletonText` component renders a specified number of placeholder boxes for lines of text with an animated background.\n * @public\n */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n (props, forwardedRef) => {\n const {\n width = '100%',\n lines = 3,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonTextProps = props;\n\n const getSkeletonLinesMargin = (line: number, lines: number) => {\n if (lines === 1) {\n // do not add any margin for single-line SkeletonTexts\n return 0;\n }\n return ((line + 2) % 3) * 12;\n };\n\n const getSkeletonLines = (lines: number) => {\n const render: React.ReactNode[] = [];\n for (let line = 0; line < lines; line++) {\n const width = `calc(100% - ${getSkeletonLinesMargin(line, lines)}px)`;\n render.push(\n <Skeleton\n // key needs to be individual every time we render, because it resets the animation with every child drawn again.\n key={`${lines}-${line}`}\n width={width}\n height=\"12px\"\n />,\n );\n }\n return render;\n };\n\n return (\n <Flex\n data-testid={dataTestId}\n ref={forwardedRef}\n flexDirection=\"column\"\n gap={8}\n paddingY={4}\n className={consumerClassName}\n style={{ width: width, ...consumerStyle }}\n {...remainingProps}\n >\n {getSkeletonLines(lines)}\n </Flex>\n );\n },\n);\n"],
5
+ "mappings": "AAAA,OAAO,SAA6B,kBAAkB;AAEtD,SAAS,gBAAgB;AAGzB,SAAS,YAAY;AAuBd,MAAM,eAAe;AAAA,EAC1B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,GAAG;AAAA,IACL,IAAuB;AAEvB,UAAM,yBAAyB,CAAC,MAAcA,WAAkB;AAC9D,UAAIA,WAAU,GAAG;AAEf,eAAO;AAAA,MACT;AACA,cAAS,OAAO,KAAK,IAAK;AAAA,IAC5B;AAEA,UAAM,mBAAmB,CAACA,WAAkB;AAC1C,YAAM,SAA4B,CAAC;AACnC,eAAS,OAAO,GAAG,OAAOA,QAAO,QAAQ;AACvC,cAAMC,SAAQ,eAAe,uBAAuB,MAAMD,MAAK,CAAC;AAChE,eAAO;AAAA,UACL;AAAA,YAAC;AAAA;AAAA,cAEC,KAAK,GAAGA,MAAK,IAAI,IAAI;AAAA,cACrB,OAAOC;AAAA,cACP,QAAO;AAAA;AAAA,UACT;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,KAAK;AAAA,QACL,eAAc;AAAA,QACd,KAAK;AAAA,QACL,UAAU;AAAA,QACV,WAAW;AAAA,QACX,OAAO,EAAE,OAAc,GAAG,cAAc;AAAA,QACvC,GAAG;AAAA;AAAA,MAEH,iBAAiB,KAAK;AAAA,IACzB;AAAA,EAEJ;AACF;",
6
+ "names": ["lines", "width"]
7
+ }
@@ -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 * @internal\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 * @internal\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 */\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"],
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 * @internal\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 * @internal\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
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;",
6
6
  "names": ["triggerElementCopy"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/core/contexts/FocusContext.tsx"],
4
- "sourcesContent": ["import { createContext } from 'react';\n\nimport type { Modality } from '../providers/FocusProvider.js';\n\n/**\n * Defines the contents of the FocusContext.\n * @internal\n */\nexport type FocusContextProps = {\n backgroundInertness?: boolean;\n modality: Modality;\n setBackgroundInertness: (value: boolean) => void;\n};\n\n/**\n * @internal\n *\n * This context keeps all information needed for proper focus management.\n * @param modality - currently used pointer device\n * @param backgroundInertness - if the background (behind overlays) is currently inert (inactive)\n * @param setBackgroundInertness - updates the backgrounds active status\n */\nexport const FocusContext = createContext<FocusContextProps>({\n modality: 'unknown',\n backgroundInertness: undefined,\n setBackgroundInertness: (value) => null,\n});\n"],
5
- "mappings": "AAAA,SAAS,qBAAqB;AAsBvB,MAAM,eAAe,cAAiC;AAAA,EAC3D,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,wBAAwB,CAAC,UAAU;AACrC,CAAC;",
4
+ "sourcesContent": ["import { createContext } from 'react';\n\nimport type { Modality } from '../providers/FocusProvider.js';\n\n/**\n * Defines the contents of the FocusContext.\n * @internal\n */\nexport type FocusContextProps = {\n backgroundInertness?: boolean;\n modality: Modality;\n setBackgroundInertness: (value: boolean) => void;\n};\n\n/**\n * This context keeps all information needed for proper focus management.\n * @param modality - currently used pointer device\n * @param backgroundInertness - if the background (behind overlays) is currently inert (inactive)\n * @param setBackgroundInertness - updates the backgrounds active status\n * @internal\n */\nexport const FocusContext = createContext<FocusContextProps>({\n modality: 'unknown',\n backgroundInertness: undefined,\n setBackgroundInertness: (value) => null,\n});\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAqBvB,MAAM,eAAe,cAAiC;AAAA,EAC3D,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,wBAAwB,CAAC,UAAU;AACrC,CAAC;",
6
6
  "names": []
7
7
  }
@@ -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 * @internal\n * Type defining the modality options for the focus handling.\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 * @internal\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 */\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;AAQO,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 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;",
6
6
  "names": []
7
7
  }
@@ -1,21 +1,21 @@
1
- .Divider_dividerCSS__1ljcfp90 {
1
+ .Divider_dividerCSS__1thxv8m0 {
2
2
  border: none;
3
3
  margin: 0;
4
4
  overflow-wrap: break-word;
5
5
  background-color: var(--vars_borderColor__k096v42);
6
6
  }
7
- .Divider_dividerCSS_orientation_horizontal__1ljcfp91 {
7
+ .Divider_dividerCSS_orientation_horizontal__1thxv8m1 {
8
8
  width: 100%;
9
9
  height: var(--dt-borders-width-default, 1px);
10
10
  }
11
- .Divider_dividerCSS_orientation_vertical__1ljcfp92 {
11
+ .Divider_dividerCSS_orientation_vertical__1thxv8m2 {
12
12
  width: var(--dt-borders-width-default, 1px);
13
13
  height: 100%;
14
14
  }
15
- .Divider_dividerCSS_compound_0__1ljcfp95 {
15
+ .Divider_dividerCSS_compound_0__1thxv8m5 {
16
16
  flex-shrink: 0;
17
17
  }
18
- .Divider_dividerCSS_compound_1__1ljcfp96 {
18
+ .Divider_dividerCSS_compound_1__1thxv8m6 {
19
19
  flex-shrink: 0;
20
20
  width: var(--dt-borders-width-default, 1px);
21
21
  height: auto;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/layouts/Divider/Divider.tsx"],
3
+ "sources": ["../../../../src/layouts/divider/Divider.tsx"],
4
4
  "sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { dividerCSS } from './Divider.sty.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { colorUtilsCSS } from '../../core/utils/colorUtils.sty.js';\n\n// #region Typings\n\n/** @public\n * Divider component props.\n */\nexport interface DividerProps extends StylingProps, DataTestId {\n /**\n * Orientation of the Divider component.\n * @defaultValue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Control the HTML tag used for rendering the Divider.\n * @defaultValue 'div'\n */\n as?: 'hr' | 'div';\n /**\n * Indicate whether the Divider is used inside a Flex component to apply the right styling.\n * If set to false, make sure to have an explicit width/height style set on a parent HTML tag.\n * @defaultValue true\n */\n flexItem?: boolean;\n /**\n * The color of the Divider.\n * @defaultValue 'neutral'\n */\n color?: 'primary' | 'neutral' | 'success' | 'warning' | 'critical';\n /**\n * The visual style of the Divider.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'accent';\n}\n// #endregion\n\n/**\n * The `Divider` component visually separates groups of content.\n * @public\n */\nexport const Divider = /* @__PURE__ */ forwardRef<\n HTMLDivElement | HTMLHRElement,\n DividerProps\n>((props, ref) => {\n const {\n orientation = 'horizontal',\n flexItem = true,\n as = 'div',\n color = 'neutral',\n variant = 'default',\n 'data-testid': dataTestId,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n } = props;\n\n const DividerTag = as;\n\n return (\n <DividerTag\n role=\"separator\"\n aria-orientation={orientation === 'vertical' ? orientation : undefined}\n // @ts-expect-error ref can't be div and hr here\n ref={ref}\n data-testid={dataTestId}\n className={clsx(\n colorUtilsCSS({ color, variant }),\n dividerCSS({ orientation, flexItem }),\n consumerClassName,\n )}\n style={consumerStyle}\n {...remainingProps}\n />\n );\n});\n\n(Divider as typeof Divider & { displayName: string }).displayName = 'Divider';\n"],
5
5
  "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,kBAAkB;AAG3B,SAAS,qBAAqB;AAyCvB,MAAM,UAA0B,2BAGrC,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,WAAW;AAAA,IACX,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,eAAe;AAAA,IACf,WAAW;AAAA,IACX,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,aAAa;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,oBAAkB,gBAAgB,aAAa,cAAc;AAAA,MAE7D;AAAA,MACA,eAAa;AAAA,MACb,WAAW;AAAA,QACT,cAAc,EAAE,OAAO,QAAQ,CAAC;AAAA,QAChC,WAAW,EAAE,aAAa,SAAS,CAAC;AAAA,QACpC;AAAA,MACF;AAAA,MACA,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAEA,QAAqD,cAAc;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  import "../../core/utils/colorUtils.css";
2
2
  import "./Divider.css";
3
3
  import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
4
- var dividerCSS = _7a468({ defaultClassName: "Divider_dividerCSS__1ljcfp90", variantClassNames: { orientation: { horizontal: "Divider_dividerCSS_orientation_horizontal__1ljcfp91", vertical: "Divider_dividerCSS_orientation_vertical__1ljcfp92" }, flexItem: { true: "Divider_dividerCSS_flexItem_true__1ljcfp93", false: "Divider_dividerCSS_flexItem_false__1ljcfp94" } }, defaultVariants: {}, compoundVariants: [[{ orientation: "horizontal", flexItem: false }, "Divider_dividerCSS_compound_0__1ljcfp95"], [{ orientation: "vertical", flexItem: true }, "Divider_dividerCSS_compound_1__1ljcfp96"]] });
4
+ var dividerCSS = _7a468({ defaultClassName: "Divider_dividerCSS__1thxv8m0", variantClassNames: { orientation: { horizontal: "Divider_dividerCSS_orientation_horizontal__1thxv8m1", vertical: "Divider_dividerCSS_orientation_vertical__1thxv8m2" }, flexItem: { true: "Divider_dividerCSS_flexItem_true__1thxv8m3", false: "Divider_dividerCSS_flexItem_false__1thxv8m4" } }, defaultVariants: {}, compoundVariants: [[{ orientation: "horizontal", flexItem: false }, "Divider_dividerCSS_compound_0__1thxv8m5"], [{ orientation: "vertical", flexItem: true }, "Divider_dividerCSS_compound_1__1thxv8m6"]] });
5
5
  export {
6
6
  dividerCSS
7
7
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/layouts/Divider/Divider.css.ts"],
4
- "sourcesContent": ["import '../../core/utils/colorUtils.css';\nimport './Divider.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var dividerCSS = _7a468({defaultClassName:'Divider_dividerCSS__1ljcfp90',variantClassNames:{orientation:{horizontal:'Divider_dividerCSS_orientation_horizontal__1ljcfp91',vertical:'Divider_dividerCSS_orientation_vertical__1ljcfp92'},flexItem:{true:'Divider_dividerCSS_flexItem_true__1ljcfp93',false:'Divider_dividerCSS_flexItem_false__1ljcfp94'}},defaultVariants:{},compoundVariants:[[{orientation:'horizontal',flexItem:false},'Divider_dividerCSS_compound_0__1ljcfp95'],[{orientation:'vertical',flexItem:true},'Divider_dividerCSS_compound_1__1ljcfp96']]});"],
3
+ "sources": ["../../../../src/layouts/divider/Divider.css.ts"],
4
+ "sourcesContent": ["import '../../core/utils/colorUtils.css';\nimport './Divider.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var dividerCSS = _7a468({defaultClassName:'Divider_dividerCSS__1thxv8m0',variantClassNames:{orientation:{horizontal:'Divider_dividerCSS_orientation_horizontal__1thxv8m1',vertical:'Divider_dividerCSS_orientation_vertical__1thxv8m2'},flexItem:{true:'Divider_dividerCSS_flexItem_true__1thxv8m3',false:'Divider_dividerCSS_flexItem_false__1thxv8m4'}},defaultVariants:{},compoundVariants:[[{orientation:'horizontal',flexItem:false},'Divider_dividerCSS_compound_0__1thxv8m5'],[{orientation:'vertical',flexItem:true},'Divider_dividerCSS_compound_1__1thxv8m6']]});"],
5
5
  "mappings": "AAAA,OAAO;AACP,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,aAAa,OAAO,EAAC,kBAAiB,gCAA+B,mBAAkB,EAAC,aAAY,EAAC,YAAW,uDAAsD,UAAS,oDAAmD,GAAE,UAAS,EAAC,MAAK,8CAA6C,OAAM,8CAA6C,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,CAAC,EAAC,aAAY,cAAa,UAAS,MAAK,GAAE,yCAAyC,GAAE,CAAC,EAAC,aAAY,YAAW,UAAS,KAAI,GAAE,yCAAyC,CAAC,EAAC,CAAC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,13 @@
1
+ import {
2
+ marginProperties
3
+ } from "../../styles/sprinkle-properties.js";
4
+ const spacingToCss = (spacingToken) => {
5
+ if (spacingToken === void 0) {
6
+ return void 0;
7
+ }
8
+ return marginProperties[spacingToken];
9
+ };
10
+ export {
11
+ spacingToCss
12
+ };
13
+ //# sourceMappingURL=spacingToCss.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/layouts/helpers/spacingToCss.ts"],
4
+ "sourcesContent": ["import {\n type MarginProperties,\n marginProperties,\n} from '../../styles/sprinkle-properties.js';\n\n/**\n * Converts a spacing token to its corresponding CSS value.\n * @internal\n */\nexport const spacingToCss = (\n spacingToken: MarginProperties | undefined,\n): number | string | undefined => {\n if (spacingToken === undefined) {\n return undefined;\n }\n return marginProperties[spacingToken];\n};\n"],
5
+ "mappings": "AAAA;AAAA,EAEE;AAAA,OACK;AAMA,MAAM,eAAe,CAC1B,iBACgC;AAChC,MAAI,iBAAiB,QAAW;AAC9B,WAAO;AAAA,EACT;AACA,SAAO,iBAAiB,YAAY;AACtC;",
6
+ "names": []
7
+ }