@dynatrace/strato-components 1.16.1 → 1.18.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.
- package/buttons/button/Button.css +16 -16
- package/buttons/button/Button.js +12 -9
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/intent-button/IntentButton.d.ts +3 -1
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.js +3 -1
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +3 -1
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +7 -7
- package/content/skeleton/Skeleton.js +3 -0
- package/content/skeleton/Skeleton.sty.js +5 -5
- package/content/skeleton/SkeletonText.js +3 -0
- package/core/hooks/useBehavioralTrackingProps.d.ts +4 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +4 -0
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.d.ts +10 -6
- package/core/styles/focusRing.sty.js +2 -2
- package/core/styles/focusRingStatic.css +44 -0
- package/core/styles/focusRingStatic.sty.d.ts +77 -0
- package/core/styles/focusRingStatic.sty.js +26 -0
- package/core/styles/useFocusRing.d.ts +7 -6
- package/core/styles/useFocusRing.js +13 -13
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +12 -9
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/buttons/index.js.map +1 -1
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js +3 -1
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +3 -1
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +7 -7
- package/esm/content/skeleton/Skeleton.js +3 -0
- package/esm/content/skeleton/Skeleton.js.map +2 -2
- package/esm/content/skeleton/Skeleton.sty.js +5 -5
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/content/skeleton/SkeletonText.js +3 -0
- package/esm/content/skeleton/SkeletonText.js.map +2 -2
- package/esm/core/hooks/useBehavioralTrackingProps.js.map +2 -2
- package/esm/core/index.js +6 -0
- package/esm/core/index.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/styles/focusRingStatic.css +44 -0
- package/esm/core/styles/focusRingStatic.sty.js +7 -0
- package/esm/core/styles/focusRingStatic.sty.js.map +7 -0
- package/esm/core/styles/useFocusRing.js +15 -15
- package/esm/core/styles/useFocusRing.js.map +2 -2
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.js +2 -6
- package/esm/layouts/surface/Surface.js.map +2 -2
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +1 -1
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +1 -1
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +1 -1
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.js +3 -1
- package/esm/typography/block-quote/Blockquote.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.js +3 -1
- package/esm/typography/code/Code.js.map +2 -2
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.js +3 -1
- package/esm/typography/emphasis/Emphasis.js.map +2 -2
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +8 -5
- package/esm/typography/external-link/ExternalLink.js +6 -13
- package/esm/typography/external-link/ExternalLink.js.map +2 -2
- package/esm/typography/external-link/ExternalLink.sty.js +2 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +2 -2
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.js +3 -1
- package/esm/typography/heading/Heading.js.map +2 -2
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +2 -2
- package/esm/typography/highlight/Highlight.js +3 -1
- package/esm/typography/highlight/Highlight.js.map +2 -2
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/link/Link.css +6 -3
- package/esm/typography/link/Link.js +6 -19
- package/esm/typography/link/Link.js.map +2 -2
- package/esm/typography/link/Link.sty.js +2 -1
- package/esm/typography/link/Link.sty.js.map +2 -2
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.js +3 -1
- package/esm/typography/list/List.js.map +2 -2
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.js +3 -1
- package/esm/typography/paragraph/Paragraph.js.map +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.js +3 -1
- package/esm/typography/strikethrough/Strikethrough.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.js +3 -1
- package/esm/typography/strong/Strong.js.map +2 -2
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.js +4 -1
- package/esm/typography/text/Text.js.map +2 -2
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.js +2 -6
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +2 -2
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.js +3 -1
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.js +3 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.js +3 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +8 -5
- package/typography/external-link/ExternalLink.js +6 -13
- package/typography/external-link/ExternalLink.sty.js +2 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.js +3 -1
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +2 -2
- package/typography/highlight/Highlight.js +3 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/link/Link.css +6 -3
- package/typography/link/Link.js +6 -19
- package/typography/link/Link.sty.js +2 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.js +3 -1
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +3 -1
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.js +3 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.js +3 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +4 -1
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
|
@@ -27,8 +27,8 @@ __export(ProgressCircle_css_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(ProgressCircle_css_exports);
|
|
28
28
|
var import_ProgressCircle_css_ts_vanilla = require("./ProgressCircle.css");
|
|
29
29
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
30
|
-
var progressCircleBackgroundCSS = "_kvldjh9-1-
|
|
31
|
-
var progressCircleCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_kvldjh6-1-
|
|
32
|
-
var progressCircleContainerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_kvldjha-1-
|
|
33
|
-
var progressCircleRootCSS = "_kvldjh4-1-
|
|
34
|
-
var progressCircleSvgCss = "_kvldjh5-1-
|
|
30
|
+
var progressCircleBackgroundCSS = "_kvldjh9-1-18-0";
|
|
31
|
+
var progressCircleCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_kvldjh6-1-18-0", variantClassNames: { indeterminate: { true: "_kvldjh7-1-18-0", false: "_kvldjh8-1-18-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
32
|
+
var progressCircleContainerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_kvldjha-1-18-0", variantClassNames: { size: { small: "_kvldjhb-1-18-0", large: "_kvldjhc-1-18-0" }, color: { critical: "_kvldjhd-1-18-0", neutral: "_kvldjhe-1-18-0", primary: "_kvldjhf-1-18-0", success: "_kvldjhg-1-18-0", warning: "_kvldjhh-1-18-0" }, variant: { "default": "_kvldjhi-1-18-0", accent: "_kvldjhj-1-18-0" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "_kvldjhk-1-18-0"], [{ color: "success", variant: "accent" }, "_kvldjhl-1-18-0"], [{ color: "warning", variant: "accent" }, "_kvldjhm-1-18-0"], [{ color: "critical", variant: "accent" }, "_kvldjhn-1-18-0"], [{ color: "neutral", variant: "accent" }, "_kvldjho-1-18-0"]] });
|
|
33
|
+
var progressCircleRootCSS = "_kvldjh4-1-18-0";
|
|
34
|
+
var progressCircleSvgCss = "_kvldjh5-1-18-0";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
._1a1ozfd0-1-
|
|
1
|
+
._1a1ozfd0-1-18-0 {
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
}
|
|
5
|
-
._1a1ozfd1-1-
|
|
5
|
+
._1a1ozfd1-1-18-0 {
|
|
6
6
|
border-radius: var(--dt-borders-radius-container-subdued, 6px);
|
|
7
7
|
}
|
|
8
|
-
._1a1ozfd2-1-
|
|
8
|
+
._1a1ozfd2-1-18-0 {
|
|
9
9
|
border-radius: 9999px;
|
|
10
10
|
}
|
|
11
|
-
._1a1ozfd3-1-
|
|
11
|
+
._1a1ozfd3-1-18-0 {
|
|
12
12
|
width: 100%;
|
|
13
13
|
height: 100%;
|
|
14
14
|
}
|
|
15
|
-
._1a1ozfd4-1-
|
|
15
|
+
._1a1ozfd4-1-18-0 stop {
|
|
16
16
|
stop-color: var(--dt-colors-background-field-neutral-disabled, #e4e5eb80);
|
|
17
17
|
}
|
|
18
|
-
._1a1ozfd5-1-
|
|
18
|
+
._1a1ozfd5-1-18-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-
|
|
24
|
+
._1a1ozfd6-1-18-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-
|
|
31
|
-
var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-
|
|
32
|
-
var skeletonSvgCSS = "_1a1ozfd3-1-
|
|
33
|
-
var skeletonSvgGradientCSS = "_1a1ozfd4-1-
|
|
34
|
-
var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-
|
|
30
|
+
var skeletonPlaceholderCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1a1ozfd0-1-18-0", variantClassNames: { variant: { "default": "_1a1ozfd1-1-18-0", rounded: "_1a1ozfd2-1-18-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
31
|
+
var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-18-0";
|
|
32
|
+
var skeletonSvgCSS = "_1a1ozfd3-1-18-0";
|
|
33
|
+
var skeletonSvgGradientCSS = "_1a1ozfd4-1-18-0";
|
|
34
|
+
var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-18-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;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { BehaviorTrackingProps } from '../types/behavior-tracking-props.js';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function to extract behavioral tracking props from component props to easily spread them to the desired child.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
2
6
|
export declare const useBehavioralTrackingProps: <TProps extends object>(props: TProps) => [BehaviorTrackingProps, Omit<TProps, keyof BehaviorTrackingProps>];
|
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';
|
|
@@ -18,6 +19,7 @@ export { isBrowser as _isBrowser } from './utils/isBrowser.js';
|
|
|
18
19
|
export { mergeProps as _mergeProps, type NullToObject as _NullToObject, type TupleTypes as _TupleTypes, type UnionToIntersection as _UnionToIntersection, } from './utils/merge-props.js';
|
|
19
20
|
export { type _HeadingLevel, type _HeadingTag } from './types/heading.js';
|
|
20
21
|
export { useAriaLabelingProps as _useAriaLabelingProps } from './hooks/useAriaLabelingProps.js';
|
|
22
|
+
export { useBehavioralTrackingProps as _useBehavioralTrackingProps } from './hooks/useBehavioralTrackingProps.js';
|
|
21
23
|
export { useId } from './hooks/useId.js';
|
|
22
24
|
export { useSafeForwardProps as _useSafeForwardProps } from './hooks/useSafeForwardProps.js';
|
|
23
25
|
export type { UseSafeForwardReturnProps as _UseSafeForwardReturnProps } from './hooks/useSafeForwardProps.js';
|
package/core/index.js
CHANGED
|
@@ -31,9 +31,11 @@ __export(core_exports, {
|
|
|
31
31
|
_mergeProps: () => import_merge_props.mergeProps,
|
|
32
32
|
_parseBoolean: () => import_parse_boolean.parseBoolean,
|
|
33
33
|
_useAriaLabelingProps: () => import_useAriaLabelingProps.useAriaLabelingProps,
|
|
34
|
+
_useBehavioralTrackingProps: () => import_useBehavioralTrackingProps.useBehavioralTrackingProps,
|
|
34
35
|
_useFocusContext: () => import_useFocusContext.useFocusContext,
|
|
35
36
|
_useSafeForwardProps: () => import_useSafeForwardProps.useSafeForwardProps,
|
|
36
37
|
useCurrentTheme: () => import_useCurrentTheme.useCurrentTheme,
|
|
38
|
+
useFocusRing: () => import_useFocusRing.useFocusRing,
|
|
37
39
|
useId: () => import_useId.useId
|
|
38
40
|
});
|
|
39
41
|
module.exports = __toCommonJS(core_exports);
|
|
@@ -41,6 +43,7 @@ var import_AppRoot = require("./components/app-root/AppRoot.js");
|
|
|
41
43
|
var import_FocusScope = require("./components/focus-scope/FocusScope.js");
|
|
42
44
|
var import_useCurrentTheme = require("./hooks/useCurrentTheme.js");
|
|
43
45
|
var import_useFocusContext = require("./hooks/useFocusContext.js");
|
|
46
|
+
var import_useFocusRing = require("./styles/useFocusRing.js");
|
|
44
47
|
var import_FocusProvider = require("./providers/FocusProvider.js");
|
|
45
48
|
var import_attempt_focus = require("./utils/focus-management/attempt-focus.js");
|
|
46
49
|
var import_focus_first_descendant = require("./utils/focus-management/focus-first-descendant.js");
|
|
@@ -50,6 +53,7 @@ var import_is_focusable = require("./utils/focus-management/is-focusable.js");
|
|
|
50
53
|
var import_isBrowser = require("./utils/isBrowser.js");
|
|
51
54
|
var import_merge_props = require("./utils/merge-props.js");
|
|
52
55
|
var import_useAriaLabelingProps = require("./hooks/useAriaLabelingProps.js");
|
|
56
|
+
var import_useBehavioralTrackingProps = require("./hooks/useBehavioralTrackingProps.js");
|
|
53
57
|
var import_useId = require("./hooks/useId.js");
|
|
54
58
|
var import_useSafeForwardProps = require("./hooks/useSafeForwardProps.js");
|
|
55
59
|
var import_can_receive_default_text_format = require("./utils/can-receive-default-text-format.js");
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
._z2r50s3-1-
|
|
1
|
+
._z2r50s3-1-18-0 {
|
|
2
2
|
outline: none;
|
|
3
3
|
}
|
|
4
|
-
._z2r50s3-1-
|
|
4
|
+
._z2r50s3-1-18-0:focus-visible {
|
|
5
5
|
outline: none;
|
|
6
6
|
}
|
|
7
|
-
._z2r50s4-1-
|
|
7
|
+
._z2r50s4-1-18-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-
|
|
10
|
-
background-color: var(--_z2r50s2-1-
|
|
11
|
-
}
|
|
12
|
-
._z2r50s5-1-
|
|
13
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-
|
|
14
|
-
}
|
|
15
|
-
._z2r50s6-1-
|
|
16
|
-
--_z2r50s0-1-
|
|
17
|
-
--_z2r50s1-1-
|
|
18
|
-
--_z2r50s2-1-
|
|
19
|
-
}
|
|
20
|
-
._z2r50s7-1-
|
|
21
|
-
--_z2r50s0-1-
|
|
22
|
-
--_z2r50s1-1-
|
|
23
|
-
--_z2r50s2-1-
|
|
24
|
-
}
|
|
25
|
-
._z2r50s8-1-
|
|
26
|
-
--_z2r50s0-1-
|
|
27
|
-
--_z2r50s1-1-
|
|
28
|
-
--_z2r50s2-1-
|
|
29
|
-
}
|
|
30
|
-
._z2r50s9-1-
|
|
31
|
-
--_z2r50s0-1-
|
|
32
|
-
--_z2r50s1-1-
|
|
33
|
-
--_z2r50s2-1-
|
|
34
|
-
}
|
|
35
|
-
._z2r50sa-1-
|
|
36
|
-
--_z2r50s0-1-
|
|
37
|
-
--_z2r50s1-1-
|
|
38
|
-
--_z2r50s2-1-
|
|
39
|
-
}
|
|
40
|
-
._z2r50sb-1-
|
|
9
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-18-0);
|
|
10
|
+
background-color: var(--_z2r50s2-1-18-0);
|
|
11
|
+
}
|
|
12
|
+
._z2r50s5-1-18-0._z2r50s5-1-18-0 {
|
|
13
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-18-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-18-0);
|
|
14
|
+
}
|
|
15
|
+
._z2r50s6-1-18-0 {
|
|
16
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
17
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
18
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
|
|
19
|
+
}
|
|
20
|
+
._z2r50s7-1-18-0 {
|
|
21
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
22
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
23
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
|
|
24
|
+
}
|
|
25
|
+
._z2r50s8-1-18-0 {
|
|
26
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
27
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
28
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
|
|
29
|
+
}
|
|
30
|
+
._z2r50s9-1-18-0 {
|
|
31
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-warning-accent, #855400);
|
|
32
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
33
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
|
|
34
|
+
}
|
|
35
|
+
._z2r50sa-1-18-0 {
|
|
36
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
37
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
38
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
|
|
39
|
+
}
|
|
40
|
+
._z2r50sb-1-18-0:focus-within {
|
|
41
41
|
outline: none;
|
|
42
42
|
}
|
|
43
|
-
._z2r50sc-1-
|
|
43
|
+
._z2r50sc-1-18-0._z2r50sc-1-18-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-
|
|
46
|
-
background-color: var(--_z2r50s2-1-
|
|
47
|
-
}
|
|
48
|
-
._z2r50sd-1-
|
|
49
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-
|
|
50
|
-
}
|
|
51
|
-
._z2r50se-1-
|
|
52
|
-
--_z2r50s0-1-
|
|
53
|
-
--_z2r50s1-1-
|
|
54
|
-
--_z2r50s2-1-
|
|
55
|
-
}
|
|
56
|
-
._z2r50sf-1-
|
|
57
|
-
--_z2r50s0-1-
|
|
58
|
-
--_z2r50s1-1-
|
|
59
|
-
--_z2r50s2-1-
|
|
60
|
-
}
|
|
61
|
-
._z2r50sg-1-
|
|
62
|
-
--_z2r50s0-1-
|
|
63
|
-
--_z2r50s1-1-
|
|
64
|
-
--_z2r50s2-1-
|
|
65
|
-
}
|
|
66
|
-
._z2r50sh-1-
|
|
67
|
-
--_z2r50s0-1-
|
|
68
|
-
--_z2r50s1-1-
|
|
69
|
-
--_z2r50s2-1-
|
|
70
|
-
}
|
|
71
|
-
._z2r50si-1-
|
|
72
|
-
--_z2r50s0-1-
|
|
73
|
-
--_z2r50s1-1-
|
|
74
|
-
--_z2r50s2-1-
|
|
45
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-18-0);
|
|
46
|
+
background-color: var(--_z2r50s2-1-18-0);
|
|
47
|
+
}
|
|
48
|
+
._z2r50sd-1-18-0._z2r50sd-1-18-0:focus-within {
|
|
49
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-18-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-18-0);
|
|
50
|
+
}
|
|
51
|
+
._z2r50se-1-18-0 {
|
|
52
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
53
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
54
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
|
|
55
|
+
}
|
|
56
|
+
._z2r50sf-1-18-0 {
|
|
57
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
58
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
59
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
|
|
60
|
+
}
|
|
61
|
+
._z2r50sg-1-18-0 {
|
|
62
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
63
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
64
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
|
|
65
|
+
}
|
|
66
|
+
._z2r50sh-1-18-0 {
|
|
67
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-warning-accent, #855400);
|
|
68
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
69
|
+
--_z2r50s2-1-18-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
|
|
70
|
+
}
|
|
71
|
+
._z2r50si-1-18-0 {
|
|
72
|
+
--_z2r50s0-1-18-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
73
|
+
--_z2r50s1-1-18-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
74
|
+
--_z2r50s2-1-18-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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
selectors: {
|
|
61
|
+
'&&:focus-within': {
|
|
62
|
+
borderRadius: string;
|
|
63
|
+
boxShadow: string;
|
|
64
|
+
backgroundColor: `var(--${string})`;
|
|
65
|
+
};
|
|
64
66
|
};
|
|
65
67
|
};
|
|
66
68
|
false: {
|
|
67
|
-
|
|
68
|
-
|
|
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-
|
|
28
|
-
var focusRingFocusWithinCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50sb-1-
|
|
27
|
+
var focusRingCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50s3-1-18-0", variantClassNames: { minimal: { true: "_z2r50s4-1-18-0", false: "_z2r50s5-1-18-0" }, variant: { neutral: "_z2r50s6-1-18-0", primary: "_z2r50s7-1-18-0", success: "_z2r50s8-1-18-0", warning: "_z2r50s9-1-18-0", critical: "_z2r50sa-1-18-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
28
|
+
var focusRingFocusWithinCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_z2r50sb-1-18-0", variantClassNames: { minimal: { true: "_z2r50sc-1-18-0", false: "_z2r50sd-1-18-0" }, variant: { neutral: "_z2r50se-1-18-0", primary: "_z2r50sf-1-18-0", success: "_z2r50sg-1-18-0", warning: "_z2r50sh-1-18-0", critical: "_z2r50si-1-18-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
._z0fq9b4-1-18-0 {
|
|
2
|
+
outline: none;
|
|
3
|
+
box-shadow: none;
|
|
4
|
+
}
|
|
5
|
+
._z0fq9b5-1-18-0 {
|
|
6
|
+
--_z0fq9b3-1-18-0: var(--dt-borders-width-default, 1px);
|
|
7
|
+
--_z0fq9b2-1-18-0: 0 0 0 var(--_z0fq9b3-1-18-0) var(--_z0fq9b0-1-18-0) inset;
|
|
8
|
+
}
|
|
9
|
+
._z0fq9b6-1-18-0 {
|
|
10
|
+
--_z0fq9b3-1-18-0: var(--dt-borders-width-emphasized, 2px);
|
|
11
|
+
--_z0fq9b2-1-18-0: 0 0 0 var(--_z0fq9b3-1-18-0) var(--_z0fq9b0-1-18-0) inset, 0 0 0 calc(var(--_z0fq9b3-1-18-0) + 1px) var(--_z0fq9b1-1-18-0) inset;
|
|
12
|
+
}
|
|
13
|
+
._z0fq9b7-1-18-0 {
|
|
14
|
+
--_z0fq9b2-1-18-0: none;
|
|
15
|
+
}
|
|
16
|
+
._z0fq9b8-1-18-0:focus-visible {
|
|
17
|
+
box-shadow: var(--_z0fq9b2-1-18-0);
|
|
18
|
+
}
|
|
19
|
+
._z0fq9b9-1-18-0:focus-within {
|
|
20
|
+
box-shadow: var(--_z0fq9b2-1-18-0);
|
|
21
|
+
}
|
|
22
|
+
._z0fq9ba-1-18-0:focus {
|
|
23
|
+
box-shadow: var(--_z0fq9b2-1-18-0);
|
|
24
|
+
}
|
|
25
|
+
._z0fq9bb-1-18-0 {
|
|
26
|
+
--_z0fq9b0-1-18-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
27
|
+
--_z0fq9b1-1-18-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
28
|
+
}
|
|
29
|
+
._z0fq9bc-1-18-0 {
|
|
30
|
+
--_z0fq9b0-1-18-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
31
|
+
--_z0fq9b1-1-18-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
32
|
+
}
|
|
33
|
+
._z0fq9bd-1-18-0 {
|
|
34
|
+
--_z0fq9b0-1-18-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
35
|
+
--_z0fq9b1-1-18-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
36
|
+
}
|
|
37
|
+
._z0fq9be-1-18-0 {
|
|
38
|
+
--_z0fq9b0-1-18-0: var(--dt-colors-border-warning-accent, #855400);
|
|
39
|
+
--_z0fq9b1-1-18-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
40
|
+
}
|
|
41
|
+
._z0fq9bf-1-18-0 {
|
|
42
|
+
--_z0fq9b0-1-18-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
43
|
+
--_z0fq9b1-1-18-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-18-0", variantClassNames: { minimal: { true: "_z0fq9b5-1-18-0", false: "_z0fq9b6-1-18-0" }, disabled: { true: "_z0fq9b7-1-18-0" }, when: { "focus-visible": "_z0fq9b8-1-18-0", "focus-within": "_z0fq9b9-1-18-0", focus: "_z0fq9ba-1-18-0" }, color: { neutral: "_z0fq9bb-1-18-0", primary: "_z0fq9bc-1-18-0", success: "_z0fq9bd-1-18-0", warning: "_z0fq9be-1-18-0", critical: "_z0fq9bf-1-18-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
|
-
/** @
|
|
2
|
+
/** @public */
|
|
3
3
|
export type VariantType = 'neutral' | 'primary' | 'success' | 'warning' | 'critical';
|
|
4
|
-
/** @
|
|
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
|
|
36
|
-
onBlur
|
|
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
|
|
44
|
-
* @
|
|
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
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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 {
|