@dynatrace/strato-components 1.16.1 → 1.17.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 (234) hide show
  1. package/buttons/button/Button.css +16 -16
  2. package/buttons/button/Button.js +12 -9
  3. package/buttons/button/Button.sty.js +4 -4
  4. package/buttons/intent-button/IntentButton.d.ts +2 -0
  5. package/content/progress/ProgressBar.css +71 -71
  6. package/content/progress/ProgressBar.js +3 -1
  7. package/content/progress/ProgressBar.sty.js +5 -5
  8. package/content/progress/ProgressBarIcon.css +2 -2
  9. package/content/progress/ProgressBarIcon.sty.js +1 -1
  10. package/content/progress/ProgressBarLabel.css +3 -3
  11. package/content/progress/ProgressBarLabel.sty.js +1 -1
  12. package/content/progress/ProgressBarValue.css +5 -5
  13. package/content/progress/ProgressBarValue.sty.js +1 -1
  14. package/content/progress/ProgressCircle.css +40 -40
  15. package/content/progress/ProgressCircle.js +3 -1
  16. package/content/progress/ProgressCircle.sty.js +5 -5
  17. package/content/skeleton/Skeleton.css +7 -7
  18. package/content/skeleton/Skeleton.js +3 -0
  19. package/content/skeleton/Skeleton.sty.js +5 -5
  20. package/content/skeleton/SkeletonText.js +3 -0
  21. package/core/index.d.ts +1 -0
  22. package/core/index.js +2 -0
  23. package/core/styles/focusRing.css +66 -66
  24. package/core/styles/focusRing.sty.d.ts +10 -6
  25. package/core/styles/focusRing.sty.js +2 -2
  26. package/core/styles/focusRingStatic.css +44 -0
  27. package/core/styles/focusRingStatic.sty.d.ts +77 -0
  28. package/core/styles/focusRingStatic.sty.js +26 -0
  29. package/core/styles/useFocusRing.d.ts +7 -6
  30. package/core/styles/useFocusRing.js +13 -13
  31. package/core/utils/colorUtils.css +60 -60
  32. package/core/utils/colorUtils.sty.js +2 -2
  33. package/esm/buttons/button/Button.css +16 -16
  34. package/esm/buttons/button/Button.js +12 -9
  35. package/esm/buttons/button/Button.js.map +2 -2
  36. package/esm/buttons/button/Button.sty.js +4 -4
  37. package/esm/buttons/button/Button.sty.js.map +1 -1
  38. package/esm/buttons/index.js.map +1 -1
  39. package/esm/buttons/intent-button/IntentButton.js.map +2 -2
  40. package/esm/content/progress/ProgressBar.css +71 -71
  41. package/esm/content/progress/ProgressBar.js +3 -1
  42. package/esm/content/progress/ProgressBar.js.map +2 -2
  43. package/esm/content/progress/ProgressBar.sty.js +5 -5
  44. package/esm/content/progress/ProgressBar.sty.js.map +1 -1
  45. package/esm/content/progress/ProgressBarIcon.css +2 -2
  46. package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
  47. package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
  48. package/esm/content/progress/ProgressBarLabel.css +3 -3
  49. package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
  50. package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
  51. package/esm/content/progress/ProgressBarValue.css +5 -5
  52. package/esm/content/progress/ProgressBarValue.sty.js +1 -1
  53. package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
  54. package/esm/content/progress/ProgressCircle.css +40 -40
  55. package/esm/content/progress/ProgressCircle.js +3 -1
  56. package/esm/content/progress/ProgressCircle.js.map +2 -2
  57. package/esm/content/progress/ProgressCircle.sty.js +5 -5
  58. package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
  59. package/esm/content/skeleton/Skeleton.css +7 -7
  60. package/esm/content/skeleton/Skeleton.js +3 -0
  61. package/esm/content/skeleton/Skeleton.js.map +2 -2
  62. package/esm/content/skeleton/Skeleton.sty.js +5 -5
  63. package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
  64. package/esm/content/skeleton/SkeletonText.js +3 -0
  65. package/esm/content/skeleton/SkeletonText.js.map +2 -2
  66. package/esm/core/index.js +4 -0
  67. package/esm/core/index.js.map +2 -2
  68. package/esm/core/styles/focusRing.css +66 -66
  69. package/esm/core/styles/focusRing.sty.js +2 -2
  70. package/esm/core/styles/focusRing.sty.js.map +1 -1
  71. package/esm/core/styles/focusRingStatic.css +44 -0
  72. package/esm/core/styles/focusRingStatic.sty.js +7 -0
  73. package/esm/core/styles/focusRingStatic.sty.js.map +7 -0
  74. package/esm/core/styles/useFocusRing.js +15 -15
  75. package/esm/core/styles/useFocusRing.js.map +2 -2
  76. package/esm/core/utils/colorUtils.css +60 -60
  77. package/esm/core/utils/colorUtils.sty.js +2 -2
  78. package/esm/core/utils/colorUtils.sty.js.map +1 -1
  79. package/esm/layouts/container/Container.css +4 -4
  80. package/esm/layouts/container/Container.sty.js +1 -1
  81. package/esm/layouts/container/Container.sty.js.map +1 -1
  82. package/esm/layouts/divider/Divider.css +6 -6
  83. package/esm/layouts/divider/Divider.sty.js +1 -1
  84. package/esm/layouts/divider/Divider.sty.js.map +1 -1
  85. package/esm/layouts/surface/Surface.css +39 -39
  86. package/esm/layouts/surface/Surface.js +2 -6
  87. package/esm/layouts/surface/Surface.js.map +2 -2
  88. package/esm/layouts/surface/Surface.sty.js +2 -2
  89. package/esm/layouts/surface/Surface.sty.js.map +1 -1
  90. package/esm/layouts/surface/variables.sty.js +1 -1
  91. package/esm/layouts/surface/variables.sty.js.map +1 -1
  92. package/esm/styles/colorUtils.css +60 -60
  93. package/esm/styles/colorUtils.sty.js +2 -2
  94. package/esm/styles/colorUtils.sty.js.map +1 -1
  95. package/esm/styles/container.css +47 -47
  96. package/esm/styles/container.sty.js +2 -2
  97. package/esm/styles/container.sty.js.map +1 -1
  98. package/esm/styles/ellipsis.css +1 -1
  99. package/esm/styles/ellipsis.sty.js +1 -1
  100. package/esm/styles/ellipsis.sty.js.map +1 -1
  101. package/esm/styles/field.css +153 -153
  102. package/esm/styles/field.sty.js +2 -2
  103. package/esm/styles/field.sty.js.map +1 -1
  104. package/esm/styles/sprinkles.css +262 -262
  105. package/esm/styles/sprinkles.sty.js +1 -1
  106. package/esm/styles/sprinkles.sty.js.map +1 -1
  107. package/esm/styles/textStyle.css +8 -8
  108. package/esm/styles/textStyle.sty.js +1 -1
  109. package/esm/styles/textStyle.sty.js.map +1 -1
  110. package/esm/typography/block-quote/Blockquote.css +2 -2
  111. package/esm/typography/block-quote/Blockquote.js +3 -1
  112. package/esm/typography/block-quote/Blockquote.js.map +2 -2
  113. package/esm/typography/block-quote/Blockquote.sty.js +1 -1
  114. package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
  115. package/esm/typography/code/Code.css +1 -1
  116. package/esm/typography/code/Code.js +3 -1
  117. package/esm/typography/code/Code.js.map +2 -2
  118. package/esm/typography/code/Code.sty.js +1 -1
  119. package/esm/typography/code/Code.sty.js.map +1 -1
  120. package/esm/typography/emphasis/Emphasis.css +1 -1
  121. package/esm/typography/emphasis/Emphasis.js +3 -1
  122. package/esm/typography/emphasis/Emphasis.js.map +2 -2
  123. package/esm/typography/emphasis/Emphasis.sty.js +1 -1
  124. package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
  125. package/esm/typography/external-link/ExternalLink.css +8 -5
  126. package/esm/typography/external-link/ExternalLink.js +6 -13
  127. package/esm/typography/external-link/ExternalLink.js.map +2 -2
  128. package/esm/typography/external-link/ExternalLink.sty.js +2 -1
  129. package/esm/typography/external-link/ExternalLink.sty.js.map +2 -2
  130. package/esm/typography/heading/Heading.css +7 -7
  131. package/esm/typography/heading/Heading.js +3 -1
  132. package/esm/typography/heading/Heading.js.map +2 -2
  133. package/esm/typography/heading/Heading.sty.js +1 -1
  134. package/esm/typography/heading/Heading.sty.js.map +1 -1
  135. package/esm/typography/highlight/Highlight.css +2 -2
  136. package/esm/typography/highlight/Highlight.js +3 -1
  137. package/esm/typography/highlight/Highlight.js.map +2 -2
  138. package/esm/typography/highlight/Highlight.sty.js +1 -1
  139. package/esm/typography/highlight/Highlight.sty.js.map +1 -1
  140. package/esm/typography/link/Link.css +6 -3
  141. package/esm/typography/link/Link.js +6 -19
  142. package/esm/typography/link/Link.js.map +2 -2
  143. package/esm/typography/link/Link.sty.js +2 -1
  144. package/esm/typography/link/Link.sty.js.map +2 -2
  145. package/esm/typography/list/List.css +4 -4
  146. package/esm/typography/list/List.js +3 -1
  147. package/esm/typography/list/List.js.map +2 -2
  148. package/esm/typography/list/List.sty.js +2 -2
  149. package/esm/typography/list/List.sty.js.map +1 -1
  150. package/esm/typography/paragraph/Paragraph.css +3 -3
  151. package/esm/typography/paragraph/Paragraph.js +3 -1
  152. package/esm/typography/paragraph/Paragraph.js.map +2 -2
  153. package/esm/typography/paragraph/Paragraph.sty.js +1 -1
  154. package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
  155. package/esm/typography/strikethrough/Strikethrough.css +1 -1
  156. package/esm/typography/strikethrough/Strikethrough.js +3 -1
  157. package/esm/typography/strikethrough/Strikethrough.js.map +2 -2
  158. package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
  159. package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
  160. package/esm/typography/strong/Strong.css +1 -1
  161. package/esm/typography/strong/Strong.js +3 -1
  162. package/esm/typography/strong/Strong.js.map +2 -2
  163. package/esm/typography/strong/Strong.sty.js +1 -1
  164. package/esm/typography/strong/Strong.sty.js.map +1 -1
  165. package/esm/typography/text/Text.css +3 -3
  166. package/esm/typography/text/Text.js +4 -1
  167. package/esm/typography/text/Text.js.map +2 -2
  168. package/esm/typography/text/Text.sty.js +1 -1
  169. package/esm/typography/text/Text.sty.js.map +1 -1
  170. package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
  171. package/esm/typography/text-ellipsis/TextEllipsis.js +8 -1
  172. package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
  173. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
  174. package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
  175. package/layouts/container/Container.css +4 -4
  176. package/layouts/container/Container.sty.js +1 -1
  177. package/layouts/divider/Divider.css +6 -6
  178. package/layouts/divider/Divider.sty.js +1 -1
  179. package/layouts/surface/Surface.css +39 -39
  180. package/layouts/surface/Surface.js +2 -6
  181. package/layouts/surface/Surface.sty.js +2 -2
  182. package/layouts/surface/variables.sty.js +1 -1
  183. package/package.json +3 -3
  184. package/styles/colorUtils.css +60 -60
  185. package/styles/colorUtils.sty.js +2 -2
  186. package/styles/container.css +47 -47
  187. package/styles/container.sty.js +2 -2
  188. package/styles/ellipsis.css +1 -1
  189. package/styles/ellipsis.sty.js +1 -1
  190. package/styles/field.css +153 -153
  191. package/styles/field.sty.js +2 -2
  192. package/styles/sprinkles.css +262 -262
  193. package/styles/sprinkles.sty.js +1 -1
  194. package/styles/textStyle.css +8 -8
  195. package/styles/textStyle.sty.js +1 -1
  196. package/typography/block-quote/Blockquote.css +2 -2
  197. package/typography/block-quote/Blockquote.js +3 -1
  198. package/typography/block-quote/Blockquote.sty.js +1 -1
  199. package/typography/code/Code.css +1 -1
  200. package/typography/code/Code.js +3 -1
  201. package/typography/code/Code.sty.js +1 -1
  202. package/typography/emphasis/Emphasis.css +1 -1
  203. package/typography/emphasis/Emphasis.js +3 -1
  204. package/typography/emphasis/Emphasis.sty.js +1 -1
  205. package/typography/external-link/ExternalLink.css +8 -5
  206. package/typography/external-link/ExternalLink.js +6 -13
  207. package/typography/external-link/ExternalLink.sty.js +2 -1
  208. package/typography/heading/Heading.css +7 -7
  209. package/typography/heading/Heading.js +3 -1
  210. package/typography/heading/Heading.sty.js +1 -1
  211. package/typography/highlight/Highlight.css +2 -2
  212. package/typography/highlight/Highlight.js +3 -1
  213. package/typography/highlight/Highlight.sty.js +1 -1
  214. package/typography/link/Link.css +6 -3
  215. package/typography/link/Link.js +6 -19
  216. package/typography/link/Link.sty.js +2 -1
  217. package/typography/list/List.css +4 -4
  218. package/typography/list/List.js +3 -1
  219. package/typography/list/List.sty.js +2 -2
  220. package/typography/paragraph/Paragraph.css +3 -3
  221. package/typography/paragraph/Paragraph.js +3 -1
  222. package/typography/paragraph/Paragraph.sty.js +1 -1
  223. package/typography/strikethrough/Strikethrough.css +1 -1
  224. package/typography/strikethrough/Strikethrough.js +3 -1
  225. package/typography/strikethrough/Strikethrough.sty.js +1 -1
  226. package/typography/strong/Strong.css +1 -1
  227. package/typography/strong/Strong.js +3 -1
  228. package/typography/strong/Strong.sty.js +1 -1
  229. package/typography/text/Text.css +3 -3
  230. package/typography/text/Text.js +4 -1
  231. package/typography/text/Text.sty.js +1 -1
  232. package/typography/text-ellipsis/TextEllipsis.css +6 -6
  233. package/typography/text-ellipsis/TextEllipsis.js +8 -1
  234. package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
