@redis-ui/components 51.17.1 → 51.18.1
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/SideBar/components/CollapseButton/CollapseButton.cjs +1 -1
- package/dist/SideBar/components/CollapseButton/CollapseButton.js +1 -1
- package/dist/SideBar/components/Group/components/Title/Title.style.cjs +3 -0
- package/dist/SideBar/components/Group/components/Title/Title.style.js +3 -0
- package/dist/SideBar/components/Item/Item.cjs +1 -1
- package/dist/SideBar/components/Item/Item.js +1 -1
- package/dist/SideBar/components/Item/components/Text/Text.cjs +1 -0
- package/dist/SideBar/components/Item/components/Text/Text.js +1 -0
- package/dist/SideBar/components/Item/components/Text/Text.style.cjs +28 -0
- package/dist/SideBar/components/Item/components/Text/Text.style.d.ts +1 -0
- package/dist/SideBar/components/Item/components/Text/Text.style.js +28 -0
- package/package.json +2 -2
- package/skills/redis-ui-components/references/SideBar.md +3 -2
|
@@ -2,8 +2,8 @@ const require_ScreenReaderAnnounce = require("../../../ScreenReaderAnnounce/Scre
|
|
|
2
2
|
const require_Tooltip = require("../../../Tooltip/Tooltip.cjs");
|
|
3
3
|
const require_SideBar_context = require("../../SideBar.context.cjs");
|
|
4
4
|
const require_Icon = require("../Item/components/Icon/Icon.cjs");
|
|
5
|
-
const require_Text = require("../Item/components/Text/Text.cjs");
|
|
6
5
|
const require_Item_style = require("../Item/Item.style.cjs");
|
|
6
|
+
const require_Text = require("../Item/components/Text/Text.cjs");
|
|
7
7
|
const require_CollapseButton_style = require("./CollapseButton.style.cjs");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
//#region src/SideBar/components/CollapseButton/CollapseButton.tsx
|
|
@@ -2,8 +2,8 @@ import { ScreenReaderAnnounce } from "../../../ScreenReaderAnnounce/ScreenReader
|
|
|
2
2
|
import Tooltip from "../../../Tooltip/Tooltip.js";
|
|
3
3
|
import { useSideBarContext } from "../../SideBar.context.js";
|
|
4
4
|
import Icon from "../Item/components/Icon/Icon.js";
|
|
5
|
-
import Text from "../Item/components/Text/Text.js";
|
|
6
5
|
import { TooltipContent } from "../Item/Item.style.js";
|
|
6
|
+
import Text from "../Item/components/Text/Text.js";
|
|
7
7
|
import { CollapseButton as CollapseButton$1, Container } from "./CollapseButton.style.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/SideBar/components/CollapseButton/CollapseButton.tsx
|
|
@@ -21,6 +21,9 @@ var Label = (0, styled_components.default)(require_Typography.default.Body).with
|
|
|
21
21
|
${theme.groupTitle.fontSize && styled_components.css`
|
|
22
22
|
font-size: ${theme.groupTitle.fontSize};
|
|
23
23
|
`}
|
|
24
|
+
${theme.groupTitle.letterSpacing && styled_components.css`
|
|
25
|
+
letter-spacing: ${theme.groupTitle.letterSpacing};
|
|
26
|
+
`}
|
|
24
27
|
`));
|
|
25
28
|
//#endregion
|
|
26
29
|
exports.Container = Container;
|
|
@@ -19,6 +19,9 @@ var Label = _styled(Typography.Body).withConfig({
|
|
|
19
19
|
${theme.groupTitle.fontSize && css`
|
|
20
20
|
font-size: ${theme.groupTitle.fontSize};
|
|
21
21
|
`}
|
|
22
|
+
${theme.groupTitle.letterSpacing && css`
|
|
23
|
+
letter-spacing: ${theme.groupTitle.letterSpacing};
|
|
24
|
+
`}
|
|
22
25
|
`));
|
|
23
26
|
//#endregion
|
|
24
27
|
export { Container, Label };
|
|
@@ -2,10 +2,10 @@ const require_Tooltip = require("../../../Tooltip/Tooltip.cjs");
|
|
|
2
2
|
const require_SideBar_context = require("../../SideBar.context.cjs");
|
|
3
3
|
const require_Icon = require("./components/Icon/Icon.cjs");
|
|
4
4
|
const require_ExpandableItem_context = require("../ExpandableItem/ExpandableItem.context.cjs");
|
|
5
|
+
const require_Item_style = require("./Item.style.cjs");
|
|
5
6
|
const require_Text = require("./components/Text/Text.cjs");
|
|
6
7
|
const require_Button = require("./components/Button/Button.cjs");
|
|
7
8
|
const require_Badge = require("./components/Badge/Badge.cjs");
|
|
8
|
-
const require_Item_style = require("./Item.style.cjs");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let react = require("react");
|
|
11
11
|
//#region src/SideBar/components/Item/Item.tsx
|
|
@@ -2,10 +2,10 @@ import Tooltip from "../../../Tooltip/Tooltip.js";
|
|
|
2
2
|
import { useSideBarContext } from "../../SideBar.context.js";
|
|
3
3
|
import Icon from "./components/Icon/Icon.js";
|
|
4
4
|
import { useIsNestedItem } from "../ExpandableItem/ExpandableItem.context.js";
|
|
5
|
+
import { SideBarItem, TooltipContent } from "./Item.style.js";
|
|
5
6
|
import Text from "./components/Text/Text.js";
|
|
6
7
|
import Button from "./components/Button/Button.js";
|
|
7
8
|
import Badge from "./components/Badge/Badge.js";
|
|
8
|
-
import { SideBarItem, TooltipContent } from "./Item.style.js";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
import { useRef } from "react";
|
|
11
11
|
//#region src/SideBar/components/Item/Item.tsx
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_Typography = require("../../../../../Typography/Typography.cjs");
|
|
3
|
+
const require_css_utils = require("../../../../../Helpers/css.utils.cjs");
|
|
4
|
+
const require_Item_style = require("../../Item.style.cjs");
|
|
3
5
|
let styled_components = require("styled-components");
|
|
4
6
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
5
7
|
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
6
8
|
//#region src/SideBar/components/Item/components/Text/Text.style.ts
|
|
9
|
+
var labelMaps = [require_css_utils.tokenMapMod(require_css_utils.tokenMaps.textColor, "labelColor")];
|
|
7
10
|
var SideBarItemText = (0, styled_components.default)(require_Typography.default.Body).withConfig({
|
|
8
11
|
displayName: "Textstyle__SideBarItemText",
|
|
9
12
|
componentId: "RedisUI__sc-17tjfvd-0"
|
|
10
13
|
})([
|
|
11
14
|
"transition:opacity 0.4s;@media (prefers-reduced-motion:reduce){transition:none;}opacity:",
|
|
12
15
|
";",
|
|
16
|
+
" ",
|
|
13
17
|
""
|
|
14
18
|
], ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "1" : "0", ({ $useThemeFontSize, $isNested }) => {
|
|
15
19
|
const { fontSize: itemFontSize, child } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.sideBar.item;
|
|
@@ -17,6 +21,30 @@ var SideBarItemText = (0, styled_components.default)(require_Typography.default.
|
|
|
17
21
|
return $useThemeFontSize && fontSize && styled_components.css`
|
|
18
22
|
font-size: ${fontSize};
|
|
19
23
|
`;
|
|
24
|
+
}, ({ $useThemeColor }) => {
|
|
25
|
+
const { states } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.sideBar.item;
|
|
26
|
+
return $useThemeColor && styled_components.css`
|
|
27
|
+
${require_css_utils.styleFromTokens({
|
|
28
|
+
tokenMaps: labelMaps,
|
|
29
|
+
tokens: states.normal
|
|
30
|
+
})}
|
|
31
|
+
|
|
32
|
+
&:is(${require_Item_style.SideBarItem}:hover *) {
|
|
33
|
+
${require_css_utils.styleFromTokens({
|
|
34
|
+
tokenMaps: labelMaps,
|
|
35
|
+
tokens: states.hover,
|
|
36
|
+
fallbackTokens: states.normal
|
|
37
|
+
})}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:is(${require_Item_style.SideBarItem}[data-state='active'] *) {
|
|
41
|
+
${require_css_utils.styleFromTokens({
|
|
42
|
+
tokenMaps: labelMaps,
|
|
43
|
+
tokens: states.active,
|
|
44
|
+
fallbackTokens: states.normal
|
|
45
|
+
})}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
20
48
|
});
|
|
21
49
|
//#endregion
|
|
22
50
|
exports.SideBarItemText = SideBarItemText;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import Typography from "../../../../../Typography/Typography.js";
|
|
2
|
+
import { styleFromTokens, tokenMapMod, tokenMaps } from "../../../../../Helpers/css.utils.js";
|
|
3
|
+
import { SideBarItem } from "../../Item.style.js";
|
|
2
4
|
import _styled, { css } from "styled-components";
|
|
3
5
|
import { useTheme } from "@redis-ui/styles";
|
|
4
6
|
//#region src/SideBar/components/Item/components/Text/Text.style.ts
|
|
7
|
+
var labelMaps = [tokenMapMod(tokenMaps.textColor, "labelColor")];
|
|
5
8
|
var SideBarItemText = _styled(Typography.Body).withConfig({
|
|
6
9
|
displayName: "Textstyle__SideBarItemText",
|
|
7
10
|
componentId: "RedisUI__sc-17tjfvd-0"
|
|
8
11
|
})([
|
|
9
12
|
"transition:opacity 0.4s;@media (prefers-reduced-motion:reduce){transition:none;}opacity:",
|
|
10
13
|
";",
|
|
14
|
+
" ",
|
|
11
15
|
""
|
|
12
16
|
], ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "1" : "0", ({ $useThemeFontSize, $isNested }) => {
|
|
13
17
|
const { fontSize: itemFontSize, child } = useTheme().components.sideBar.item;
|
|
@@ -15,6 +19,30 @@ var SideBarItemText = _styled(Typography.Body).withConfig({
|
|
|
15
19
|
return $useThemeFontSize && fontSize && css`
|
|
16
20
|
font-size: ${fontSize};
|
|
17
21
|
`;
|
|
22
|
+
}, ({ $useThemeColor }) => {
|
|
23
|
+
const { states } = useTheme().components.sideBar.item;
|
|
24
|
+
return $useThemeColor && css`
|
|
25
|
+
${styleFromTokens({
|
|
26
|
+
tokenMaps: labelMaps,
|
|
27
|
+
tokens: states.normal
|
|
28
|
+
})}
|
|
29
|
+
|
|
30
|
+
&:is(${SideBarItem}:hover *) {
|
|
31
|
+
${styleFromTokens({
|
|
32
|
+
tokenMaps: labelMaps,
|
|
33
|
+
tokens: states.hover,
|
|
34
|
+
fallbackTokens: states.normal
|
|
35
|
+
})}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:is(${SideBarItem}[data-state='active'] *) {
|
|
39
|
+
${styleFromTokens({
|
|
40
|
+
tokenMaps: labelMaps,
|
|
41
|
+
tokens: states.active,
|
|
42
|
+
fallbackTokens: states.normal
|
|
43
|
+
})}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
18
46
|
});
|
|
19
47
|
//#endregion
|
|
20
48
|
export { SideBarItemText };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-ui/components",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "51.
|
|
4
|
+
"version": "51.18.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": "git@github.com:redislabsdev/redis-ui.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@redis-ui/icons": "^8.0.0 || ^9.0.0 || ^10.0.0",
|
|
33
|
-
"@redis-ui/styles": "^21.
|
|
33
|
+
"@redis-ui/styles": "^21.25.0",
|
|
34
34
|
"react": "^18.0.0 || ^19.0.0",
|
|
35
35
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
36
36
|
"styled-components": "^5.0.0"
|
|
@@ -95,7 +95,7 @@ The tooltip text is used as the collapsed label and tooltip placement defaults t
|
|
|
95
95
|
|
|
96
96
|
### SideBar.Item.Text Props
|
|
97
97
|
|
|
98
|
-
This slot inherits `TypographyBodyProps`. Use it for the sidebar item text label. Without a `size`, it takes the theme's sidebar item font size when the theme sets one, so items and `CollapseButton` stay the same size.
|
|
98
|
+
This slot inherits `TypographyBodyProps`. Use it for the sidebar item text label. Without a `size`, it takes the theme's sidebar item font size when the theme sets one, so items and `CollapseButton` stay the same size. Without a `color`, it takes the theme's `labelColor` for the item's state when the theme sets one, otherwise the row color.
|
|
99
99
|
|
|
100
100
|
### SideBar.Item.Button Props
|
|
101
101
|
|
|
@@ -794,4 +794,5 @@ const [activeLink, setActiveLink] = useState('Agent Memory');
|
|
|
794
794
|
- `SideBar.Group` wraps a section's `Group.Title` (optional) and items so the title and the items stay together as one logical unit.
|
|
795
795
|
- `SideBar.Group.Title` labels a group of items. Pair `SideBar.Item.Badge` with `Item.Text` if you need to mark individual items as `NEW`, `BETA`, etc.
|
|
796
796
|
- **Theme Architecture (v17.0.0+)**: The SideBar theme uses a flattened structure where state-dependent theme properties (`collapseButton.border`, `collapseButton.right`, `footer.meta.visibility`, `footer.meta.whiteSpace`) are defined as `{ collapsed: string; expanded: string }` objects directly on the theme. Structural layout values (widths, heights, margins, paddings, gaps, radii, shadows) that don't vary across light/dark themes are defined in `SIDEBAR_CONSTANTS` rather than duplicated in each theme file. This eliminates the need for runtime theme merging and provides full type safety.
|
|
797
|
-
- **Optional sizing theme keys**: a theme can set `button.height`, `item.fontSize`, `item.gap`, `item.iconSize`, `item.height`, `item.margin` and `groupTitle.
|
|
797
|
+
- **Optional sizing theme keys**: a theme can set `button.height`, `item.fontSize`, `item.gap`, `item.iconSize`, `item.height`, `item.margin`, `groupTitle.fontSize` and `groupTitle.letterSpacing` to resize the sidebar. `button.height` replaces `SIDEBAR_CONSTANTS.button.height` and also sets the collapsed `SideBar.Button` width, so it stays square. `item.gap`, `item.height` and `item.margin` replace the matching `SIDEBAR_CONSTANTS.item` values (for items and `CollapseButton`), `item.iconSize` replaces the `L` icon size, `item.fontSize` applies to `Item.Text` without a `size` (including `CollapseButton`), `groupTitle.fontSize` replaces the `S` group title size, and `groupTitle.letterSpacing` sets the group title letter spacing. `item.child.height` and `item.child.fontSize` size the items inside `SideBar.ExpandableItem.Items` (defaulting to `2.8rem` and `item.fontSize`). Themes that leave them unset keep the defaults; the Next themes set them for Ultra.
|
|
798
|
+
- **Optional label color**: a theme can set `labelColor` on `item.states.normal`, `item.states.hover` and `item.states.active` to color `Item.Text` apart from the row. The row color (`textColor`) still applies to `Item.Icon`, the `ExpandableItem` chevron and anything else in the item, and `labelColor` only applies to an `Item.Text` without a `color` prop. Themes that leave it unset keep the text on the row color; the Next themes set it so the text matches the breadcrumbs while the icons keep the row color.
|