@redis-ui/components 51.3.0 → 51.4.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/dist/Button/ActionIconButton/ActionIconButton.style.cjs +5 -1
- package/dist/Button/ActionIconButton/ActionIconButton.style.js +6 -2
- package/dist/Button/Button.style.cjs +11 -1
- package/dist/Button/Button.style.js +11 -1
- package/dist/Chip/components/Compose/Compose.style.cjs +5 -1
- package/dist/Chip/components/Compose/Compose.style.js +6 -2
- package/dist/Inputs/components/Compose/Compose.style.cjs +17 -2
- package/dist/Inputs/components/Compose/Compose.style.js +17 -2
- package/dist/Menu/components/Content/Content.style.cjs +1 -0
- package/dist/Menu/components/Content/Content.style.js +1 -0
- package/dist/Modal/components/Content/components/Compose/Compose.style.cjs +7 -2
- package/dist/Modal/components/Content/components/Compose/Compose.style.js +7 -2
- package/dist/Popover/components/Content/components/Compose/Compose.style.cjs +1 -0
- package/dist/Popover/components/Content/components/Compose/Compose.style.js +1 -0
- package/dist/Popover/components/Content/components/Text/Text.style.cjs +4 -1
- package/dist/Popover/components/Content/components/Text/Text.style.js +4 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +15 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.style.js +15 -1
- package/dist/ThemeModeSwitch/ThemeModeSwitch.cjs +1 -1
- package/dist/ThemeModeSwitch/ThemeModeSwitch.js +1 -1
- package/dist/Tooltip/components/Content/components/Compose/Compose.style.cjs +17 -0
- package/dist/Tooltip/components/Content/components/Compose/Compose.style.js +17 -0
- package/package.json +1 -1
- package/skills/redis-ui-components/references/Tooltip.md +2 -1
|
@@ -13,7 +13,11 @@ var getSizeStyle = (size) => (theme) => {
|
|
|
13
13
|
height: ${themeSize.size};
|
|
14
14
|
` : null;
|
|
15
15
|
};
|
|
16
|
-
var maps = [
|
|
16
|
+
var maps = [
|
|
17
|
+
require_Button_style_utils.bgColorMap,
|
|
18
|
+
require_Button_style_utils.textColorMap,
|
|
19
|
+
require_Button_style_utils.shadowBorderMap
|
|
20
|
+
];
|
|
17
21
|
var ActionIconButton = styled_components.default.button.withConfig({
|
|
18
22
|
displayName: "ActionIconButtonstyle__ActionIconButton",
|
|
19
23
|
componentId: "RedisUI__sc-147pxp7-0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { bgColorMap, getButtonStatesStyle, textColorMap } from "../Button.style.utils.js";
|
|
2
|
+
import { bgColorMap, getButtonStatesStyle, shadowBorderMap, textColorMap } from "../Button.style.utils.js";
|
|
3
3
|
import { baseButtonStyle } from "../Button.style.js";
|
|
4
4
|
import _styled, { css } from "styled-components";
|
|
5
5
|
import { useTheme } from "@redis-ui/styles";
|
|
@@ -12,7 +12,11 @@ var getSizeStyle = (size) => (theme) => {
|
|
|
12
12
|
height: ${themeSize.size};
|
|
13
13
|
` : null;
|
|
14
14
|
};
|
|
15
|
-
var maps = [
|
|
15
|
+
var maps = [
|
|
16
|
+
bgColorMap,
|
|
17
|
+
textColorMap,
|
|
18
|
+
shadowBorderMap
|
|
19
|
+
];
|
|
16
20
|
var ActionIconButton = _styled.button.withConfig({
|
|
17
21
|
displayName: "ActionIconButtonstyle__ActionIconButton",
|
|
18
22
|
componentId: "RedisUI__sc-147pxp7-0"
|
|
@@ -52,11 +52,21 @@ var Button = styled_components.default.button.withConfig({
|
|
|
52
52
|
";",
|
|
53
53
|
";",
|
|
54
54
|
";",
|
|
55
|
+
";",
|
|
55
56
|
";"
|
|
56
57
|
], baseButtonStyle, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.button.gap, ({ size }) => require_css_utils.styleFromTokens({
|
|
57
58
|
tokenMaps: sizeTokenMaps,
|
|
58
59
|
tokens: (0, _redislabsdev_redis_ui_styles.useTheme)().components.button.sizes[size]
|
|
59
|
-
}), ({ size }) => require_Body_style.useBodyStyles(size === "small" ? { $size: "S" } : void 0), ({
|
|
60
|
+
}), ({ size }) => require_Body_style.useBodyStyles(size === "small" ? { $size: "S" } : void 0), ({ size }) => {
|
|
61
|
+
const { sizes, pressTransform } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.button;
|
|
62
|
+
return styled_components.css`
|
|
63
|
+
${require_css_utils.styleFromTokens({
|
|
64
|
+
tokenMaps: [require_css_utils.tokenMaps.fontSize],
|
|
65
|
+
tokens: sizes[size]
|
|
66
|
+
})}
|
|
67
|
+
${pressTransform && `&:active:not(:disabled) { transform: ${pressTransform}; }`}
|
|
68
|
+
`;
|
|
69
|
+
}, ({ variant }) => require_Button_style_utils.getButtonStatesStyle((0, _redislabsdev_redis_ui_styles.useTheme)().components.button.variants[variant], variantTokenMaps));
|
|
60
70
|
//#endregion
|
|
61
71
|
exports.Button = Button;
|
|
62
72
|
Object.defineProperty(exports, "Button_style_exports", {
|
|
@@ -51,10 +51,20 @@ var Button = _styled.button.withConfig({
|
|
|
51
51
|
";",
|
|
52
52
|
";",
|
|
53
53
|
";",
|
|
54
|
+
";",
|
|
54
55
|
";"
|
|
55
56
|
], baseButtonStyle, () => useTheme().components.button.gap, ({ size }) => styleFromTokens({
|
|
56
57
|
tokenMaps: sizeTokenMaps,
|
|
57
58
|
tokens: useTheme().components.button.sizes[size]
|
|
58
|
-
}), ({ size }) => useBodyStyles(size === "small" ? { $size: "S" } : void 0), ({
|
|
59
|
+
}), ({ size }) => useBodyStyles(size === "small" ? { $size: "S" } : void 0), ({ size }) => {
|
|
60
|
+
const { sizes, pressTransform } = useTheme().components.button;
|
|
61
|
+
return css`
|
|
62
|
+
${styleFromTokens({
|
|
63
|
+
tokenMaps: [tokenMaps.fontSize],
|
|
64
|
+
tokens: sizes[size]
|
|
65
|
+
})}
|
|
66
|
+
${pressTransform && `&:active:not(:disabled) { transform: ${pressTransform}; }`}
|
|
67
|
+
`;
|
|
68
|
+
}, ({ variant }) => getButtonStatesStyle(useTheme().components.button.variants[variant], variantTokenMaps));
|
|
59
69
|
//#endregion
|
|
60
70
|
export { Button, Button_style_exports, baseButtonStyle };
|
|
@@ -15,7 +15,11 @@ var ChipContainer = styled_components.default.span.withConfig({
|
|
|
15
15
|
], ({ $variant, $disabled }) => {
|
|
16
16
|
const variantStyle = (0, _redislabsdev_redis_ui_styles.useTheme)().components.chip.variant[$variant][$disabled ? "disabled" : "normal"];
|
|
17
17
|
return require_css_utils.styleFromTokens({
|
|
18
|
-
tokenMaps: [
|
|
18
|
+
tokenMaps: [
|
|
19
|
+
require_Button_style_utils.bgColorMap,
|
|
20
|
+
require_Button_style_utils.textColorMap,
|
|
21
|
+
require_Button_style_utils.shadowBorderMap
|
|
22
|
+
],
|
|
19
23
|
tokens: variantStyle
|
|
20
24
|
});
|
|
21
25
|
}, ({ $size }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styleFromTokens } from "../../../Helpers/css.utils.js";
|
|
2
|
-
import { bgColorMap, textColorMap } from "../../../Button/Button.style.utils.js";
|
|
2
|
+
import { bgColorMap, shadowBorderMap, textColorMap } from "../../../Button/Button.style.utils.js";
|
|
3
3
|
import _styled, { css } from "styled-components";
|
|
4
4
|
import { useTheme } from "@redis-ui/styles";
|
|
5
5
|
//#region src/Chip/components/Compose/Compose.style.ts
|
|
@@ -13,7 +13,11 @@ var ChipContainer = _styled.span.withConfig({
|
|
|
13
13
|
], ({ $variant, $disabled }) => {
|
|
14
14
|
const variantStyle = useTheme().components.chip.variant[$variant][$disabled ? "disabled" : "normal"];
|
|
15
15
|
return styleFromTokens({
|
|
16
|
-
tokenMaps: [
|
|
16
|
+
tokenMaps: [
|
|
17
|
+
bgColorMap,
|
|
18
|
+
textColorMap,
|
|
19
|
+
shadowBorderMap
|
|
20
|
+
],
|
|
17
21
|
tokens: variantStyle
|
|
18
22
|
});
|
|
19
23
|
}, ({ $size }) => {
|
|
@@ -24,12 +24,23 @@ var getStateStyle = (theme) => {
|
|
|
24
24
|
})};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
${statesStyle.hover && styled_components.css`
|
|
28
|
+
&:hover {
|
|
29
|
+
${require_css_utils.styleFromTokens({
|
|
30
|
+
tokenMaps: maps,
|
|
31
|
+
tokens: statesStyle.hover,
|
|
32
|
+
fallbackTokens: statesStyle.normal
|
|
33
|
+
})};
|
|
34
|
+
}
|
|
35
|
+
`}
|
|
36
|
+
|
|
27
37
|
&:focus-within {
|
|
28
38
|
${require_css_utils.styleFromTokens({
|
|
29
39
|
tokenMaps: maps,
|
|
30
40
|
tokens: statesStyle.focused,
|
|
31
41
|
fallbackTokens: statesStyle.normal
|
|
32
42
|
})};
|
|
43
|
+
${theme.components.input.focusRing && `box-shadow: ${theme.components.input.focusRing};`}
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
&[data-status='error'] {
|
|
@@ -85,11 +96,15 @@ var CommonInputCompose = styled_components.default.div.attrs(() => ({ "data-stat
|
|
|
85
96
|
tokenMaps: [require_css_utils.tokenMaps.borderWidth, require_css_utils.tokenMaps.borderRadius],
|
|
86
97
|
tokens: (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.variants[$variant],
|
|
87
98
|
fallbackTokens: (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.variants.outline
|
|
88
|
-
}), ({ $variant }) =>
|
|
99
|
+
}), ({ $variant }) => {
|
|
100
|
+
const { focusRing } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.input;
|
|
101
|
+
return $variant !== "underline" ? void 0 : styled_components.css`
|
|
89
102
|
border-top-color: transparent;
|
|
90
103
|
border-right-color: transparent;
|
|
91
104
|
border-left-color: transparent;
|
|
92
|
-
|
|
105
|
+
${focusRing && "box-shadow: none;"}
|
|
106
|
+
`;
|
|
107
|
+
});
|
|
93
108
|
var ReadonlyValue = (0, styled_components.default)(require_Typography.default.Body).attrs(() => ({ readOnly: true })).withConfig({
|
|
94
109
|
displayName: "Composestyle__ReadonlyValue",
|
|
95
110
|
componentId: "RedisUI__sc-1vsempl-1"
|
|
@@ -22,12 +22,23 @@ var getStateStyle = (theme) => {
|
|
|
22
22
|
})};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
${statesStyle.hover && css`
|
|
26
|
+
&:hover {
|
|
27
|
+
${styleFromTokens({
|
|
28
|
+
tokenMaps: maps,
|
|
29
|
+
tokens: statesStyle.hover,
|
|
30
|
+
fallbackTokens: statesStyle.normal
|
|
31
|
+
})};
|
|
32
|
+
}
|
|
33
|
+
`}
|
|
34
|
+
|
|
25
35
|
&:focus-within {
|
|
26
36
|
${styleFromTokens({
|
|
27
37
|
tokenMaps: maps,
|
|
28
38
|
tokens: statesStyle.focused,
|
|
29
39
|
fallbackTokens: statesStyle.normal
|
|
30
40
|
})};
|
|
41
|
+
${theme.components.input.focusRing && `box-shadow: ${theme.components.input.focusRing};`}
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
&[data-status='error'] {
|
|
@@ -83,11 +94,15 @@ var CommonInputCompose = _styled.div.attrs(() => ({ "data-status": useFieldStatu
|
|
|
83
94
|
tokenMaps: [tokenMaps.borderWidth, tokenMaps.borderRadius],
|
|
84
95
|
tokens: useTheme().components.input.variants[$variant],
|
|
85
96
|
fallbackTokens: useTheme().components.input.variants.outline
|
|
86
|
-
}), ({ $variant }) =>
|
|
97
|
+
}), ({ $variant }) => {
|
|
98
|
+
const { focusRing } = useTheme().components.input;
|
|
99
|
+
return $variant !== "underline" ? void 0 : css`
|
|
87
100
|
border-top-color: transparent;
|
|
88
101
|
border-right-color: transparent;
|
|
89
102
|
border-left-color: transparent;
|
|
90
|
-
|
|
103
|
+
${focusRing && "box-shadow: none;"}
|
|
104
|
+
`;
|
|
105
|
+
});
|
|
91
106
|
var ReadonlyValue = _styled(Typography.Body).attrs(() => ({ readOnly: true })).withConfig({
|
|
92
107
|
displayName: "Composestyle__ReadonlyValue",
|
|
93
108
|
componentId: "RedisUI__sc-1vsempl-1"
|
|
@@ -21,6 +21,7 @@ var Container = (0, styled_components.default)(require_index.Content2).withConfi
|
|
|
21
21
|
background-color: ${style.bgColor};
|
|
22
22
|
box-shadow: ${style.shadow};
|
|
23
23
|
border-radius: ${style.borderRadius};
|
|
24
|
+
${style.borderColor && `border: 1px solid ${style.borderColor};`}
|
|
24
25
|
|
|
25
26
|
${require_DropdownArrow_style.Arrow} {
|
|
26
27
|
color: ${style.bgColor};
|
|
@@ -19,6 +19,7 @@ var Container = _styled(Content2).withConfig({
|
|
|
19
19
|
background-color: ${style.bgColor};
|
|
20
20
|
box-shadow: ${style.shadow};
|
|
21
21
|
border-radius: ${style.borderRadius};
|
|
22
|
+
${style.borderColor && `border: 1px solid ${style.borderColor};`}
|
|
22
23
|
|
|
23
24
|
${Arrow} {
|
|
24
25
|
color: ${style.bgColor};
|
|
@@ -25,6 +25,7 @@ var Container = (0, styled_components.default)(require_index.Content).withConfig
|
|
|
25
25
|
z-index: ${theme.core.zIndex.zIndex9998};
|
|
26
26
|
box-shadow: ${style.shadow};
|
|
27
27
|
border-radius: ${style.borderRadius};
|
|
28
|
+
${style.borderColor && `border: 1px solid ${style.borderColor};`}
|
|
28
29
|
position: fixed;
|
|
29
30
|
top: 50%;
|
|
30
31
|
left: 50%;
|
|
@@ -42,9 +43,13 @@ var ModalOverlay = styled_components.default.div.withConfig({
|
|
|
42
43
|
componentId: "RedisUI__sc-kuv5cc-1"
|
|
43
44
|
})([
|
|
44
45
|
"background:",
|
|
45
|
-
";
|
|
46
|
+
";",
|
|
47
|
+
" position:fixed;inset:0;z-index:",
|
|
46
48
|
";display:grid;place-items:center;overflow-y:auto;"
|
|
47
|
-
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.overlay.bgColor, () =>
|
|
49
|
+
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.overlay.bgColor, () => {
|
|
50
|
+
const { backdropFilter } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.overlay;
|
|
51
|
+
return backdropFilter && `backdrop-filter: ${backdropFilter};`;
|
|
52
|
+
}, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.zIndex.zIndex9998);
|
|
48
53
|
//#endregion
|
|
49
54
|
exports.Container = Container;
|
|
50
55
|
exports.ModalOverlay = ModalOverlay;
|
|
@@ -23,6 +23,7 @@ var Container = _styled(Content).withConfig({
|
|
|
23
23
|
z-index: ${theme.core.zIndex.zIndex9998};
|
|
24
24
|
box-shadow: ${style.shadow};
|
|
25
25
|
border-radius: ${style.borderRadius};
|
|
26
|
+
${style.borderColor && `border: 1px solid ${style.borderColor};`}
|
|
26
27
|
position: fixed;
|
|
27
28
|
top: 50%;
|
|
28
29
|
left: 50%;
|
|
@@ -40,8 +41,12 @@ var ModalOverlay = _styled.div.withConfig({
|
|
|
40
41
|
componentId: "RedisUI__sc-kuv5cc-1"
|
|
41
42
|
})([
|
|
42
43
|
"background:",
|
|
43
|
-
";
|
|
44
|
+
";",
|
|
45
|
+
" position:fixed;inset:0;z-index:",
|
|
44
46
|
";display:grid;place-items:center;overflow-y:auto;"
|
|
45
|
-
], () => useTheme().components.modal.overlay.bgColor, () =>
|
|
47
|
+
], () => useTheme().components.modal.overlay.bgColor, () => {
|
|
48
|
+
const { backdropFilter } = useTheme().components.modal.overlay;
|
|
49
|
+
return backdropFilter && `backdrop-filter: ${backdropFilter};`;
|
|
50
|
+
}, () => useTheme().core.zIndex.zIndex9998);
|
|
46
51
|
//#endregion
|
|
47
52
|
export { Container, ModalOverlay };
|
|
@@ -34,6 +34,7 @@ var Content = (0, styled_components.default)(require_index.Content2).withConfig(
|
|
|
34
34
|
}
|
|
35
35
|
box-shadow: ${popoverTheme.shadow};
|
|
36
36
|
border-radius: ${popoverTheme.borderRadius};
|
|
37
|
+
${popoverTheme.borderColor && `border: 1px solid ${popoverTheme.borderColor};`}
|
|
37
38
|
overflow: hidden;
|
|
38
39
|
min-width: ${popoverTheme.minWidth};
|
|
39
40
|
max-width: ${$maxWidth || popoverTheme.maxWidth};
|
|
@@ -32,6 +32,7 @@ var Content = _styled(Content2).withConfig({
|
|
|
32
32
|
}
|
|
33
33
|
box-shadow: ${popoverTheme.shadow};
|
|
34
34
|
border-radius: ${popoverTheme.borderRadius};
|
|
35
|
+
${popoverTheme.borderColor && `border: 1px solid ${popoverTheme.borderColor};`}
|
|
35
36
|
overflow: hidden;
|
|
36
37
|
min-width: ${popoverTheme.minWidth};
|
|
37
38
|
max-width: ${$maxWidth || popoverTheme.maxWidth};
|
|
@@ -7,6 +7,9 @@ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
|
7
7
|
var Text = (0, styled_components.default)(require_Typography.default.Body).withConfig({
|
|
8
8
|
displayName: "Textstyle__Text",
|
|
9
9
|
componentId: "RedisUI__sc-6foh1z-0"
|
|
10
|
-
})(["color:", ";"], () =>
|
|
10
|
+
})(["color:", ";"], () => {
|
|
11
|
+
const { popover, tooltip } = (0, _redislabsdev_redis_ui_styles.useTheme)().components;
|
|
12
|
+
return popover.textColor ?? tooltip.textColor;
|
|
13
|
+
});
|
|
11
14
|
//#endregion
|
|
12
15
|
exports.Text = Text;
|
|
@@ -5,6 +5,9 @@ import { useTheme } from "@redis-ui/styles";
|
|
|
5
5
|
var Text = _styled(Typography.Body).withConfig({
|
|
6
6
|
displayName: "Textstyle__Text",
|
|
7
7
|
componentId: "RedisUI__sc-6foh1z-0"
|
|
8
|
-
})(["color:", ";"], () =>
|
|
8
|
+
})(["color:", ";"], () => {
|
|
9
|
+
const { popover, tooltip } = useTheme().components;
|
|
10
|
+
return popover.textColor ?? tooltip.textColor;
|
|
11
|
+
});
|
|
9
12
|
//#endregion
|
|
10
13
|
export { Text };
|
|
@@ -22,7 +22,14 @@ var getStateStyle = (theme) => {
|
|
|
22
22
|
})};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
&:hover
|
|
25
|
+
&:hover {
|
|
26
|
+
${require_css_utils.styleFromTokens({
|
|
27
|
+
tokenMaps: maps,
|
|
28
|
+
tokens: statesStyle.hover ?? statesStyle.focused,
|
|
29
|
+
fallbackTokens: statesStyle.normal
|
|
30
|
+
})};
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
&:focus,
|
|
27
34
|
&:active {
|
|
28
35
|
${require_css_utils.styleFromTokens({
|
|
@@ -32,6 +39,13 @@ var getStateStyle = (theme) => {
|
|
|
32
39
|
})};
|
|
33
40
|
}
|
|
34
41
|
|
|
42
|
+
${theme.components.select.focusRing && styled_components.css`
|
|
43
|
+
&:focus-visible,
|
|
44
|
+
&[data-state='open'] {
|
|
45
|
+
box-shadow: ${theme.components.select.focusRing};
|
|
46
|
+
}
|
|
47
|
+
`}
|
|
48
|
+
|
|
35
49
|
&[data-state='open'] {
|
|
36
50
|
${require_css_utils.styleFromTokens({
|
|
37
51
|
tokenMaps: maps,
|
|
@@ -20,7 +20,14 @@ var getStateStyle = (theme) => {
|
|
|
20
20
|
})};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
&:hover
|
|
23
|
+
&:hover {
|
|
24
|
+
${styleFromTokens({
|
|
25
|
+
tokenMaps: maps,
|
|
26
|
+
tokens: statesStyle.hover ?? statesStyle.focused,
|
|
27
|
+
fallbackTokens: statesStyle.normal
|
|
28
|
+
})};
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
&:focus,
|
|
25
32
|
&:active {
|
|
26
33
|
${styleFromTokens({
|
|
@@ -30,6 +37,13 @@ var getStateStyle = (theme) => {
|
|
|
30
37
|
})};
|
|
31
38
|
}
|
|
32
39
|
|
|
40
|
+
${theme.components.select.focusRing && css`
|
|
41
|
+
&:focus-visible,
|
|
42
|
+
&[data-state='open'] {
|
|
43
|
+
box-shadow: ${theme.components.select.focusRing};
|
|
44
|
+
}
|
|
45
|
+
`}
|
|
46
|
+
|
|
33
47
|
&[data-state='open'] {
|
|
34
48
|
${styleFromTokens({
|
|
35
49
|
tokenMaps: maps,
|
|
@@ -18,7 +18,7 @@ var ThemeModeSwitch = ({ onThemeModeChange, variant = "switch", switchTimeoutMs
|
|
|
18
18
|
...restProps,
|
|
19
19
|
onClick: toggleThemeMode,
|
|
20
20
|
onPointerDown: allowSystemThemeMode ? (e) => {
|
|
21
|
-
e.currentTarget.focus();
|
|
21
|
+
e.currentTarget.focus({ focusVisible: false });
|
|
22
22
|
e.preventDefault();
|
|
23
23
|
} : void 0
|
|
24
24
|
});
|
|
@@ -18,7 +18,7 @@ var ThemeModeSwitch = ({ onThemeModeChange, variant = "switch", switchTimeoutMs
|
|
|
18
18
|
...restProps,
|
|
19
19
|
onClick: toggleThemeMode,
|
|
20
20
|
onPointerDown: allowSystemThemeMode ? (e) => {
|
|
21
|
-
e.currentTarget.focus();
|
|
21
|
+
e.currentTarget.focus({ focusVisible: false });
|
|
22
22
|
e.preventDefault();
|
|
23
23
|
} : void 0
|
|
24
24
|
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_BodyText_style = require("../../../../../Popover/components/Content/components/Body/components/BodyText/BodyText.style.cjs");
|
|
3
|
+
const require_Link_style = require("../../../../../Link/Link.style.cjs");
|
|
4
|
+
const require_HeaderTitle_style = require("../../../../../Popover/components/Content/components/Header/components/HeaderTitle/HeaderTitle.style.cjs");
|
|
2
5
|
const require_index = require("../../../../../node_modules/@radix-ui/react-tooltip/dist/index.cjs");
|
|
6
|
+
const require_Compose_style = require("../../../TooltipCard/components/Compose/Compose.style.cjs");
|
|
3
7
|
let styled_components = require("styled-components");
|
|
4
8
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
5
9
|
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
@@ -24,6 +28,19 @@ var Content = (0, styled_components.default)(require_index.Content2).withConfig(
|
|
|
24
28
|
const bgColor = $backgroundColor || tooltipTheme.bgColor;
|
|
25
29
|
return styled_components.css`
|
|
26
30
|
background-color: ${bgColor};
|
|
31
|
+
${!$backgroundColor && tooltipTheme.contentTextColor && styled_components.css`
|
|
32
|
+
color: ${tooltipTheme.contentTextColor};
|
|
33
|
+
|
|
34
|
+
${require_Compose_style.Content} {
|
|
35
|
+
${require_HeaderTitle_style.HeaderTitle},
|
|
36
|
+
${require_BodyText_style.HeaderTitle},
|
|
37
|
+
${require_Link_style.StyledLink},
|
|
38
|
+
${require_Link_style.StyledLink}:hover,
|
|
39
|
+
${require_Link_style.StyledLink}:active {
|
|
40
|
+
color: inherit;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`}
|
|
27
44
|
${Arrow} {
|
|
28
45
|
color: ${bgColor};
|
|
29
46
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { HeaderTitle } from "../../../../../Popover/components/Content/components/Body/components/BodyText/BodyText.style.js";
|
|
2
|
+
import { StyledLink } from "../../../../../Link/Link.style.js";
|
|
3
|
+
import { HeaderTitle as HeaderTitle$1 } from "../../../../../Popover/components/Content/components/Header/components/HeaderTitle/HeaderTitle.style.js";
|
|
1
4
|
import { Arrow2, Content2 } from "../../../../../node_modules/@radix-ui/react-tooltip/dist/index.js";
|
|
5
|
+
import { Content as Content$1 } from "../../../TooltipCard/components/Compose/Compose.style.js";
|
|
2
6
|
import _styled, { css } from "styled-components";
|
|
3
7
|
import { useTheme } from "@redis-ui/styles";
|
|
4
8
|
//#region src/Tooltip/components/Content/components/Compose/Compose.style.ts
|
|
@@ -22,6 +26,19 @@ var Content = _styled(Content2).withConfig({
|
|
|
22
26
|
const bgColor = $backgroundColor || tooltipTheme.bgColor;
|
|
23
27
|
return css`
|
|
24
28
|
background-color: ${bgColor};
|
|
29
|
+
${!$backgroundColor && tooltipTheme.contentTextColor && css`
|
|
30
|
+
color: ${tooltipTheme.contentTextColor};
|
|
31
|
+
|
|
32
|
+
${Content$1} {
|
|
33
|
+
${HeaderTitle$1},
|
|
34
|
+
${HeaderTitle},
|
|
35
|
+
${StyledLink},
|
|
36
|
+
${StyledLink}:hover,
|
|
37
|
+
${StyledLink}:active {
|
|
38
|
+
color: inherit;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`}
|
|
25
42
|
${Arrow} {
|
|
26
43
|
color: ${bgColor};
|
|
27
44
|
}
|
package/package.json
CHANGED
|
@@ -97,7 +97,7 @@ import { Tooltip, TooltipProvider } from '@redis-ui/components';
|
|
|
97
97
|
| Prop | Type | Default | Description |
|
|
98
98
|
|------|------|---------|-------------|
|
|
99
99
|
| children | `React.ReactNode` | required | Tooltip content body |
|
|
100
|
-
| backgroundColor | `string` | - | Overrides the tooltip background color |
|
|
100
|
+
| backgroundColor | `string` | - | Overrides the tooltip background color; custom content and `Tooltip.Card` then keep their own text colors instead of the theme's tooltip content color |
|
|
101
101
|
| placement | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Tooltip side relative to the trigger |
|
|
102
102
|
| sideOffset | `number` | `5` | Gap between trigger and content |
|
|
103
103
|
| maxWidth | `string` | theme default | Maximum width of the tooltip panel |
|
|
@@ -631,6 +631,7 @@ function Render() {
|
|
|
631
631
|
- `Tooltip.Trigger` can wrap plain text, SVG, or multi-element triggers by setting `withButton`.
|
|
632
632
|
- `Tooltip.Compose` supports controlled and uncontrolled open state.
|
|
633
633
|
- `Tooltip.Content.Compose` defaults `placement` to `top`, `sideOffset` to `5`, `portal` to `document.body`, and `interactive` to `false`.
|
|
634
|
+
- When the theme sets `tooltip.contentTextColor` (the Redis Ultra themes do), custom content and the `Tooltip.Card` title, body and footer link use that color so they stay readable on the tooltip background. Passing `backgroundColor` opts out, and the content keeps its own colors.
|
|
634
635
|
- `Tooltip.Card.Header` hides the close button by default.
|
|
635
636
|
- `Tooltip.Card.Footer` renders nothing when both `link` and `actionButtonHandler` are missing.
|
|
636
637
|
- For async tooltip content, prefer `Popover` unless the tooltip interaction is required.
|