@redis-ui/components 47.6.1 → 47.6.3
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/Banner/bannerContext.cjs +6 -5
- package/dist/Banner/bannerContext.js +6 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup/components/Button/Button.cjs +3 -1
- package/dist/ButtonGroup/components/Button/Button.d.ts +1 -1
- package/dist/ButtonGroup/components/Button/Button.js +3 -1
- package/dist/Helpers/index.d.ts +1 -0
- package/dist/Helpers/index.js +1 -0
- package/dist/Helpers/throttle.cjs +40 -0
- package/dist/Helpers/throttle.d.ts +5 -0
- package/dist/Helpers/throttle.js +40 -0
- package/dist/Overflow/components/OverflowContainer/OverflowContainer.cjs +2 -3
- package/dist/Overflow/components/OverflowContainer/OverflowContainer.js +2 -3
- package/dist/SideBar/SideBar.cjs +3 -4
- package/dist/SideBar/SideBar.constants.cjs +55 -0
- package/dist/SideBar/SideBar.constants.d.ts +62 -0
- package/dist/SideBar/SideBar.constants.js +55 -0
- package/dist/SideBar/SideBar.js +3 -4
- package/dist/SideBar/SideBar.style.cjs +6 -5
- package/dist/SideBar/SideBar.style.js +6 -5
- package/dist/SideBar/SideBar.utils.cjs +2 -2
- package/dist/SideBar/SideBar.utils.d.ts +1 -1
- package/dist/SideBar/SideBar.utils.js +2 -2
- package/dist/SideBar/components/Button/Button.style.cjs +4 -3
- package/dist/SideBar/components/Button/Button.style.js +4 -3
- package/dist/SideBar/components/Divider/Divider.style.cjs +4 -3
- package/dist/SideBar/components/Divider/Divider.style.js +4 -3
- package/dist/SideBar/components/Footer/components/MetaData/MetaData.style.cjs +5 -4
- package/dist/SideBar/components/Footer/components/MetaData/MetaData.style.js +5 -4
- package/dist/SideBar/components/Group/components/Title/Title.style.cjs +2 -3
- package/dist/SideBar/components/Group/components/Title/Title.style.js +2 -3
- package/dist/SideBar/components/Header/Header.style.cjs +9 -8
- package/dist/SideBar/components/Header/Header.style.js +9 -8
- package/dist/SideBar/components/Item/Item.style.cjs +12 -11
- package/dist/SideBar/components/Item/Item.style.js +12 -11
- package/dist/SideBar/components/Item/components/Button/Button.style.cjs +2 -1
- package/dist/SideBar/components/Item/components/Button/Button.style.js +2 -1
- package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.cjs +2 -4
- package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.js +3 -5
- package/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/_virtual/_rolldown/runtime.cjs +0 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -1
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +2 -3
- package/skills/redis-ui-components/references/ButtonGroup.md +2 -1
- package/skills/redis-ui-components/references/SideBar.md +1 -0
- package/dist/SideBar/SideBarThemeProvider.cjs +0 -30
- package/dist/SideBar/SideBarThemeProvider.d.ts +0 -7
- package/dist/SideBar/SideBarThemeProvider.js +0 -29
- package/dist/node_modules/lodash/lodash.cjs +0 -14557
- package/dist/node_modules/lodash/lodash.js +0 -14554
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_SideBar_constants = require("../../SideBar.constants.cjs");
|
|
2
3
|
const require_SideBar_utils = require("../../SideBar.utils.cjs");
|
|
3
4
|
let styled_components = require("styled-components");
|
|
4
5
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -8,9 +9,9 @@ var SideBarDivider = styled_components.default.div.withConfig({
|
|
|
8
9
|
componentId: "RedisUI__sc-191o8ht-0"
|
|
9
10
|
})(["background-clip:content-box;transition:all 1s;flex:none;@media (prefers-reduced-motion:reduce){transition:none;}", ";"], ({ fullWidthWhenExpanded, fullWidth, noMargin }) => require_SideBar_utils.useStateStyle((theme, state) => styled_components.css`
|
|
10
11
|
background: ${() => theme.divider.color};
|
|
11
|
-
height: ${
|
|
12
|
-
margin-inline: ${fullWidth || fullWidthWhenExpanded && state === "expanded" ? "0" :
|
|
13
|
-
margin-block: ${noMargin ? 0 :
|
|
12
|
+
height: ${require_SideBar_constants.SIDEBAR_CONSTANTS.divider.thickness};
|
|
13
|
+
margin-inline: ${fullWidth || fullWidthWhenExpanded && state === "expanded" ? "0" : require_SideBar_constants.SIDEBAR_CONSTANTS.divider.sidePadding[state]};
|
|
14
|
+
margin-block: ${noMargin ? 0 : require_SideBar_constants.SIDEBAR_CONSTANTS.divider.blockMargin};
|
|
14
15
|
`));
|
|
15
16
|
//#endregion
|
|
16
17
|
exports.SideBarDivider = SideBarDivider;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SIDEBAR_CONSTANTS } from "../../SideBar.constants.js";
|
|
1
2
|
import { useStateStyle } from "../../SideBar.utils.js";
|
|
2
3
|
import _styled, { css } from "styled-components";
|
|
3
4
|
//#region src/SideBar/components/Divider/Divider.style.ts
|
|
@@ -6,9 +7,9 @@ var SideBarDivider = _styled.div.withConfig({
|
|
|
6
7
|
componentId: "RedisUI__sc-191o8ht-0"
|
|
7
8
|
})(["background-clip:content-box;transition:all 1s;flex:none;@media (prefers-reduced-motion:reduce){transition:none;}", ";"], ({ fullWidthWhenExpanded, fullWidth, noMargin }) => useStateStyle((theme, state) => css`
|
|
8
9
|
background: ${() => theme.divider.color};
|
|
9
|
-
height: ${
|
|
10
|
-
margin-inline: ${fullWidth || fullWidthWhenExpanded && state === "expanded" ? "0" :
|
|
11
|
-
margin-block: ${noMargin ? 0 :
|
|
10
|
+
height: ${SIDEBAR_CONSTANTS.divider.thickness};
|
|
11
|
+
margin-inline: ${fullWidth || fullWidthWhenExpanded && state === "expanded" ? "0" : SIDEBAR_CONSTANTS.divider.sidePadding[state]};
|
|
12
|
+
margin-block: ${noMargin ? 0 : SIDEBAR_CONSTANTS.divider.blockMargin};
|
|
12
13
|
`));
|
|
13
14
|
//#endregion
|
|
14
15
|
export { SideBarDivider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_SideBar_constants = require("../../../../SideBar.constants.cjs");
|
|
2
3
|
const require_SideBar_utils = require("../../../../SideBar.utils.cjs");
|
|
3
4
|
let styled_components = require("styled-components");
|
|
4
5
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -6,10 +7,10 @@ styled_components = require_runtime.__toESM(styled_components, 1);
|
|
|
6
7
|
var FooterMetadata = styled_components.default.div.withConfig({
|
|
7
8
|
displayName: "MetaDatastyle__FooterMetadata",
|
|
8
9
|
componentId: "RedisUI__sc-1372jkw-0"
|
|
9
|
-
})(["display:flex;position:relative;flex-direction:column;justify-content:flex-end;overflow:hidden;", ""], () => require_SideBar_utils.useStateStyle((theme) => styled_components.css`
|
|
10
|
-
padding: ${
|
|
11
|
-
visibility: ${theme.footer.meta.visibility};
|
|
12
|
-
white-space: ${theme.footer.meta.whiteSpace};
|
|
10
|
+
})(["display:flex;position:relative;flex-direction:column;justify-content:flex-end;overflow:hidden;", ""], () => require_SideBar_utils.useStateStyle((theme, state) => styled_components.css`
|
|
11
|
+
padding: ${require_SideBar_constants.SIDEBAR_CONSTANTS.footer.meta.padding};
|
|
12
|
+
visibility: ${theme.footer.meta.visibility[state]};
|
|
13
|
+
white-space: ${theme.footer.meta.whiteSpace[state]};
|
|
13
14
|
`));
|
|
14
15
|
//#endregion
|
|
15
16
|
exports.FooterMetadata = FooterMetadata;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { SIDEBAR_CONSTANTS } from "../../../../SideBar.constants.js";
|
|
1
2
|
import { useStateStyle } from "../../../../SideBar.utils.js";
|
|
2
3
|
import _styled, { css } from "styled-components";
|
|
3
4
|
//#region src/SideBar/components/Footer/components/MetaData/MetaData.style.ts
|
|
4
5
|
var FooterMetadata = _styled.div.withConfig({
|
|
5
6
|
displayName: "MetaDatastyle__FooterMetadata",
|
|
6
7
|
componentId: "RedisUI__sc-1372jkw-0"
|
|
7
|
-
})(["display:flex;position:relative;flex-direction:column;justify-content:flex-end;overflow:hidden;", ""], () => useStateStyle((theme) => css`
|
|
8
|
-
padding: ${
|
|
9
|
-
visibility: ${theme.footer.meta.visibility};
|
|
10
|
-
white-space: ${theme.footer.meta.whiteSpace};
|
|
8
|
+
})(["display:flex;position:relative;flex-direction:column;justify-content:flex-end;overflow:hidden;", ""], () => useStateStyle((theme, state) => css`
|
|
9
|
+
padding: ${SIDEBAR_CONSTANTS.footer.meta.padding};
|
|
10
|
+
visibility: ${theme.footer.meta.visibility[state]};
|
|
11
|
+
white-space: ${theme.footer.meta.whiteSpace[state]};
|
|
11
12
|
`));
|
|
12
13
|
//#endregion
|
|
13
14
|
export { FooterMetadata };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_Typography = require("../../../../../Typography/Typography.cjs");
|
|
3
|
+
const require_SideBar_constants = require("../../../../SideBar.constants.cjs");
|
|
3
4
|
const require_SideBar_utils = require("../../../../SideBar.utils.cjs");
|
|
4
5
|
let styled_components = require("styled-components");
|
|
5
6
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -7,9 +8,7 @@ styled_components = require_runtime.__toESM(styled_components, 1);
|
|
|
7
8
|
var Container = styled_components.default.div.withConfig({
|
|
8
9
|
displayName: "Titlestyle__Container",
|
|
9
10
|
componentId: "RedisUI__sc-1qd2bt1-0"
|
|
10
|
-
})(["display:block;overflow:hidden;", ""],
|
|
11
|
-
padding: ${theme.groupTitle.padding};
|
|
12
|
-
`));
|
|
11
|
+
})(["display:block;overflow:hidden;padding:", ";"], require_SideBar_constants.SIDEBAR_CONSTANTS.groupTitle.padding);
|
|
13
12
|
var Label = (0, styled_components.default)(require_Typography.default.Body).withConfig({
|
|
14
13
|
displayName: "Titlestyle__Label",
|
|
15
14
|
componentId: "RedisUI__sc-1qd2bt1-1"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import Typography from "../../../../../Typography/Typography.js";
|
|
2
|
+
import { SIDEBAR_CONSTANTS } from "../../../../SideBar.constants.js";
|
|
2
3
|
import { useStateStyle } from "../../../../SideBar.utils.js";
|
|
3
4
|
import _styled, { css } from "styled-components";
|
|
4
5
|
//#region src/SideBar/components/Group/components/Title/Title.style.ts
|
|
5
6
|
var Container = _styled.div.withConfig({
|
|
6
7
|
displayName: "Titlestyle__Container",
|
|
7
8
|
componentId: "RedisUI__sc-1qd2bt1-0"
|
|
8
|
-
})(["display:block;overflow:hidden;", ""],
|
|
9
|
-
padding: ${theme.groupTitle.padding};
|
|
10
|
-
`));
|
|
9
|
+
})(["display:block;overflow:hidden;padding:", ";"], SIDEBAR_CONSTANTS.groupTitle.padding);
|
|
11
10
|
var Label = _styled(Typography.Body).withConfig({
|
|
12
11
|
displayName: "Titlestyle__Label",
|
|
13
12
|
componentId: "RedisUI__sc-1qd2bt1-1"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_SideBar_constants = require("../../SideBar.constants.cjs");
|
|
2
3
|
const require_SideBar_utils = require("../../SideBar.utils.cjs");
|
|
3
4
|
let styled_components = require("styled-components");
|
|
4
5
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -8,9 +9,9 @@ var SideBarHeader = styled_components.default.div.withConfig({
|
|
|
8
9
|
displayName: "Headerstyle__SideBarHeader",
|
|
9
10
|
componentId: "RedisUI__sc-6wicp7-0"
|
|
10
11
|
})(["flex:none;width:100%;display:flex;position:relative;align-items:center;", ""], () => require_SideBar_utils.useStateStyle((theme) => styled_components.css`
|
|
11
|
-
height: ${
|
|
12
|
-
box-shadow: 0px ${
|
|
13
|
-
margin: ${
|
|
12
|
+
height: ${require_SideBar_constants.SIDEBAR_CONSTANTS.header.height};
|
|
13
|
+
box-shadow: 0px ${require_SideBar_constants.SIDEBAR_CONSTANTS.divider.thickness} 0px 0px ${theme.header.dividerColor};
|
|
14
|
+
margin: ${require_SideBar_constants.SIDEBAR_CONSTANTS.header.margin};
|
|
14
15
|
`));
|
|
15
16
|
var SideBarHeaderContent = styled_components.default.div.withConfig({
|
|
16
17
|
displayName: "Headerstyle__SideBarHeaderContent",
|
|
@@ -25,10 +26,10 @@ var SideBarToggleButton = styled_components.default.button.withConfig({
|
|
|
25
26
|
";& > svg{transition:0.3s;transform:",
|
|
26
27
|
";@media (prefers-reduced-motion:reduce){transition:none;}}"
|
|
27
28
|
], ({ isExpanded }) => require_SideBar_utils.useStateStyle((theme) => styled_components.css`
|
|
28
|
-
width: ${
|
|
29
|
-
height: ${
|
|
29
|
+
width: ${require_SideBar_constants.SIDEBAR_CONSTANTS.collapseButton.size};
|
|
30
|
+
height: ${require_SideBar_constants.SIDEBAR_CONSTANTS.collapseButton.size};
|
|
30
31
|
transition: all 0.3s ease;
|
|
31
|
-
right: ${
|
|
32
|
+
right: ${theme.collapseButton.right[isExpanded ? "expanded" : "collapsed"]};
|
|
32
33
|
|
|
33
34
|
@media (prefers-reduced-motion: reduce) {
|
|
34
35
|
transition: none;
|
|
@@ -38,8 +39,8 @@ var SideBarToggleButton = styled_components.default.button.withConfig({
|
|
|
38
39
|
// half-width background + shadow
|
|
39
40
|
filter: drop-shadow(${theme.collapseButton.filterShadow});
|
|
40
41
|
background-color: ${theme.bgColor};
|
|
41
|
-
border-radius: ${
|
|
42
|
-
border: ${
|
|
42
|
+
border-radius: ${require_SideBar_constants.SIDEBAR_CONSTANTS.collapseButton.borderRadius};
|
|
43
|
+
border: ${theme.collapseButton.border[isExpanded ? "expanded" : "collapsed"]};
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
color: ${theme.collapseButton.iconColor};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SIDEBAR_CONSTANTS } from "../../SideBar.constants.js";
|
|
1
2
|
import { useStateStyle } from "../../SideBar.utils.js";
|
|
2
3
|
import _styled, { css } from "styled-components";
|
|
3
4
|
import { getFocusStyle } from "@redis-ui/styles";
|
|
@@ -6,9 +7,9 @@ var SideBarHeader = _styled.div.withConfig({
|
|
|
6
7
|
displayName: "Headerstyle__SideBarHeader",
|
|
7
8
|
componentId: "RedisUI__sc-6wicp7-0"
|
|
8
9
|
})(["flex:none;width:100%;display:flex;position:relative;align-items:center;", ""], () => useStateStyle((theme) => css`
|
|
9
|
-
height: ${
|
|
10
|
-
box-shadow: 0px ${
|
|
11
|
-
margin: ${
|
|
10
|
+
height: ${SIDEBAR_CONSTANTS.header.height};
|
|
11
|
+
box-shadow: 0px ${SIDEBAR_CONSTANTS.divider.thickness} 0px 0px ${theme.header.dividerColor};
|
|
12
|
+
margin: ${SIDEBAR_CONSTANTS.header.margin};
|
|
12
13
|
`));
|
|
13
14
|
var SideBarHeaderContent = _styled.div.withConfig({
|
|
14
15
|
displayName: "Headerstyle__SideBarHeaderContent",
|
|
@@ -23,10 +24,10 @@ var SideBarToggleButton = _styled.button.withConfig({
|
|
|
23
24
|
";& > svg{transition:0.3s;transform:",
|
|
24
25
|
";@media (prefers-reduced-motion:reduce){transition:none;}}"
|
|
25
26
|
], ({ isExpanded }) => useStateStyle((theme) => css`
|
|
26
|
-
width: ${
|
|
27
|
-
height: ${
|
|
27
|
+
width: ${SIDEBAR_CONSTANTS.collapseButton.size};
|
|
28
|
+
height: ${SIDEBAR_CONSTANTS.collapseButton.size};
|
|
28
29
|
transition: all 0.3s ease;
|
|
29
|
-
right: ${
|
|
30
|
+
right: ${theme.collapseButton.right[isExpanded ? "expanded" : "collapsed"]};
|
|
30
31
|
|
|
31
32
|
@media (prefers-reduced-motion: reduce) {
|
|
32
33
|
transition: none;
|
|
@@ -36,8 +37,8 @@ var SideBarToggleButton = _styled.button.withConfig({
|
|
|
36
37
|
// half-width background + shadow
|
|
37
38
|
filter: drop-shadow(${theme.collapseButton.filterShadow});
|
|
38
39
|
background-color: ${theme.bgColor};
|
|
39
|
-
border-radius: ${
|
|
40
|
-
border: ${
|
|
40
|
+
border-radius: ${SIDEBAR_CONSTANTS.collapseButton.borderRadius};
|
|
41
|
+
border: ${theme.collapseButton.border[isExpanded ? "expanded" : "collapsed"]};
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
color: ${theme.collapseButton.iconColor};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_css_utils = require("../../../Helpers/css.utils.cjs");
|
|
3
3
|
const require_Tooltip = require("../../../Tooltip/Tooltip.cjs");
|
|
4
|
+
const require_SideBar_constants = require("../../SideBar.constants.cjs");
|
|
4
5
|
const require_SideBar_utils = require("../../SideBar.utils.cjs");
|
|
5
6
|
let styled_components = require("styled-components");
|
|
6
7
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -20,16 +21,16 @@ var SideBarItem = styled_components.default.li.withConfig({
|
|
|
20
21
|
return require_SideBar_utils.useStateStyle(({ item: theme }, state) => {
|
|
21
22
|
const { states } = theme;
|
|
22
23
|
return styled_components.css`
|
|
23
|
-
margin: ${
|
|
24
|
+
margin: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.margin};
|
|
24
25
|
${state === "expanded" && styled_components.css`
|
|
25
26
|
:has(> button) {
|
|
26
|
-
margin-inline-end: ${
|
|
27
|
+
margin-inline-end: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.itemWithButtonOffset};
|
|
27
28
|
}
|
|
28
29
|
`}
|
|
29
|
-
height: ${
|
|
30
|
-
padding: ${
|
|
31
|
-
border-radius: ${
|
|
32
|
-
gap: ${
|
|
30
|
+
height: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.height};
|
|
31
|
+
padding: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.padding};
|
|
32
|
+
border-radius: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.borderRadius};
|
|
33
|
+
gap: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.gap};
|
|
33
34
|
|
|
34
35
|
& {
|
|
35
36
|
${require_css_utils.styleFromTokens({
|
|
@@ -57,12 +58,12 @@ var SideBarItem = styled_components.default.li.withConfig({
|
|
|
57
58
|
&[data-state='active']::before {
|
|
58
59
|
content: '';
|
|
59
60
|
position: absolute;
|
|
60
|
-
left: ${
|
|
61
|
-
top: ${
|
|
62
|
-
bottom: ${
|
|
63
|
-
width: ${
|
|
61
|
+
left: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.left};
|
|
62
|
+
top: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.top};
|
|
63
|
+
bottom: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.bottom};
|
|
64
|
+
width: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.width};
|
|
64
65
|
background-color: ${theme.activeIndicator.bgColor};
|
|
65
|
-
border-radius: ${
|
|
66
|
+
border-radius: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
|
|
66
67
|
}
|
|
67
68
|
`;
|
|
68
69
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { styleFromTokens, tokenMaps } from "../../../Helpers/css.utils.js";
|
|
2
2
|
import Tooltip from "../../../Tooltip/Tooltip.js";
|
|
3
|
+
import { SIDEBAR_CONSTANTS } from "../../SideBar.constants.js";
|
|
3
4
|
import { useStateStyle } from "../../SideBar.utils.js";
|
|
4
5
|
import _styled, { css } from "styled-components";
|
|
5
6
|
import { useTheme } from "@redis-ui/styles";
|
|
@@ -18,16 +19,16 @@ var SideBarItem = _styled.li.withConfig({
|
|
|
18
19
|
return useStateStyle(({ item: theme }, state) => {
|
|
19
20
|
const { states } = theme;
|
|
20
21
|
return css`
|
|
21
|
-
margin: ${
|
|
22
|
+
margin: ${SIDEBAR_CONSTANTS.item.margin};
|
|
22
23
|
${state === "expanded" && css`
|
|
23
24
|
:has(> button) {
|
|
24
|
-
margin-inline-end: ${
|
|
25
|
+
margin-inline-end: ${SIDEBAR_CONSTANTS.item.itemWithButtonOffset};
|
|
25
26
|
}
|
|
26
27
|
`}
|
|
27
|
-
height: ${
|
|
28
|
-
padding: ${
|
|
29
|
-
border-radius: ${
|
|
30
|
-
gap: ${
|
|
28
|
+
height: ${SIDEBAR_CONSTANTS.item.height};
|
|
29
|
+
padding: ${SIDEBAR_CONSTANTS.item.padding};
|
|
30
|
+
border-radius: ${SIDEBAR_CONSTANTS.item.borderRadius};
|
|
31
|
+
gap: ${SIDEBAR_CONSTANTS.item.gap};
|
|
31
32
|
|
|
32
33
|
& {
|
|
33
34
|
${styleFromTokens({
|
|
@@ -55,12 +56,12 @@ var SideBarItem = _styled.li.withConfig({
|
|
|
55
56
|
&[data-state='active']::before {
|
|
56
57
|
content: '';
|
|
57
58
|
position: absolute;
|
|
58
|
-
left: ${
|
|
59
|
-
top: ${
|
|
60
|
-
bottom: ${
|
|
61
|
-
width: ${
|
|
59
|
+
left: ${SIDEBAR_CONSTANTS.item.activeIndicator.left};
|
|
60
|
+
top: ${SIDEBAR_CONSTANTS.item.activeIndicator.top};
|
|
61
|
+
bottom: ${SIDEBAR_CONSTANTS.item.activeIndicator.bottom};
|
|
62
|
+
width: ${SIDEBAR_CONSTANTS.item.activeIndicator.width};
|
|
62
63
|
background-color: ${theme.activeIndicator.bgColor};
|
|
63
|
-
border-radius: ${
|
|
64
|
+
border-radius: ${SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
|
|
64
65
|
}
|
|
65
66
|
`;
|
|
66
67
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_ActionIconButton = require("../../../../../Button/ActionIconButton/ActionIconButton.cjs");
|
|
3
|
+
const require_SideBar_constants = require("../../../../SideBar.constants.cjs");
|
|
3
4
|
const require_SideBar_utils = require("../../../../SideBar.utils.cjs");
|
|
4
5
|
let styled_components = require("styled-components");
|
|
5
6
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
@@ -15,7 +16,7 @@ var SideBarItemButton = (0, styled_components.default)(require_ActionIconButton.
|
|
|
15
16
|
], ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "1" : "0", ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "auto" : "none", () => require_SideBar_utils.useStateStyle((theme) => styled_components.css`
|
|
16
17
|
background-color: ${theme.item.button.bgColor};
|
|
17
18
|
border-color: ${theme.item.button.borderColor};
|
|
18
|
-
border-width: ${
|
|
19
|
+
border-width: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.button.borderSize};
|
|
19
20
|
color: ${theme.item.button.textColor};
|
|
20
21
|
border-style: solid;
|
|
21
22
|
`));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ActionIconButton from "../../../../../Button/ActionIconButton/ActionIconButton.js";
|
|
2
|
+
import { SIDEBAR_CONSTANTS } from "../../../../SideBar.constants.js";
|
|
2
3
|
import { useStateStyle } from "../../../../SideBar.utils.js";
|
|
3
4
|
import _styled, { css } from "styled-components";
|
|
4
5
|
//#region src/SideBar/components/Item/components/Button/Button.style.ts
|
|
@@ -13,7 +14,7 @@ var SideBarItemButton = _styled(ActionIconButton).withConfig({
|
|
|
13
14
|
], ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "1" : "0", ({ $isExpanded, $transitionEnd }) => $isExpanded && $transitionEnd ? "auto" : "none", () => useStateStyle((theme) => css`
|
|
14
15
|
background-color: ${theme.item.button.bgColor};
|
|
15
16
|
border-color: ${theme.item.button.borderColor};
|
|
16
|
-
border-width: ${
|
|
17
|
+
border-width: ${SIDEBAR_CONSTANTS.item.button.borderSize};
|
|
17
18
|
color: ${theme.item.button.textColor};
|
|
18
19
|
border-style: solid;
|
|
19
20
|
`));
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const
|
|
2
|
+
const require_SideBar_constants = require("../../SideBar.constants.cjs");
|
|
3
3
|
let styled_components = require("styled-components");
|
|
4
4
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
5
5
|
//#region src/SideBar/components/SideBarLogo/SideBarLogo.style.ts
|
|
6
6
|
var SideBarLogo = styled_components.default.span.withConfig({
|
|
7
7
|
displayName: "SideBarLogostyle__SideBarLogo",
|
|
8
8
|
componentId: "RedisUI__sc-1u1jhxg-0"
|
|
9
|
-
})(["display:flex;z-index:1;transition:padding-left 0.2s;@media (prefers-reduced-motion:reduce){transition:none;}"
|
|
10
|
-
padding-left: ${theme.logo.offset};
|
|
11
|
-
`));
|
|
9
|
+
})(["display:flex;z-index:1;transition:padding-left 0.2s;padding-left:", ";@media (prefers-reduced-motion:reduce){transition:none;}"], require_SideBar_constants.SIDEBAR_CONSTANTS.logo.offset);
|
|
12
10
|
//#endregion
|
|
13
11
|
exports.SideBarLogo = SideBarLogo;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import _styled
|
|
1
|
+
import { SIDEBAR_CONSTANTS } from "../../SideBar.constants.js";
|
|
2
|
+
import _styled from "styled-components";
|
|
3
3
|
//#region src/SideBar/components/SideBarLogo/SideBarLogo.style.ts
|
|
4
4
|
var SideBarLogo = _styled.span.withConfig({
|
|
5
5
|
displayName: "SideBarLogostyle__SideBarLogo",
|
|
6
6
|
componentId: "RedisUI__sc-1u1jhxg-0"
|
|
7
|
-
})(["display:flex;z-index:1;transition:padding-left 0.2s;@media (prefers-reduced-motion:reduce){transition:none;}"
|
|
8
|
-
padding-left: ${theme.logo.offset};
|
|
9
|
-
`));
|
|
7
|
+
})(["display:flex;z-index:1;transition:padding-left 0.2s;padding-left:", ";@media (prefers-reduced-motion:reduce){transition:none;}"], SIDEBAR_CONSTANTS.logo.offset);
|
|
10
8
|
//#endregion
|
|
11
9
|
export { SideBarLogo };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_react_toastify_esm = require("../
|
|
3
|
-
;/* empty css
|
|
2
|
+
const require_react_toastify_esm = require("../node_modules/react-toastify/dist/react-toastify.esm.cjs");
|
|
3
|
+
;/* empty css */
|
|
4
4
|
let styled_components = require("styled-components");
|
|
5
5
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
6
6
|
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q } from "../
|
|
2
|
-
/* empty css
|
|
1
|
+
import { Q } from "../node_modules/react-toastify/dist/react-toastify.esm.js";
|
|
2
|
+
/* empty css */
|
|
3
3
|
import _styled from "styled-components";
|
|
4
4
|
import { useTheme } from "@redis-ui/styles";
|
|
5
5
|
//#region src/Toast/Toaster.style.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_react_toastify_esm = require("../../
|
|
1
|
+
const require_react_toastify_esm = require("../../node_modules/react-toastify/dist/react-toastify.esm.cjs");
|
|
2
2
|
//#region src/Toast/core/mapping.helpers.tsx
|
|
3
3
|
/**
|
|
4
4
|
* This file maps toastify api to redis-ui api
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B } from "../../
|
|
1
|
+
import { B } from "../../node_modules/react-toastify/dist/react-toastify.esm.js";
|
|
2
2
|
//#region src/Toast/core/mapping.helpers.tsx
|
|
3
3
|
/**
|
|
4
4
|
* This file maps toastify api to redis-ui api
|
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
8
|
var __exportAll = (all, no_symbols) => {
|
|
10
9
|
let target = {};
|
|
11
10
|
for (var name in all) __defProp(target, name, {
|
|
@@ -30,6 +29,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
29
|
enumerable: true
|
|
31
30
|
}) : target, mod));
|
|
32
31
|
//#endregion
|
|
33
|
-
exports.__commonJSMin = __commonJSMin;
|
|
34
32
|
exports.__exportAll = __exportAll;
|
|
35
33
|
exports.__toESM = __toESM;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
3
|
var __exportAll = (all, no_symbols) => {
|
|
5
4
|
let target = {};
|
|
6
5
|
for (var name in all) __defProp(target, name, {
|
|
@@ -11,4 +10,4 @@ var __exportAll = (all, no_symbols) => {
|
|
|
11
10
|
return target;
|
|
12
11
|
};
|
|
13
12
|
//#endregion
|
|
14
|
-
export {
|
|
13
|
+
export { __exportAll };
|
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ const require_Link = require("./Link/Link.cjs");
|
|
|
26
26
|
const require_react_utils = require("./Helpers/react.utils.cjs");
|
|
27
27
|
const require_generateId = require("./Helpers/generateId.cjs");
|
|
28
28
|
const require_debounce = require("./Helpers/debounce.cjs");
|
|
29
|
+
const require_throttle = require("./Helpers/throttle.cjs");
|
|
29
30
|
const require_SharedId_context = require("./Helpers/contexts/SharedId.context.cjs");
|
|
30
31
|
const require_PrimitiveContextState = require("./Helpers/contexts/PrimitiveContextState.cjs");
|
|
31
32
|
const require_NullableContext = require("./Helpers/contexts/NullableContext.cjs");
|
|
@@ -283,6 +284,7 @@ exports.isTextualNode = require_react_utils.isTextualNode;
|
|
|
283
284
|
exports.memoWithGenerics = require_react_utils.memoWithGenerics;
|
|
284
285
|
exports.textButtonSizes = require_TextButton_types.textButtonSizes;
|
|
285
286
|
exports.textButtonVariants = require_TextButton_types.textButtonVariants;
|
|
287
|
+
exports.throttle = require_throttle.throttle;
|
|
286
288
|
exports.toast = require_core.toast;
|
|
287
289
|
exports.typographyColors = require_Typography_types.typographyColors;
|
|
288
290
|
exports.useEllipsisTooltip = require_useEllipsisTooltip.useEllipsisTooltip;
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import Link from "./Link/Link.js";
|
|
|
24
24
|
import { childrenToString, combineHandlers, forwardRefWithGenerics, handlePreventDefault, handleStopPropagation, isFragmentElement, isTextualNode, memoWithGenerics } from "./Helpers/react.utils.js";
|
|
25
25
|
import { generateId, useGeneratedId } from "./Helpers/generateId.js";
|
|
26
26
|
import { debounce } from "./Helpers/debounce.js";
|
|
27
|
+
import { throttle } from "./Helpers/throttle.js";
|
|
27
28
|
import { SharedIdProvider, SharedIdTransProvider, useSharedId } from "./Helpers/contexts/SharedId.context.js";
|
|
28
29
|
import { createPrimitiveContextState } from "./Helpers/contexts/PrimitiveContextState.js";
|
|
29
30
|
import { createNullableContext } from "./Helpers/contexts/NullableContext.js";
|
|
@@ -110,4 +111,4 @@ import { ProgressBar } from "./ProgressBar/ProgressBar.js";
|
|
|
110
111
|
import { ProfileIcon_style_exports } from "./ProfileIcon/ProfileIcon.style.js";
|
|
111
112
|
import ProfileIcon from "./ProfileIcon/ProfileIcon.js";
|
|
112
113
|
import Slider from "./Slider/Slider.js";
|
|
113
|
-
export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardVariants, childrenToString, combineHandlers, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
|
|
114
|
+
export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardVariants, childrenToString, combineHandlers, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, throttle, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const require_runtime = require("
|
|
3
|
-
const require_clsx = require("
|
|
2
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_clsx = require("../../clsx/dist/clsx.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
|
-
//#region node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
6
|
+
//#region ../../node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
7
7
|
var c = (e) => "number" == typeof e && !isNaN(e), d = (e) => "string" == typeof e, u = (e) => "function" == typeof e, p = (e) => d(e) || u(e) ? e : null, m = (e) => (0, react.isValidElement)(e) || d(e) || u(e) || c(e);
|
|
8
8
|
function f(e, t, n) {
|
|
9
9
|
void 0 === n && (n = 300);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "
|
|
2
|
+
import clsx from "../../clsx/dist/clsx.js";
|
|
3
3
|
import React, { cloneElement, isValidElement, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
|
-
//#region node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
4
|
+
//#region ../../node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
5
5
|
var c = (e) => "number" == typeof e && !isNaN(e), d = (e) => "string" == typeof e, u = (e) => "function" == typeof e, p = (e) => d(e) || u(e) ? e : null, m = (e) => isValidElement(e) || d(e) || u(e) || c(e);
|
|
6
6
|
function f(e, t, n) {
|
|
7
7
|
void 0 === n && (n = 300);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-ui/components",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "47.6.
|
|
4
|
+
"version": "47.6.3",
|
|
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",
|
|
33
|
-
"@redis-ui/styles": "^
|
|
33
|
+
"@redis-ui/styles": "^17.0.0",
|
|
34
34
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
35
35
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
36
36
|
"styled-components": "^5.0.0"
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"virtua": "^0.36.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/lodash": "^4.17.24",
|
|
67
66
|
"@types/styled-components": "^5.1.26",
|
|
68
67
|
"vi-canvas-mock": "^1.0.0",
|
|
69
68
|
"vite-plugin-babel-macros": "^1.0.6",
|
|
@@ -29,7 +29,7 @@ import { ButtonGroup } from '@redis-ui/components';
|
|
|
29
29
|
|
|
30
30
|
| Prop | Type | Default | Description |
|
|
31
31
|
|------|------|---------|-------------|
|
|
32
|
-
| `isSelected` | `boolean` | - | Marks the button as selected
|
|
32
|
+
| `isSelected` | `boolean` | - | Marks the button as selected. Applies the selected styling and sets `aria-pressed` to expose the toggle state to assistive technology. When omitted, no `aria-pressed` attribute is rendered (plain, non-toggle button). |
|
|
33
33
|
| `onClick` | `(e: React.MouseEvent<HTMLButtonElement>) => void` | - | Click handler used to toggle selection. |
|
|
34
34
|
| `children` | `React.ReactNode` | - | Button content. |
|
|
35
35
|
|
|
@@ -123,5 +123,6 @@ const isSelected = (value: string) => selected.includes(value);
|
|
|
123
123
|
|
|
124
124
|
- `ButtonGroup` has no internal selection logic; manage selected state in the parent component.
|
|
125
125
|
- `ButtonGroup.Button` is styled as a native `button` and can be disabled through the standard `disabled` attribute.
|
|
126
|
+
- `ButtonGroup.Button` follows the WAI-ARIA toggle button pattern: passing `isSelected` sets `aria-pressed` (`true`/`false`) so screen readers announce the selected state. This works for both single- and multi-select usages. Buttons rendered without `isSelected` get no `aria-pressed` and remain plain buttons.
|
|
126
127
|
- `ButtonGroup.Icon` always renders the icon at `size="M"` and inherits its color from the surrounding text (`currentColor`).
|
|
127
128
|
- If you need to pass props to an icon component, declare it outside the render path or wrap it in `useMemo`; avoid inline arrow functions because they re-create the icon on every parent render.
|
|
@@ -550,3 +550,4 @@ const [expanded, setExpanded] = useState(true);
|
|
|
550
550
|
- `SideBar.Button` is the root collapsible action button, and it defaults to `PlusIcon` when no collapsed icon is provided.
|
|
551
551
|
- `SideBar.Group` wraps a section's `Group.Title` (optional) and items so the title and the items stay together as one logical unit.
|
|
552
552
|
- `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.
|
|
553
|
+
- **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.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_lodash$1 = require("../node_modules/lodash/lodash.cjs");
|
|
3
|
-
let styled_components = require("styled-components");
|
|
4
|
-
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let react = require("react");
|
|
7
|
-
//#region src/SideBar/SideBarThemeProvider.tsx
|
|
8
|
-
var import_lodash = require_lodash$1.default;
|
|
9
|
-
/**
|
|
10
|
-
* Modifies sideBar tokens to make all states valid
|
|
11
|
-
*/
|
|
12
|
-
var SideBarThemeProvider = ({ children }) => {
|
|
13
|
-
const theme = (0, _redislabsdev_redis_ui_styles.useTheme)();
|
|
14
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(styled_components.ThemeProvider, {
|
|
15
|
-
theme: (0, react.useMemo)(() => {
|
|
16
|
-
const sideBarTheme = { ...theme.components.sideBar };
|
|
17
|
-
sideBarTheme.expanded = (0, import_lodash.merge)({}, sideBarTheme.collapsed, sideBarTheme.expanded);
|
|
18
|
-
return {
|
|
19
|
-
...theme,
|
|
20
|
-
components: {
|
|
21
|
-
...theme.components,
|
|
22
|
-
sideBar: sideBarTheme
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}, [theme]),
|
|
26
|
-
children
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.SideBarThemeProvider = SideBarThemeProvider;
|