@@ -1,27 +1,27 @@
1
- ._1a1ozfd0-1-16-1 {
1
+ ._1a1ozfd0-1-17-0 {
2
2
  position: relative;
3
3
  overflow: hidden;
4
4
  }
5
- ._1a1ozfd1-1-16-1 {
5
+ ._1a1ozfd1-1-17-0 {
6
6
  border-radius: var(--dt-borders-radius-container-subdued, 6px);
7
7
  }
8
- ._1a1ozfd2-1-16-1 {
8
+ ._1a1ozfd2-1-17-0 {
9
9
  border-radius: 9999px;
10
10
  }
11
- ._1a1ozfd3-1-16-1 {
11
+ ._1a1ozfd3-1-17-0 {
12
12
  width: 100%;
13
13
  height: 100%;
14
14
  }
15
- ._1a1ozfd4-1-16-1 stop {
15
+ ._1a1ozfd4-1-17-0 stop {
16
16
  stop-color: var(--dt-colors-background-field-neutral-disabled, #e4e5eb80);
17
17
  }
18
- ._1a1ozfd5-1-16-1 {
18
+ ._1a1ozfd5-1-17-0 {
19
19
  width: 100%;
20
20
  height: 100%;
21
21
  fill: var(--dt-colors-background-field-neutral-disabled, #e4e5eb80);
22
22
  }
23
23
  @media (prefers-reduced-motion) {
24
- ._1a1ozfd6-1-16-1 {
24
+ ._1a1ozfd6-1-17-0 {
25
25
  display: contents;
26
26
  }
27
27
  }
@@ -37,6 +37,7 @@ var import_react = require("react");
37
37
  var import_Skeleton_css = require("./Skeleton.sty.js");
38
38
  var import_utils = require("./utils.js");
39
39
  var import_useId = require("../../core/hooks/useId.js");
40
+ const COMPONENT_NAME = "Skeleton";
40
41
  const Skeleton = (0, import_react.forwardRef)(
41
42
  (props, forwardedRef) => {
42
43
  const {
@@ -58,6 +59,7 @@ const Skeleton = (0, import_react.forwardRef)(
58
59
  className: (0, import_clsx.default)((0, import_Skeleton_css.skeletonPlaceholderCSS)({ variant }), consumerClassName),
59
60
  style: { width, height, ...consumerStyle },
60
61
  ...remainingProps,
62
+ "data-dt-component": COMPONENT_NAME,
61
63
  children: [
62
64
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: import_Skeleton_css.skeletonSvgCSS, children: [
63
65
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_utils.SkeletonGradient, { id: gradientId }) }),
@@ -69,3 +71,4 @@ const Skeleton = (0, import_react.forwardRef)(
69
71
  );
70
72
  }
71
73
  );
74
+ Skeleton.displayName = COMPONENT_NAME;
@@ -27,8 +27,8 @@ __export(Skeleton_css_exports, {
27
27
  module.exports = __toCommonJS(Skeleton_css_exports);
28
28
  var import_Skeleton_css_ts_vanilla = require("./Skeleton.css");
29
29
  var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
30
- var skeletonPlaceholderCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1a1ozfd0-1-16-1", variantClassNames: { variant: { "default": "_1a1ozfd1-1-16-1", rounded: "_1a1ozfd2-1-16-1" } }, defaultVariants: {}, compoundVariants: [] });
31
- var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-16-1";
32
- var skeletonSvgCSS = "_1a1ozfd3-1-16-1";
33
- var skeletonSvgGradientCSS = "_1a1ozfd4-1-16-1";
34
- var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-16-1";
30
+ var skeletonPlaceholderCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1a1ozfd0-1-17-0", variantClassNames: { variant: { "default": "_1a1ozfd1-1-17-0", rounded: "_1a1ozfd2-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
31
+ var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-17-0";
32
+ var skeletonSvgCSS = "_1a1ozfd3-1-17-0";
33
+ var skeletonSvgGradientCSS = "_1a1ozfd4-1-17-0";
34
+ var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-17-0";
@@ -26,6 +26,7 @@ var import_react = require("react");
26
26
  var import_Skeleton_css = require("./Skeleton.sty.js");
27
27
  var import_utils = require("./utils.js");
28
28
  var import_useId = require("../../core/hooks/useId.js");
29
+ const COMPONENT_NAME = "SkeletonText";
29
30
  const lineHeight = 12;
30
31
  const linePadding = 8;
31
32
  const baseYOffset = linePadding * 0.5;
@@ -61,6 +62,7 @@ const SkeletonText = (0, import_react.forwardRef)(
61
62
  ...consumerStyle
62
63
  },
63
64
  ...remainingProps,
65
+ "data-dt-component": COMPONENT_NAME,
64
66
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: import_Skeleton_css.skeletonSvgCSS, children: [
65
67
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_utils.SkeletonGradient, { id: gradientId }) }),
66
68
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("mask", { id: maskId, children: new Array(lines).fill(null).map((_, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -86,3 +88,4 @@ const SkeletonText = (0, import_react.forwardRef)(
86
88
  );
87
89
  }
88
90
  );
91
+ SkeletonText.displayName = COMPONENT_NAME;
package/core/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { FocusScope, type FocusScopeProps, } from './components/focus-scope/Focu
3
3
  export { type FocusContextProps as _FocusContextProps } from './contexts/FocusContext.js';
4
4
  export { useCurrentTheme } from './hooks/useCurrentTheme.js';
5
5
  export { useFocusContext as _useFocusContext } from './hooks/useFocusContext.js';
6
+ export { type VariantType, type UseFocusRingProps, type FocusRingProps, useFocusRing, } from './styles/useFocusRing.js';
6
7
  export { FocusProvider as _FocusProvider, type Modality as _Modality, } from './providers/FocusProvider.js';
7
8
  export type { MaskingProps } from './types/masking-props.js';
8
9
  export type { DataTestId } from './types/data-props.js';
package/core/index.js CHANGED
@@ -34,6 +34,7 @@ __export(core_exports, {
34
34
  _useFocusContext: () => import_useFocusContext.useFocusContext,
35
35
  _useSafeForwardProps: () => import_useSafeForwardProps.useSafeForwardProps,
36
36
  useCurrentTheme: () => import_useCurrentTheme.useCurrentTheme,
37
+ useFocusRing: () => import_useFocusRing.useFocusRing,
37
38
  useId: () => import_useId.useId
38
39
  });
39
40
  module.exports = __toCommonJS(core_exports);
@@ -41,6 +42,7 @@ var import_AppRoot = require("./components/app-root/AppRoot.js");
41
42
  var import_FocusScope = require("./components/focus-scope/FocusScope.js");
42
43
  var import_useCurrentTheme = require("./hooks/useCurrentTheme.js");
43
44
  var import_useFocusContext = require("./hooks/useFocusContext.js");
45
+ var import_useFocusRing = require("./styles/useFocusRing.js");
44
46
  var import_FocusProvider = require("./providers/FocusProvider.js");
45
47
  var import_attempt_focus = require("./utils/focus-management/attempt-focus.js");
46
48
  var import_focus_first_descendant = require("./utils/focus-management/focus-first-descendant.js");
@@ -1,75 +1,75 @@
1
- ._z2r50s3-1-16-1 {
1
+ ._z2r50s3-1-17-0 {
2
2
  outline: none;
3
3
  }
4
- ._z2r50s3-1-16-1:focus-visible {
4
+ ._z2r50s3-1-17-0:focus-visible {
5
5
  outline: none;
6
6
  }
7
- ._z2r50s4-1-16-1 {
7
+ ._z2r50s4-1-17-0 {
8
8
  border-radius: var(--dt-borders-radius-field-subdued, 3px);
9
- box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-16-1);
10
- background-color: var(--_z2r50s2-1-16-1);
11
- }
12
- ._z2r50s5-1-16-1._z2r50s5-1-16-1 {
13
- box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-16-1), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-16-1);
14
- }
15
- ._z2r50s6-1-16-1 {
16
- --_z2r50s0-1-16-1: var(--dt-colors-border-neutral-accent, #595a7d);
17
- --_z2r50s1-1-16-1: var(--dt-colors-border-neutral-default, #dadbe4);
18
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
19
- }
20
- ._z2r50s7-1-16-1 {
21
- --_z2r50s0-1-16-1: var(--dt-colors-border-primary-accent, #464cce);
22
- --_z2r50s1-1-16-1: var(--dt-colors-border-primary-default, #d5dbf6);
23
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
24
- }
25
- ._z2r50s8-1-16-1 {
26
- --_z2r50s0-1-16-1: var(--dt-colors-border-success-accent, #2d6761);
27
- --_z2r50s1-1-16-1: var(--dt-colors-border-success-default, #d3dedd);
28
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
29
- }
30
- ._z2r50s9-1-16-1 {
31
- --_z2r50s0-1-16-1: var(--dt-colors-border-warning-accent, #855400);
32
- --_z2r50s1-1-16-1: var(--dt-colors-border-warning-default, #f9ebdb);
33
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
34
- }
35
- ._z2r50sa-1-16-1 {
36
- --_z2r50s0-1-16-1: var(--dt-colors-border-critical-accent, #bb0731);
37
- --_z2r50s1-1-16-1: var(--dt-colors-border-critical-default, #f6d6d5);
38
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
39
- }
40
- ._z2r50sb-1-16-1:focus-within {
9
+ box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-17-0);
10
+ background-color: var(--_z2r50s2-1-17-0);
11
+ }
12
+ ._z2r50s5-1-17-0._z2r50s5-1-17-0 {
13
+ box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-17-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-17-0);
14
+ }
15
+ ._z2r50s6-1-17-0 {
16
+ --_z2r50s0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
17
+ --_z2r50s1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
18
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
19
+ }
20
+ ._z2r50s7-1-17-0 {
21
+ --_z2r50s0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
22
+ --_z2r50s1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
23
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
24
+ }
25
+ ._z2r50s8-1-17-0 {
26
+ --_z2r50s0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
27
+ --_z2r50s1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
28
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
29
+ }
30
+ ._z2r50s9-1-17-0 {
31
+ --_z2r50s0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
32
+ --_z2r50s1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
33
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
34
+ }
35
+ ._z2r50sa-1-17-0 {
36
+ --_z2r50s0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
37
+ --_z2r50s1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
38
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
39
+ }
40
+ ._z2r50sb-1-17-0:focus-within {
41
41
  outline: none;
42
42
  }
43
- ._z2r50sc-1-16-1:focus-within {
43
+ ._z2r50sc-1-17-0._z2r50sc-1-17-0:focus-within {
44
44
  border-radius: var(--dt-borders-radius-field-subdued, 3px);
45
- box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-16-1);
46
- background-color: var(--_z2r50s2-1-16-1);
47
- }
48
- ._z2r50sd-1-16-1:focus-within {
49
- box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-16-1), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-16-1);
50
- }
51
- ._z2r50se-1-16-1 {
52
- --_z2r50s0-1-16-1: var(--dt-colors-border-neutral-accent, #595a7d);
53
- --_z2r50s1-1-16-1: var(--dt-colors-border-neutral-default, #dadbe4);
54
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
55
- }
56
- ._z2r50sf-1-16-1 {
57
- --_z2r50s0-1-16-1: var(--dt-colors-border-primary-accent, #464cce);
58
- --_z2r50s1-1-16-1: var(--dt-colors-border-primary-default, #d5dbf6);
59
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
60
- }
61
- ._z2r50sg-1-16-1 {
62
- --_z2r50s0-1-16-1: var(--dt-colors-border-success-accent, #2d6761);
63
- --_z2r50s1-1-16-1: var(--dt-colors-border-success-default, #d3dedd);
64
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
65
- }
66
- ._z2r50sh-1-16-1 {
67
- --_z2r50s0-1-16-1: var(--dt-colors-border-warning-accent, #855400);
68
- --_z2r50s1-1-16-1: var(--dt-colors-border-warning-default, #f9ebdb);
69
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
70
- }
71
- ._z2r50si-1-16-1 {
72
- --_z2r50s0-1-16-1: var(--dt-colors-border-critical-accent, #bb0731);
73
- --_z2r50s1-1-16-1: var(--dt-colors-border-critical-default, #f6d6d5);
74
- --_z2r50s2-1-16-1: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
45
+ box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-17-0);
46
+ background-color: var(--_z2r50s2-1-17-0);
47
+ }
48
+ ._z2r50sd-1-17-0._z2r50sd-1-17-0:focus-within {
49
+ box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-17-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-17-0);
50
+ }
51
+ ._z2r50se-1-17-0 {
52
+ --_z2r50s0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
53
+ --_z2r50s1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
54
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
55
+ }
56
+ ._z2r50sf-1-17-0 {
57
+ --_z2r50s0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
58
+ --_z2r50s1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
59
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
60
+ }
61
+ ._z2r50sg-1-17-0 {
62
+ --_z2r50s0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
63
+ --_z2r50s1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
64
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
65
+ }
66
+ ._z2r50sh-1-17-0 {
67
+ --_z2r50s0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
68
+ --_z2r50s1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
69
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
70
+ }
71
+ ._z2r50si-1-17-0 {
72
+ --_z2r50s0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
73
+ --_z2r50s1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
74
+ --_z2r50s2-1-17-0: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
75
75
  }
@@ -57,15 +57,19 @@ export declare const focusRingCSS: import("@vanilla-extract/recipes").RuntimeFn<
57
57
  export declare const focusRingFocusWithinCSS: import("@vanilla-extract/recipes").RuntimeFn<{
58
58
  minimal: {
59
59
  true: {
60
- ':focus-within': {
61
- borderRadius: string;
62
- boxShadow: string;
63
- backgroundColor: `var(--${string})`;
60
+ selectors: {
61
+ '&&:focus-within': {
62
+ borderRadius: string;
63
+ boxShadow: string;
64
+ backgroundColor: `var(--${string})`;
65
+ };
64
66
  };
65
67
  };
66
68
  false: {
67
- ':focus-within': {
68
- boxShadow: string;
69
+ selectors: {
70
+ '&&:focus-within': {
71
+ boxShadow: string;
72
+ };
69
73
  };
70
74
  };
71
75
  };
@@ -24,5 +24,5 @@ __export(focusRing_css_exports, {
24
24
  module.exports = __toCommonJS(focusRing_css_exports);
25
25
  var import_focusRing_css_ts_vanilla = require("./focusRing.css");
26
26
  var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
27
- var focusRingCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50s3-1-16-1", variantClassNames: { minimal: { true: "_z2r50s4-1-16-1", false: "_z2r50s5-1-16-1" }, variant: { neutral: "_z2r50s6-1-16-1", primary: "_z2r50s7-1-16-1", success: "_z2r50s8-1-16-1", warning: "_z2r50s9-1-16-1", critical: "_z2r50sa-1-16-1" } }, defaultVariants: {}, compoundVariants: [] });
28
- var focusRingFocusWithinCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50sb-1-16-1", variantClassNames: { minimal: { true: "_z2r50sc-1-16-1", false: "_z2r50sd-1-16-1" }, variant: { neutral: "_z2r50se-1-16-1", primary: "_z2r50sf-1-16-1", success: "_z2r50sg-1-16-1", warning: "_z2r50sh-1-16-1", critical: "_z2r50si-1-16-1" } }, defaultVariants: {}, compoundVariants: [] });
27
+ var focusRingCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50s3-1-17-0", variantClassNames: { minimal: { true: "_z2r50s4-1-17-0", false: "_z2r50s5-1-17-0" }, variant: { neutral: "_z2r50s6-1-17-0", primary: "_z2r50s7-1-17-0", success: "_z2r50s8-1-17-0", warning: "_z2r50s9-1-17-0", critical: "_z2r50sa-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
28
+ var focusRingFocusWithinCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50sb-1-17-0", variantClassNames: { minimal: { true: "_z2r50sc-1-17-0", false: "_z2r50sd-1-17-0" }, variant: { neutral: "_z2r50se-1-17-0", primary: "_z2r50sf-1-17-0", success: "_z2r50sg-1-17-0", warning: "_z2r50sh-1-17-0", critical: "_z2r50si-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
@@ -0,0 +1,44 @@
1
+ ._z0fq9b4-1-17-0 {
2
+ outline: none;
3
+ box-shadow: none;
4
+ }
5
+ ._z0fq9b5-1-17-0 {
6
+ --_z0fq9b3-1-17-0: var(--dt-borders-width-default, 1px);
7
+ --_z0fq9b2-1-17-0: 0 0 0 var(--_z0fq9b3-1-17-0) var(--_z0fq9b0-1-17-0) inset;
8
+ }
9
+ ._z0fq9b6-1-17-0 {
10
+ --_z0fq9b3-1-17-0: var(--dt-borders-width-emphasized, 2px);
11
+ --_z0fq9b2-1-17-0: 0 0 0 var(--_z0fq9b3-1-17-0) var(--_z0fq9b0-1-17-0) inset, 0 0 0 calc(var(--_z0fq9b3-1-17-0) + 1px) var(--_z0fq9b1-1-17-0) inset;
12
+ }
13
+ ._z0fq9b7-1-17-0 {
14
+ --_z0fq9b2-1-17-0: none;
15
+ }
16
+ ._z0fq9b8-1-17-0:focus-visible {
17
+ box-shadow: var(--_z0fq9b2-1-17-0);
18
+ }
19
+ ._z0fq9b9-1-17-0:focus-within {
20
+ box-shadow: var(--_z0fq9b2-1-17-0);
21
+ }
22
+ ._z0fq9ba-1-17-0:focus {
23
+ box-shadow: var(--_z0fq9b2-1-17-0);
24
+ }
25
+ ._z0fq9bb-1-17-0 {
26
+ --_z0fq9b0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
27
+ --_z0fq9b1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
28
+ }
29
+ ._z0fq9bc-1-17-0 {
30
+ --_z0fq9b0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
31
+ --_z0fq9b1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
32
+ }
33
+ ._z0fq9bd-1-17-0 {
34
+ --_z0fq9b0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
35
+ --_z0fq9b1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
36
+ }
37
+ ._z0fq9be-1-17-0 {
38
+ --_z0fq9b0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
39
+ --_z0fq9b1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
40
+ }
41
+ ._z0fq9bf-1-17-0 {
42
+ --_z0fq9b0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
43
+ --_z0fq9b1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
44
+ }
@@ -0,0 +1,77 @@
1
+ declare const outerColor: `var(--${string})`;
2
+ declare const innerColor: `var(--${string})`;
3
+ declare const boxShadow: `var(--${string})`;
4
+ declare const width: `var(--${string})`;
5
+ export declare const focusRingStatic: import("@vanilla-extract/recipes").RuntimeFn<{
6
+ minimal: {
7
+ true: {
8
+ vars: {
9
+ [width]: string;
10
+ [boxShadow]: string;
11
+ };
12
+ };
13
+ false: {
14
+ vars: {
15
+ [width]: string;
16
+ [boxShadow]: string;
17
+ };
18
+ };
19
+ };
20
+ disabled: {
21
+ true: {
22
+ vars: {
23
+ [boxShadow]: string;
24
+ };
25
+ };
26
+ };
27
+ when: {
28
+ 'focus-visible': {
29
+ ':focus-visible': {
30
+ boxShadow: `var(--${string})`;
31
+ };
32
+ };
33
+ 'focus-within': {
34
+ ':focus-within': {
35
+ boxShadow: `var(--${string})`;
36
+ };
37
+ };
38
+ focus: {
39
+ ':focus': {
40
+ boxShadow: `var(--${string})`;
41
+ };
42
+ };
43
+ };
44
+ color: {
45
+ neutral: {
46
+ vars: {
47
+ [outerColor]: string;
48
+ [innerColor]: string;
49
+ };
50
+ };
51
+ primary: {
52
+ vars: {
53
+ [outerColor]: string;
54
+ [innerColor]: string;
55
+ };
56
+ };
57
+ success: {
58
+ vars: {
59
+ [outerColor]: string;
60
+ [innerColor]: string;
61
+ };
62
+ };
63
+ warning: {
64
+ vars: {
65
+ [outerColor]: string;
66
+ [innerColor]: string;
67
+ };
68
+ };
69
+ critical: {
70
+ vars: {
71
+ [outerColor]: string;
72
+ [innerColor]: string;
73
+ };
74
+ };
75
+ };
76
+ }>;
77
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var focusRingStatic_css_exports = {};
20
+ __export(focusRingStatic_css_exports, {
21
+ focusRingStatic: () => focusRingStatic
22
+ });
23
+ module.exports = __toCommonJS(focusRingStatic_css_exports);
24
+ var import_focusRingStatic_css_ts_vanilla = require("./focusRingStatic.css");
25
+ var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
26
+ var focusRingStatic = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z0fq9b4-1-17-0", variantClassNames: { minimal: { true: "_z0fq9b5-1-17-0", false: "_z0fq9b6-1-17-0" }, disabled: { true: "_z0fq9b7-1-17-0" }, when: { "focus-visible": "_z0fq9b8-1-17-0", "focus-within": "_z0fq9b9-1-17-0", focus: "_z0fq9ba-1-17-0" }, color: { neutral: "_z0fq9bb-1-17-0", primary: "_z0fq9bc-1-17-0", success: "_z0fq9bd-1-17-0", warning: "_z0fq9be-1-17-0", critical: "_z0fq9bf-1-17-0" } }, defaultVariants: { color: "neutral", minimal: false, when: "focus", disabled: false }, compoundVariants: [] });
@@ -1,7 +1,7 @@
1
1
  import { type FocusEvent as ReactFocusEvent } from 'react';
2
- /** @internal */
2
+ /** @public */
3
3
  export type VariantType = 'neutral' | 'primary' | 'success' | 'warning' | 'critical';
4
- /** @internal */
4
+ /** @public */
5
5
  export type UseFocusRingProps = {
6
6
  /**
7
7
  * A minimal focus outline is available for smaller content elements like links. This variant is applied when set to true.
@@ -27,20 +27,21 @@ export type UseFocusRingProps = {
27
27
  */
28
28
  disabled?: boolean;
29
29
  };
30
+ /** @public */
30
31
  export type FocusRingProps = {
31
32
  /** The focus styles that depend on modality. */
32
33
  focusClassName: string;
33
34
  /** Focus handlers used to manage the focus state. Must be applied to the element that receives the focus.*/
34
35
  focusProps: {
35
- onFocus: (e: ReactFocusEvent) => void;
36
- onBlur: (e: ReactFocusEvent) => void;
36
+ onFocus?: (e: ReactFocusEvent) => void;
37
+ onBlur?: (e: ReactFocusEvent) => void;
37
38
  };
38
39
  /** Whether or not the element got focus via keyboard. */
39
40
  isFocusVisible: boolean;
40
41
  };
41
42
  /**
42
43
  * Custom hook used to determine focus styling depending on modality.
43
- * Returns the css classes (vanilla) that can be applied to the component in order to show the correct focus outline.
44
- * @internal
44
+ * Returns the css classNames that can be applied to the component in order to show the correct focus outline.
45
+ * @public
45
46
  */
46
47
  export declare function useFocusRing(props?: UseFocusRingProps): FocusRingProps;
@@ -39,20 +39,20 @@ function useFocusRing(props = {}) {
39
39
  setIsFocused(false);
40
40
  }
41
41
  }, [disabled]);
42
- const onBlur = (0, import_react.useCallback)((e) => {
43
- if (e.currentTarget === e.target) {
44
- setIsFocused(false);
45
- }
46
- }, []);
47
- const onFocus = (0, import_react.useCallback)((e) => {
48
- if (e.currentTarget === e.target) {
49
- setIsFocused(true);
50
- }
42
+ const focusProps = (0, import_react.useMemo)(() => {
43
+ return {
44
+ onBlur: (event) => {
45
+ if (event.currentTarget === event.target) {
46
+ setIsFocused(false);
47
+ }
48
+ },
49
+ onFocus: (event) => {
50
+ if (event.currentTarget === event.target) {
51
+ setIsFocused(true);
52
+ }
53
+ }
54
+ };
51
55
  }, []);
52
- const focusProps = {
53
- onFocus,
54
- onBlur
55
- };
56
56
  if ((ignoreModality || modality === "keyboard") && isFocused || focusWithin) {
57
57
  if (isMinimal) {
58
58
  return {