@redis-ui/components 51.4.0 → 51.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/Hero/Hero.cjs +46 -0
  2. package/dist/Hero/Hero.d.ts +11 -0
  3. package/dist/Hero/Hero.js +46 -0
  4. package/dist/Hero/Hero.types.d.ts +17 -0
  5. package/dist/Hero/Hero.types.js +1 -0
  6. package/dist/Hero/components/Actions/Actions.cjs +11 -0
  7. package/dist/Hero/components/Actions/Actions.d.ts +3 -0
  8. package/dist/Hero/components/Actions/Actions.js +11 -0
  9. package/dist/Hero/components/Compose/Compose.cjs +6 -0
  10. package/dist/Hero/components/Compose/Compose.d.ts +3 -0
  11. package/dist/Hero/components/Compose/Compose.js +6 -0
  12. package/dist/Hero/components/Compose/Compose.style.cjs +11 -0
  13. package/dist/Hero/components/Compose/Compose.style.d.ts +1 -0
  14. package/dist/Hero/components/Compose/Compose.style.js +9 -0
  15. package/dist/Hero/components/Compose/Compose.types.d.ts +2 -0
  16. package/dist/Hero/components/Compose/Compose.types.js +1 -0
  17. package/dist/Hero/components/Content/Content.cjs +12 -0
  18. package/dist/Hero/components/Content/Content.d.ts +3 -0
  19. package/dist/Hero/components/Content/Content.js +12 -0
  20. package/dist/Hero/components/Footnote/Footnote.cjs +10 -0
  21. package/dist/Hero/components/Footnote/Footnote.d.ts +3 -0
  22. package/dist/Hero/components/Footnote/Footnote.js +10 -0
  23. package/dist/Hero/components/Footnote/Footnote.style.cjs +11 -0
  24. package/dist/Hero/components/Footnote/Footnote.style.d.ts +1 -0
  25. package/dist/Hero/components/Footnote/Footnote.style.js +9 -0
  26. package/dist/Hero/components/Heading/Heading.cjs +10 -0
  27. package/dist/Hero/components/Heading/Heading.d.ts +3 -0
  28. package/dist/Hero/components/Heading/Heading.js +10 -0
  29. package/dist/Hero/components/Media/Media.cjs +6 -0
  30. package/dist/Hero/components/Media/Media.d.ts +3 -0
  31. package/dist/Hero/components/Media/Media.js +6 -0
  32. package/dist/Hero/components/Media/Media.style.cjs +11 -0
  33. package/dist/Hero/components/Media/Media.style.d.ts +1 -0
  34. package/dist/Hero/components/Media/Media.style.js +9 -0
  35. package/dist/Hero/components/Subtitle/Subtitle.cjs +10 -0
  36. package/dist/Hero/components/Subtitle/Subtitle.d.ts +3 -0
  37. package/dist/Hero/components/Subtitle/Subtitle.js +10 -0
  38. package/dist/Hero/components/Subtitle/Subtitle.style.cjs +11 -0
  39. package/dist/Hero/components/Subtitle/Subtitle.style.d.ts +1 -0
  40. package/dist/Hero/components/Subtitle/Subtitle.style.js +9 -0
  41. package/dist/Hero/index.d.ts +2 -0
  42. package/dist/Hero/index.js +2 -0
  43. package/dist/SideBar/SideBar.cjs +5 -2
  44. package/dist/SideBar/SideBar.d.ts +2 -1
  45. package/dist/SideBar/SideBar.js +5 -2
  46. package/dist/SideBar/SideBar.types.d.ts +3 -0
  47. package/dist/SideBar/components/CollapseButton/CollapseButton.cjs +32 -0
  48. package/dist/SideBar/components/CollapseButton/CollapseButton.d.ts +3 -0
  49. package/dist/SideBar/components/CollapseButton/CollapseButton.js +32 -0
  50. package/dist/SideBar/components/CollapseButton/CollapseButton.style.cjs +16 -0
  51. package/dist/SideBar/components/CollapseButton/CollapseButton.style.d.ts +4 -0
  52. package/dist/SideBar/components/CollapseButton/CollapseButton.style.js +13 -0
  53. package/dist/SideBar/components/CollapseButton/CollapseButton.types.d.ts +8 -0
  54. package/dist/SideBar/components/CollapseButton/CollapseButton.types.js +1 -0
  55. package/dist/SideBar/components/Item/Item.cjs +3 -2
  56. package/dist/SideBar/components/Item/Item.js +3 -2
  57. package/dist/SideBar/components/Item/Item.style.cjs +13 -11
  58. package/dist/SideBar/components/Item/Item.style.d.ts +3 -1
  59. package/dist/SideBar/components/Item/Item.style.js +13 -11
  60. package/dist/index.cjs +6 -4
  61. package/dist/index.d.ts +1 -0
  62. package/dist/index.js +6 -5
  63. package/package.json +1 -1
  64. package/skills/redis-ui-components/SKILL.md +1 -0
  65. package/skills/redis-ui-components/references/Hero.md +157 -0
  66. package/skills/redis-ui-components/references/SideBar.md +60 -0
@@ -0,0 +1,46 @@
1
+ const require_FlexGroup = require("../Layouts/FlexGroup/FlexGroup.cjs");
2
+ const require_Compose = require("./components/Compose/Compose.cjs");
3
+ const require_Content = require("./components/Content/Content.cjs");
4
+ const require_Heading = require("./components/Heading/Heading.cjs");
5
+ const require_Subtitle = require("./components/Subtitle/Subtitle.cjs");
6
+ const require_Actions = require("./components/Actions/Actions.cjs");
7
+ const require_Footnote = require("./components/Footnote/Footnote.cjs");
8
+ const require_Media = require("./components/Media/Media.cjs");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ //#region src/Hero/Hero.tsx
11
+ var hasSlotContent = (node) => Array.isArray(node) ? node.some(hasSlotContent) : node != null && node !== false && node !== "";
12
+ var Hero = Object.assign(({ heading, subtitle, details, actions, footnote, media, ...composeProps }) => {
13
+ const hasCta = [
14
+ details,
15
+ actions,
16
+ footnote
17
+ ].some(hasSlotContent);
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Hero.Compose, {
19
+ ...composeProps,
20
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Hero.Content, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_FlexGroup.FlexGroup, {
21
+ direction: "column",
22
+ align: "start",
23
+ gap: "M",
24
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hero.Heading, { children: heading }), hasSlotContent(subtitle) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hero.Subtitle, { children: subtitle })]
25
+ }), hasCta && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_FlexGroup.FlexGroup, {
26
+ direction: "column",
27
+ align: "start",
28
+ gap: "M",
29
+ children: [
30
+ hasSlotContent(details) && details,
31
+ hasSlotContent(actions) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hero.Actions, { children: actions }),
32
+ hasSlotContent(footnote) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hero.Footnote, { children: footnote })
33
+ ]
34
+ })] }), hasSlotContent(media) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hero.Media, { children: media })]
35
+ });
36
+ }, {
37
+ Compose: require_Compose.default,
38
+ Content: require_Content.default,
39
+ Heading: require_Heading.default,
40
+ Subtitle: require_Subtitle.default,
41
+ Actions: require_Actions.default,
42
+ Footnote: require_Footnote.default,
43
+ Media: require_Media.default
44
+ });
45
+ //#endregion
46
+ exports.default = Hero;
@@ -0,0 +1,11 @@
1
+ import { HeroProps } from './Hero.types';
2
+ declare const Hero: (({ heading, subtitle, details, actions, footnote, media, ...composeProps }: HeroProps) => import("react/jsx-runtime").JSX.Element) & {
3
+ Compose: (props: import("./components/Compose/Compose.types").HeroComposeProps) => import("react/jsx-runtime").JSX.Element;
4
+ Content: (props: import("..").FlexGroupProps) => import("react/jsx-runtime").JSX.Element;
5
+ Heading: (props: import("..").TypographyHeadingProps) => import("react/jsx-runtime").JSX.Element;
6
+ Subtitle: (props: import("..").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
7
+ Actions: (props: import("..").FlexGroupProps) => import("react/jsx-runtime").JSX.Element;
8
+ Footnote: (props: import("..").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
9
+ Media: (props: import("..").ComposeElementProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
10
+ };
11
+ export default Hero;
@@ -0,0 +1,46 @@
1
+ import { FlexGroup } from "../Layouts/FlexGroup/FlexGroup.js";
2
+ import Compose from "./components/Compose/Compose.js";
3
+ import Content from "./components/Content/Content.js";
4
+ import Heading from "./components/Heading/Heading.js";
5
+ import Subtitle from "./components/Subtitle/Subtitle.js";
6
+ import Actions from "./components/Actions/Actions.js";
7
+ import Footnote from "./components/Footnote/Footnote.js";
8
+ import Media from "./components/Media/Media.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/Hero/Hero.tsx
11
+ var hasSlotContent = (node) => Array.isArray(node) ? node.some(hasSlotContent) : node != null && node !== false && node !== "";
12
+ var Hero = Object.assign(({ heading, subtitle, details, actions, footnote, media, ...composeProps }) => {
13
+ const hasCta = [
14
+ details,
15
+ actions,
16
+ footnote
17
+ ].some(hasSlotContent);
18
+ return /* @__PURE__ */ jsxs(Hero.Compose, {
19
+ ...composeProps,
20
+ children: [/* @__PURE__ */ jsxs(Hero.Content, { children: [/* @__PURE__ */ jsxs(FlexGroup, {
21
+ direction: "column",
22
+ align: "start",
23
+ gap: "M",
24
+ children: [/* @__PURE__ */ jsx(Hero.Heading, { children: heading }), hasSlotContent(subtitle) && /* @__PURE__ */ jsx(Hero.Subtitle, { children: subtitle })]
25
+ }), hasCta && /* @__PURE__ */ jsxs(FlexGroup, {
26
+ direction: "column",
27
+ align: "start",
28
+ gap: "M",
29
+ children: [
30
+ hasSlotContent(details) && details,
31
+ hasSlotContent(actions) && /* @__PURE__ */ jsx(Hero.Actions, { children: actions }),
32
+ hasSlotContent(footnote) && /* @__PURE__ */ jsx(Hero.Footnote, { children: footnote })
33
+ ]
34
+ })] }), hasSlotContent(media) && /* @__PURE__ */ jsx(Hero.Media, { children: media })]
35
+ });
36
+ }, {
37
+ Compose,
38
+ Content,
39
+ Heading,
40
+ Subtitle,
41
+ Actions,
42
+ Footnote,
43
+ Media
44
+ });
45
+ //#endregion
46
+ export { Hero as default };
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import { ChildFree, ComposeElementProps } from '../Helpers/common.types';
3
+ export interface HeroOwnProps {
4
+ /** Main claim, rendered as the page's `h1`. */
5
+ heading: ReactNode;
6
+ /** Supporting copy below the heading. */
7
+ subtitle?: ReactNode;
8
+ /** Extra content right above the actions, e.g. highlight rows or a row of logos. */
9
+ details?: ReactNode;
10
+ /** Call-to-action row below the copy. */
11
+ actions?: ReactNode;
12
+ /** Small note below the actions. */
13
+ footnote?: ReactNode;
14
+ /** Illustration in the trailing column (svg/img). */
15
+ media?: ReactNode;
16
+ }
17
+ export type HeroProps = HeroOwnProps & ChildFree<ComposeElementProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ const require_FlexGroup = require("../../../Layouts/FlexGroup/FlexGroup.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Actions/Actions.tsx
4
+ var Actions = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FlexGroup.FlexGroup, {
5
+ gap: "M",
6
+ align: "center",
7
+ wrap: true,
8
+ ...props
9
+ });
10
+ //#endregion
11
+ exports.default = Actions;
@@ -0,0 +1,3 @@
1
+ import { FlexGroupProps } from '../../../Layouts';
2
+ declare const Actions: (props: FlexGroupProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Actions;
@@ -0,0 +1,11 @@
1
+ import { FlexGroup } from "../../../Layouts/FlexGroup/FlexGroup.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Actions/Actions.tsx
4
+ var Actions = (props) => /* @__PURE__ */ jsx(FlexGroup, {
5
+ gap: "M",
6
+ align: "center",
7
+ wrap: true,
8
+ ...props
9
+ });
10
+ //#endregion
11
+ export { Actions as default };
@@ -0,0 +1,6 @@
1
+ const require_Compose_style = require("./Compose.style.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Compose/Compose.tsx
4
+ var Compose = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Compose_style.HeroContainer, { ...props });
5
+ //#endregion
6
+ exports.default = Compose;
@@ -0,0 +1,3 @@
1
+ import { HeroComposeProps } from './Compose.types';
2
+ declare const Compose: (props: HeroComposeProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Compose;
@@ -0,0 +1,6 @@
1
+ import { HeroContainer } from "./Compose.style.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Compose/Compose.tsx
4
+ var Compose = (props) => /* @__PURE__ */ jsx(HeroContainer, { ...props });
5
+ //#endregion
6
+ export { Compose as default };
@@ -0,0 +1,11 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ let styled_components = require("styled-components");
3
+ styled_components = require_runtime.__toESM(styled_components, 1);
4
+ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
5
+ //#region src/Hero/components/Compose/Compose.style.ts
6
+ var HeroContainer = styled_components.default.div.withConfig({
7
+ displayName: "Composestyle__HeroContainer",
8
+ componentId: "RedisUI__sc-126p7uz-0"
9
+ })(["display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:", ";align-items:start;@media (max-width:75rem){grid-template-columns:minmax(0,1fr);}"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200);
10
+ //#endregion
11
+ exports.HeroContainer = HeroContainer;
@@ -0,0 +1 @@
1
+ export declare const HeroContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import _styled from "styled-components";
2
+ import { useTheme } from "@redis-ui/styles";
3
+ //#region src/Hero/components/Compose/Compose.style.ts
4
+ var HeroContainer = _styled.div.withConfig({
5
+ displayName: "Composestyle__HeroContainer",
6
+ componentId: "RedisUI__sc-126p7uz-0"
7
+ })(["display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:", ";align-items:start;@media (max-width:75rem){grid-template-columns:minmax(0,1fr);}"], () => useTheme().core.space.space200);
8
+ //#endregion
9
+ export { HeroContainer };
@@ -0,0 +1,2 @@
1
+ import { ComposeElementProps } from '../../../Helpers/common.types';
2
+ export type HeroComposeProps = ComposeElementProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ const require_FlexGroup = require("../../../Layouts/FlexGroup/FlexGroup.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Content/Content.tsx
4
+ var Content = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FlexGroup.FlexGroup, {
5
+ direction: "column",
6
+ align: "start",
7
+ gap: "XL",
8
+ minWidth: "0",
9
+ ...props
10
+ });
11
+ //#endregion
12
+ exports.default = Content;
@@ -0,0 +1,3 @@
1
+ import { FlexGroupProps } from '../../../Layouts';
2
+ declare const Content: (props: FlexGroupProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Content;
@@ -0,0 +1,12 @@
1
+ import { FlexGroup } from "../../../Layouts/FlexGroup/FlexGroup.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Content/Content.tsx
4
+ var Content = (props) => /* @__PURE__ */ jsx(FlexGroup, {
5
+ direction: "column",
6
+ align: "start",
7
+ gap: "XL",
8
+ minWidth: "0",
9
+ ...props
10
+ });
11
+ //#endregion
12
+ export { Content as default };
@@ -0,0 +1,10 @@
1
+ const require_Footnote_style = require("./Footnote.style.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Footnote/Footnote.tsx
4
+ var Footnote = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Footnote_style.Footnote, {
5
+ size: "S",
6
+ color: "secondary",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ exports.default = Footnote;
@@ -0,0 +1,3 @@
1
+ import { TypographyBodyProps } from '../../../Typography';
2
+ declare const Footnote: (props: TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Footnote;
@@ -0,0 +1,10 @@
1
+ import { Footnote as Footnote$1 } from "./Footnote.style.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Footnote/Footnote.tsx
4
+ var Footnote = (props) => /* @__PURE__ */ jsx(Footnote$1, {
5
+ size: "S",
6
+ color: "secondary",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ export { Footnote as default };
@@ -0,0 +1,11 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Typography = require("../../../Typography/Typography.cjs");
3
+ let styled_components = require("styled-components");
4
+ styled_components = require_runtime.__toESM(styled_components, 1);
5
+ //#region src/Hero/components/Footnote/Footnote.style.ts
6
+ var Footnote = (0, styled_components.default)(require_Typography.default.Body).withConfig({
7
+ displayName: "Footnotestyle__Footnote",
8
+ componentId: "RedisUI__sc-120rs03-0"
9
+ })(["margin-block:0;max-width:60ch;text-wrap:pretty;"]);
10
+ //#endregion
11
+ exports.Footnote = Footnote;
@@ -0,0 +1 @@
1
+ export declare const Footnote: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../..").TypographyBodyProps & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import Typography from "../../../Typography/Typography.js";
2
+ import _styled from "styled-components";
3
+ //#region src/Hero/components/Footnote/Footnote.style.ts
4
+ var Footnote = _styled(Typography.Body).withConfig({
5
+ displayName: "Footnotestyle__Footnote",
6
+ componentId: "RedisUI__sc-120rs03-0"
7
+ })(["margin-block:0;max-width:60ch;text-wrap:pretty;"]);
8
+ //#endregion
9
+ export { Footnote };
@@ -0,0 +1,10 @@
1
+ const require_Typography = require("../../../Typography/Typography.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Heading/Heading.tsx
4
+ var Heading = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default.Heading, {
5
+ component: "h1",
6
+ size: "XL",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ exports.default = Heading;
@@ -0,0 +1,3 @@
1
+ import { TypographyHeadingProps } from '../../../Typography';
2
+ declare const Heading: (props: TypographyHeadingProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Heading;
@@ -0,0 +1,10 @@
1
+ import Typography from "../../../Typography/Typography.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Heading/Heading.tsx
4
+ var Heading = (props) => /* @__PURE__ */ jsx(Typography.Heading, {
5
+ component: "h1",
6
+ size: "XL",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ export { Heading as default };
@@ -0,0 +1,6 @@
1
+ const require_Media_style = require("./Media.style.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Media/Media.tsx
4
+ var Media = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Media_style.Media, { ...props });
5
+ //#endregion
6
+ exports.default = Media;
@@ -0,0 +1,3 @@
1
+ import { ComposeElementProps } from '../../../Helpers/common.types';
2
+ declare const Media: (props: ComposeElementProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default Media;
@@ -0,0 +1,6 @@
1
+ import { Media as Media$1 } from "./Media.style.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Media/Media.tsx
4
+ var Media = (props) => /* @__PURE__ */ jsx(Media$1, { ...props });
5
+ //#endregion
6
+ export { Media as default };
@@ -0,0 +1,11 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ let styled_components = require("styled-components");
3
+ styled_components = require_runtime.__toESM(styled_components, 1);
4
+ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
5
+ //#region src/Hero/components/Media/Media.style.ts
6
+ var Media = styled_components.default.div.withConfig({
7
+ displayName: "Mediastyle__Media",
8
+ componentId: "RedisUI__sc-1w3ogu0-0"
9
+ })(["display:grid;place-items:center;align-self:center;min-width:0;overflow:hidden;padding-inline:", ";& > svg,& > img{display:block;width:100%;max-width:32rem;height:auto;}"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space150);
10
+ //#endregion
11
+ exports.Media = Media;
@@ -0,0 +1 @@
1
+ export declare const Media: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import _styled from "styled-components";
2
+ import { useTheme } from "@redis-ui/styles";
3
+ //#region src/Hero/components/Media/Media.style.ts
4
+ var Media = _styled.div.withConfig({
5
+ displayName: "Mediastyle__Media",
6
+ componentId: "RedisUI__sc-1w3ogu0-0"
7
+ })(["display:grid;place-items:center;align-self:center;min-width:0;overflow:hidden;padding-inline:", ";& > svg,& > img{display:block;width:100%;max-width:32rem;height:auto;}"], () => useTheme().core.space.space150);
8
+ //#endregion
9
+ export { Media };
@@ -0,0 +1,10 @@
1
+ const require_Subtitle_style = require("./Subtitle.style.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ //#region src/Hero/components/Subtitle/Subtitle.tsx
4
+ var Subtitle = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Subtitle_style.Subtitle, {
5
+ size: "L",
6
+ color: "secondary",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ exports.default = Subtitle;
@@ -0,0 +1,3 @@
1
+ import { TypographyBodyProps } from '../../../Typography';
2
+ declare const Subtitle: (props: TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Subtitle;
@@ -0,0 +1,10 @@
1
+ import { Subtitle as Subtitle$1 } from "./Subtitle.style.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/Hero/components/Subtitle/Subtitle.tsx
4
+ var Subtitle = (props) => /* @__PURE__ */ jsx(Subtitle$1, {
5
+ size: "L",
6
+ color: "secondary",
7
+ ...props
8
+ });
9
+ //#endregion
10
+ export { Subtitle as default };
@@ -0,0 +1,11 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Typography = require("../../../Typography/Typography.cjs");
3
+ let styled_components = require("styled-components");
4
+ styled_components = require_runtime.__toESM(styled_components, 1);
5
+ //#region src/Hero/components/Subtitle/Subtitle.style.ts
6
+ var Subtitle = (0, styled_components.default)(require_Typography.default.Body).withConfig({
7
+ displayName: "Subtitlestyle__Subtitle",
8
+ componentId: "RedisUI__sc-ivism3-0"
9
+ })(["margin-block:0;max-width:68ch;text-wrap:pretty;"]);
10
+ //#endregion
11
+ exports.Subtitle = Subtitle;
@@ -0,0 +1 @@
1
+ export declare const Subtitle: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../..").TypographyBodyProps & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import Typography from "../../../Typography/Typography.js";
2
+ import _styled from "styled-components";
3
+ //#region src/Hero/components/Subtitle/Subtitle.style.ts
4
+ var Subtitle = _styled(Typography.Body).withConfig({
5
+ displayName: "Subtitlestyle__Subtitle",
6
+ componentId: "RedisUI__sc-ivism3-0"
7
+ })(["margin-block:0;max-width:68ch;text-wrap:pretty;"]);
8
+ //#endregion
9
+ export { Subtitle };
@@ -0,0 +1,2 @@
1
+ export { default as Hero } from './Hero';
2
+ export * from './Hero.types';
@@ -0,0 +1,2 @@
1
+ export { default as Hero } from './Hero';
2
+ export * from './Hero.types';
@@ -12,11 +12,12 @@ const require_Header = require("./components/Header/Header.cjs");
12
12
  const require_ScrollContainer = require("./components/ScrollContainer/ScrollContainer.cjs");
13
13
  const require_Footer = require("./components/Footer/Footer.cjs");
14
14
  const require_Group = require("./components/Group/Group.cjs");
15
+ const require_CollapseButton = require("./components/CollapseButton/CollapseButton.cjs");
15
16
  let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
16
17
  let react_jsx_runtime = require("react/jsx-runtime");
17
18
  let react = require("react");
18
19
  //#region src/SideBar/SideBar.tsx
19
- var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
20
+ var SideBar = Object.assign(({ isExpanded, expandedWidth, showActiveIndicator = true, ...rest }) => {
20
21
  const [transitionEnd, setTransitionEnd] = (0, react.useState)(true);
21
22
  const prefersReducedMotion = (0, _redislabsdev_redis_ui_styles.usePrefersReducedMotion)();
22
23
  const sidebarId = require_index.useId();
@@ -28,6 +29,7 @@ var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
28
29
  transitionEnd,
29
30
  handleTransitionChange,
30
31
  isExpanded,
32
+ showActiveIndicator,
31
33
  sidebarId
32
34
  },
33
35
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Provider.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SideBar_style.SideBarContainer, {
@@ -53,7 +55,8 @@ var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
53
55
  Button: require_Button.default,
54
56
  Header: require_Header.default,
55
57
  Footer: require_Footer.default,
56
- Group: require_Group.default
58
+ Group: require_Group.default,
59
+ CollapseButton: require_CollapseButton.default
57
60
  });
58
61
  //#endregion
59
62
  exports.default = SideBar;
@@ -1,5 +1,5 @@
1
1
  import { SideBarProps } from './SideBar.types';
2
- declare const SideBar: (({ isExpanded, expandedWidth, ...rest }: SideBarProps) => import("react/jsx-runtime").JSX.Element) & {
2
+ declare const SideBar: (({ isExpanded, expandedWidth, showActiveIndicator, ...rest }: SideBarProps) => import("react/jsx-runtime").JSX.Element) & {
3
3
  SideBarLogo: ({ logoIcon: LogoIcon, ...restProps }: import("./components/SideBarLogo/SideBarLogo.types").SideBarLogoProps) => import("react/jsx-runtime").JSX.Element;
4
4
  ItemsContainer: (props: import("./components/ItemsContainer/ItemsContainer.types").SideBarItemsContainerProps) => import("react/jsx-runtime").JSX.Element;
5
5
  ScrollContainer: (props: import("./components/ScrollContainer/ScrollContainer.types").SideBarScrollContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -21,5 +21,6 @@ declare const SideBar: (({ isExpanded, expandedWidth, ...rest }: SideBarProps) =
21
21
  Group: ((props: import("./components/Group/Group.types").SideBarGroupProps) => import("react/jsx-runtime").JSX.Element) & {
22
22
  Title: ({ children, ...rest }: import("./components/Group/components/Title/Title.types").SideBarGroupTitleProps) => import("react/jsx-runtime").JSX.Element;
23
23
  };
24
+ CollapseButton: ({ onToggle, icon, collapseText, expandText, ...rest }: import("./components/CollapseButton/CollapseButton.types").SideBarCollapseButtonProps) => import("react/jsx-runtime").JSX.Element;
24
25
  };
25
26
  export default SideBar;
@@ -12,11 +12,12 @@ import Header from "./components/Header/Header.js";
12
12
  import ScrollContainer from "./components/ScrollContainer/ScrollContainer.js";
13
13
  import Footer from "./components/Footer/Footer.js";
14
14
  import Group from "./components/Group/Group.js";
15
+ import CollapseButton from "./components/CollapseButton/CollapseButton.js";
15
16
  import { usePrefersReducedMotion } from "@redis-ui/styles";
16
17
  import { jsx } from "react/jsx-runtime";
17
18
  import { useState } from "react";
18
19
  //#region src/SideBar/SideBar.tsx
19
- var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
20
+ var SideBar = Object.assign(({ isExpanded, expandedWidth, showActiveIndicator = true, ...rest }) => {
20
21
  const [transitionEnd, setTransitionEnd] = useState(true);
21
22
  const prefersReducedMotion = usePrefersReducedMotion();
22
23
  const sidebarId = useId();
@@ -28,6 +29,7 @@ var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
28
29
  transitionEnd,
29
30
  handleTransitionChange,
30
31
  isExpanded,
32
+ showActiveIndicator,
31
33
  sidebarId
32
34
  },
33
35
  children: /* @__PURE__ */ jsx(Provider, { children: /* @__PURE__ */ jsx(SideBarContainer, {
@@ -53,7 +55,8 @@ var SideBar = Object.assign(({ isExpanded, expandedWidth, ...rest }) => {
53
55
  Button,
54
56
  Header,
55
57
  Footer,
56
- Group
58
+ Group,
59
+ CollapseButton
57
60
  });
58
61
  //#endregion
59
62
  export { SideBar as default };
@@ -3,9 +3,12 @@ import { FlexGroupProps } from '../Layouts';
3
3
  export interface SideBarProps extends Omit<FlexGroupProps, 'direction'> {
4
4
  isExpanded: boolean;
5
5
  expandedWidth?: string;
6
+ /** Shows the line next to the active item. The active item keeps its background either way. */
7
+ showActiveIndicator?: boolean;
6
8
  }
7
9
  export interface SideBarContextProps {
8
10
  isExpanded: boolean;
11
+ showActiveIndicator: boolean;
9
12
  transitionEnd: boolean;
10
13
  handleTransitionChange: (end: boolean) => void;
11
14
  sidebarId: string;
@@ -0,0 +1,32 @@
1
+ const require_Tooltip = require("../../../Tooltip/Tooltip.cjs");
2
+ const require_ScreenReaderAnnounce = require("../../../ScreenReaderAnnounce/ScreenReaderAnnounce.cjs");
3
+ const require_SideBar_context = require("../../SideBar.context.cjs");
4
+ const require_Icon = require("../Item/components/Icon/Icon.cjs");
5
+ const require_Text = require("../Item/components/Text/Text.cjs");
6
+ const require_Item_style = require("../Item/Item.style.cjs");
7
+ const require_CollapseButton_style = require("./CollapseButton.style.cjs");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ //#region src/SideBar/components/CollapseButton/CollapseButton.tsx
10
+ var CollapseButton = ({ onToggle, icon, collapseText = "Collapse", expandText = "Expand sidebar", ...rest }) => {
11
+ const { isExpanded, handleTransitionChange, sidebarId } = require_SideBar_context.useSideBarContext();
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_CollapseButton_style.Container, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.default, {
13
+ placement: "right",
14
+ disabled: isExpanded,
15
+ content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Item_style.TooltipContent, { children: expandText }),
16
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_CollapseButton_style.CollapseButton, {
17
+ as: "button",
18
+ type: "button",
19
+ "aria-label": isExpanded ? void 0 : expandText,
20
+ "aria-controls": sidebarId,
21
+ "aria-expanded": isExpanded,
22
+ ...rest,
23
+ onClick: () => {
24
+ handleTransitionChange(false);
25
+ onToggle();
26
+ },
27
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.default, { icon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.default, { children: collapseText })]
28
+ })
29
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenReaderAnnounce.ScreenReaderAnnounce, { text: isExpanded ? "Sidebar expanded" : "Sidebar collapsed" })] });
30
+ };
31
+ //#endregion
32
+ exports.default = CollapseButton;
@@ -0,0 +1,3 @@
1
+ import { SideBarCollapseButtonProps } from './CollapseButton.types';
2
+ declare const CollapseButton: ({ onToggle, icon, collapseText, expandText, ...rest }: SideBarCollapseButtonProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default CollapseButton;
@@ -0,0 +1,32 @@
1
+ import Tooltip from "../../../Tooltip/Tooltip.js";
2
+ import { ScreenReaderAnnounce } from "../../../ScreenReaderAnnounce/ScreenReaderAnnounce.js";
3
+ import { useSideBarContext } from "../../SideBar.context.js";
4
+ import Icon from "../Item/components/Icon/Icon.js";
5
+ import Text from "../Item/components/Text/Text.js";
6
+ import { TooltipContent } from "../Item/Item.style.js";
7
+ import { CollapseButton as CollapseButton$1, Container } from "./CollapseButton.style.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/SideBar/components/CollapseButton/CollapseButton.tsx
10
+ var CollapseButton = ({ onToggle, icon, collapseText = "Collapse", expandText = "Expand sidebar", ...rest }) => {
11
+ const { isExpanded, handleTransitionChange, sidebarId } = useSideBarContext();
12
+ return /* @__PURE__ */ jsxs(Container, { children: [/* @__PURE__ */ jsx(Tooltip, {
13
+ placement: "right",
14
+ disabled: isExpanded,
15
+ content: /* @__PURE__ */ jsx(TooltipContent, { children: expandText }),
16
+ children: /* @__PURE__ */ jsxs(CollapseButton$1, {
17
+ as: "button",
18
+ type: "button",
19
+ "aria-label": isExpanded ? void 0 : expandText,
20
+ "aria-controls": sidebarId,
21
+ "aria-expanded": isExpanded,
22
+ ...rest,
23
+ onClick: () => {
24
+ handleTransitionChange(false);
25
+ onToggle();
26
+ },
27
+ children: [/* @__PURE__ */ jsx(Icon, { icon }), /* @__PURE__ */ jsx(Text, { children: collapseText })]
28
+ })
29
+ }), /* @__PURE__ */ jsx(ScreenReaderAnnounce, { text: isExpanded ? "Sidebar expanded" : "Sidebar collapsed" })] });
30
+ };
31
+ //#endregion
32
+ export { CollapseButton as default };
@@ -0,0 +1,16 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Item_style = require("../Item/Item.style.cjs");
3
+ let styled_components = require("styled-components");
4
+ styled_components = require_runtime.__toESM(styled_components, 1);
5
+ //#region src/SideBar/components/CollapseButton/CollapseButton.style.ts
6
+ var Container = styled_components.default.div.withConfig({
7
+ displayName: "CollapseButtonstyle__Container",
8
+ componentId: "RedisUI__sc-1ukbtbz-0"
9
+ })(["display:flex;flex-direction:column;flex:none;"]);
10
+ var CollapseButton = (0, styled_components.default)(require_Item_style.SideBarItem).withConfig({
11
+ displayName: "CollapseButtonstyle__CollapseButton",
12
+ componentId: "RedisUI__sc-1ukbtbz-1"
13
+ })(["border:0;font:inherit;text-align:start;"]);
14
+ //#endregion
15
+ exports.CollapseButton = CollapseButton;
16
+ exports.Container = Container;
@@ -0,0 +1,4 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const CollapseButton: import("styled-components").StyledComponent<"li", any, {
3
+ $hasActiveIndicator?: boolean;
4
+ }, never>;
@@ -0,0 +1,13 @@
1
+ import { SideBarItem } from "../Item/Item.style.js";
2
+ import _styled from "styled-components";
3
+ //#region src/SideBar/components/CollapseButton/CollapseButton.style.ts
4
+ var Container = _styled.div.withConfig({
5
+ displayName: "CollapseButtonstyle__Container",
6
+ componentId: "RedisUI__sc-1ukbtbz-0"
7
+ })(["display:flex;flex-direction:column;flex:none;"]);
8
+ var CollapseButton = _styled(SideBarItem).withConfig({
9
+ displayName: "CollapseButtonstyle__CollapseButton",
10
+ componentId: "RedisUI__sc-1ukbtbz-1"
11
+ })(["border:0;font:inherit;text-align:start;"]);
12
+ //#endregion
13
+ export { CollapseButton, Container };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IconType } from '@redis-ui/icons';
3
+ export interface SideBarCollapseButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
4
+ onToggle: () => void;
5
+ icon: IconType;
6
+ collapseText?: string;
7
+ expandText?: string;
8
+ }
@@ -10,7 +10,7 @@ let react = require("react");
10
10
  //#region src/SideBar/components/Item/Item.tsx
11
11
  var Item = Object.assign(({ tooltipProps, isActive = false, onKeyDown, ...restProps }) => {
12
12
  const itemRef = (0, react.useRef)(null);
13
- const { isExpanded } = require_SideBar_context.useSideBarContext();
13
+ const { isExpanded, showActiveIndicator } = require_SideBar_context.useSideBarContext();
14
14
  const activeLinkAttributes = isActive ? {
15
15
  "data-state": "active",
16
16
  "aria-current": "page"
@@ -29,7 +29,8 @@ var Item = Object.assign(({ tooltipProps, isActive = false, onKeyDown, ...restPr
29
29
  ...activeLinkAttributes,
30
30
  tabIndex,
31
31
  onKeyDown: handleKeyDown,
32
- ref: itemRef
32
+ ref: itemRef,
33
+ $hasActiveIndicator: showActiveIndicator
33
34
  });
34
35
  return isExpanded ? item : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.default, {
35
36
  ...tooltipProps,
@@ -10,7 +10,7 @@ import { useRef } from "react";
10
10
  //#region src/SideBar/components/Item/Item.tsx
11
11
  var Item = Object.assign(({ tooltipProps, isActive = false, onKeyDown, ...restProps }) => {
12
12
  const itemRef = useRef(null);
13
- const { isExpanded } = useSideBarContext();
13
+ const { isExpanded, showActiveIndicator } = useSideBarContext();
14
14
  const activeLinkAttributes = isActive ? {
15
15
  "data-state": "active",
16
16
  "aria-current": "page"
@@ -29,7 +29,8 @@ var Item = Object.assign(({ tooltipProps, isActive = false, onKeyDown, ...restPr
29
29
  ...activeLinkAttributes,
30
30
  tabIndex,
31
31
  onKeyDown: handleKeyDown,
32
- ref: itemRef
32
+ ref: itemRef,
33
+ $hasActiveIndicator: showActiveIndicator
33
34
  });
34
35
  return isExpanded ? item : /* @__PURE__ */ jsx(Tooltip, {
35
36
  ...tooltipProps,
@@ -17,7 +17,7 @@ var SideBarItem = styled_components.default.li.withConfig({
17
17
  ";outline-offset:-",
18
18
  ";}",
19
19
  ";& > svg{transition:inherit;}"
20
- ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.size, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.color, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.size, () => {
20
+ ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.size, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.color, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.focus.size, ({ $hasActiveIndicator = true }) => {
21
21
  return require_SideBar_utils.useStateStyle(({ item: theme }, state) => {
22
22
  const { states } = theme;
23
23
  return styled_components.css`
@@ -55,16 +55,18 @@ var SideBarItem = styled_components.default.li.withConfig({
55
55
  })}
56
56
  }
57
57
 
58
- &[data-state='active']::before {
59
- content: '';
60
- position: absolute;
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};
65
- background-color: ${theme.activeIndicator.bgColor};
66
- border-radius: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
67
- }
58
+ ${$hasActiveIndicator && styled_components.css`
59
+ &[data-state='active']::before {
60
+ content: '';
61
+ position: absolute;
62
+ left: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.left};
63
+ top: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.top};
64
+ bottom: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.bottom};
65
+ width: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.width};
66
+ background-color: ${theme.activeIndicator.bgColor};
67
+ border-radius: ${require_SideBar_constants.SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
68
+ }
69
+ `}
68
70
  `;
69
71
  });
70
72
  });
@@ -1,2 +1,4 @@
1
- export declare const SideBarItem: import("styled-components").StyledComponent<"li", any, {}, never>;
1
+ export declare const SideBarItem: import("styled-components").StyledComponent<"li", any, {
2
+ $hasActiveIndicator?: boolean;
3
+ }, never>;
2
4
  export declare const TooltipContent: import("styled-components").StyledComponent<(props: import("../../..").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
@@ -15,7 +15,7 @@ var SideBarItem = _styled.li.withConfig({
15
15
  ";outline-offset:-",
16
16
  ";}",
17
17
  ";& > svg{transition:inherit;}"
18
- ], () => useTheme().core.focus.size, () => useTheme().core.focus.color, () => useTheme().core.focus.size, () => {
18
+ ], () => useTheme().core.focus.size, () => useTheme().core.focus.color, () => useTheme().core.focus.size, ({ $hasActiveIndicator = true }) => {
19
19
  return useStateStyle(({ item: theme }, state) => {
20
20
  const { states } = theme;
21
21
  return css`
@@ -53,16 +53,18 @@ var SideBarItem = _styled.li.withConfig({
53
53
  })}
54
54
  }
55
55
 
56
- &[data-state='active']::before {
57
- content: '';
58
- position: absolute;
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};
63
- background-color: ${theme.activeIndicator.bgColor};
64
- border-radius: ${SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
65
- }
56
+ ${$hasActiveIndicator && css`
57
+ &[data-state='active']::before {
58
+ content: '';
59
+ position: absolute;
60
+ left: ${SIDEBAR_CONSTANTS.item.activeIndicator.left};
61
+ top: ${SIDEBAR_CONSTANTS.item.activeIndicator.top};
62
+ bottom: ${SIDEBAR_CONSTANTS.item.activeIndicator.bottom};
63
+ width: ${SIDEBAR_CONSTANTS.item.activeIndicator.width};
64
+ background-color: ${theme.activeIndicator.bgColor};
65
+ border-radius: ${SIDEBAR_CONSTANTS.item.activeIndicator.borderRadius};
66
+ }
67
+ `}
66
68
  `;
67
69
  });
68
70
  });
package/dist/index.cjs CHANGED
@@ -74,15 +74,16 @@ const require_Drawer = require("./Drawer/Drawer.cjs");
74
74
  const require_TreeView = require("./TreeView/TreeView.cjs");
75
75
  const require_Filters = require("./Filters/Filters.cjs");
76
76
  const require_Gauge = require("./Gauge/Gauge.cjs");
77
- const require_HighlightedIcon_style = require("./HighlightedIcon/HighlightedIcon.style.cjs");
78
- const require_HighlightedIcon = require("./HighlightedIcon/HighlightedIcon.cjs");
79
- const require_KeyValueList = require("./KeyValueList/KeyValueList.cjs");
80
- const require_useKeyValueList = require("./KeyValueList/hooks/useKeyValueList.cjs");
81
77
  const require_FlexItem = require("./Layouts/FlexItem/FlexItem.cjs");
82
78
  const require_FlexGroup = require("./Layouts/FlexGroup/FlexGroup.cjs");
83
79
  const require_Grid = require("./Layouts/Grid/Grid.cjs");
84
80
  const require_FlexSplit = require("./Layouts/FlexSplit/FlexSplit.cjs");
85
81
  const require_FlexDivider = require("./Layouts/FlexDivider/FlexDivider.cjs");
82
+ const require_Hero = require("./Hero/Hero.cjs");
83
+ const require_HighlightedIcon_style = require("./HighlightedIcon/HighlightedIcon.style.cjs");
84
+ const require_HighlightedIcon = require("./HighlightedIcon/HighlightedIcon.cjs");
85
+ const require_KeyValueList = require("./KeyValueList/KeyValueList.cjs");
86
+ const require_useKeyValueList = require("./KeyValueList/hooks/useKeyValueList.cjs");
86
87
  const require_Tabs = require("./Tabs/Tabs.cjs");
87
88
  const require_MidBar = require("./MidBar/MidBar.cjs");
88
89
  const require_Modal = require("./Modal/Modal.cjs");
@@ -183,6 +184,7 @@ exports.FlexSplit = require_FlexSplit.FlexSplit;
183
184
  exports.FormField = require_FormField.default;
184
185
  exports.Gauge = require_Gauge.Gauge;
185
186
  exports.Grid = require_Grid.Grid;
187
+ exports.Hero = require_Hero.default;
186
188
  exports.HighlightedIcon = require_HighlightedIcon.default;
187
189
  Object.defineProperty(exports, "HighlightedIconStyles", {
188
190
  enumerable: true,
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './Drawer';
16
16
  export * from './Filters';
17
17
  export * from './Gauge';
18
18
  export * from './Helpers';
19
+ export * from './Hero';
19
20
  export * from './HighlightedIcon';
20
21
  export * from './Inputs';
21
22
  export * from './FormField';
package/dist/index.js CHANGED
@@ -74,15 +74,16 @@ import Drawer from "./Drawer/Drawer.js";
74
74
  import TreeView from "./TreeView/TreeView.js";
75
75
  import Filters from "./Filters/Filters.js";
76
76
  import { Gauge } from "./Gauge/Gauge.js";
77
- import { HighlightedIcon_style_exports } from "./HighlightedIcon/HighlightedIcon.style.js";
78
- import HighlightedIcon from "./HighlightedIcon/HighlightedIcon.js";
79
- import { KeyValueList } from "./KeyValueList/KeyValueList.js";
80
- import { useKeyValueList } from "./KeyValueList/hooks/useKeyValueList.js";
81
77
  import { FlexItem } from "./Layouts/FlexItem/FlexItem.js";
82
78
  import { FlexGroup } from "./Layouts/FlexGroup/FlexGroup.js";
83
79
  import { Grid } from "./Layouts/Grid/Grid.js";
84
80
  import { FlexSplit } from "./Layouts/FlexSplit/FlexSplit.js";
85
81
  import { FlexDivider } from "./Layouts/FlexDivider/FlexDivider.js";
82
+ import Hero from "./Hero/Hero.js";
83
+ import { HighlightedIcon_style_exports } from "./HighlightedIcon/HighlightedIcon.style.js";
84
+ import HighlightedIcon from "./HighlightedIcon/HighlightedIcon.js";
85
+ import { KeyValueList } from "./KeyValueList/KeyValueList.js";
86
+ import { useKeyValueList } from "./KeyValueList/hooks/useKeyValueList.js";
86
87
  import Tabs from "./Tabs/Tabs.js";
87
88
  import MidBar from "./MidBar/MidBar.js";
88
89
  import Modal from "./Modal/Modal.js";
@@ -113,4 +114,4 @@ import { ProgressBar } from "./ProgressBar/ProgressBar.js";
113
114
  import { ProfileIcon_style_exports } from "./ProfileIcon/ProfileIcon.style.js";
114
115
  import ProfileIcon from "./ProfileIcon/ProfileIcon.js";
115
116
  import Slider from "./Slider/Slider.js";
116
- 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, Gauge, Grid, 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 };
117
+ 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, Gauge, Grid, Hero, 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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redis-ui/components",
3
3
  "license": "UNLICENSED",
4
- "version": "51.4.0",
4
+ "version": "51.6.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -82,6 +82,7 @@ Always check the relevant component reference before using a component. The refe
82
82
  - [FlexSplit](./references/FlexSplit.md)
83
83
  - [Card](./references/Card.md)
84
84
  - [Section](./references/Section.md)
85
+ - [Hero](./references/Hero.md)
85
86
  - [Breadcrumbs](./references/Breadcrumbs.md)
86
87
 
87
88
  ### Navigation
@@ -0,0 +1,157 @@
1
+ # Hero
2
+
3
+ The page-opening hero for Ultra empty states and landing pages: copy (heading, subtitle, actions) on the leading side and an illustration on the trailing side, with no surrounding card. Follows the `Banner`/`Section` compound pattern — a prop-driven convenience root plus exposed sub-parts (`Hero.Compose` + slots) for full control.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ Hero,
10
+ Badge,
11
+ Button,
12
+ FlexGroup,
13
+ FlexItem,
14
+ TextButton,
15
+ Typography
16
+ } from '@redis-ui/components';
17
+ import { CheckThinIcon } from '@redis-ui/icons';
18
+ ```
19
+
20
+ ## Props
21
+
22
+ Convenience root props. `Hero` also spreads standard `HTMLElement` attributes (`className`, `style`, `id`, `data-*`, event handlers, etc.) onto the container; `children` and `content` are not part of the API.
23
+
24
+ | Prop | Type | Default | Description |
25
+ |------|------|---------|-------------|
26
+ | `heading` | `ReactNode` | — (required) | The main claim. Rendered as the page's `h1`. |
27
+ | `subtitle` | `ReactNode` | — | Supporting copy below the heading. |
28
+ | `details` | `ReactNode` | — | Extra content right above the actions, e.g. highlight rows or a row of logos. |
29
+ | `actions` | `ReactNode` | — | Call-to-action row below the copy. Takes any mix of buttons, e.g. a primary `Button`, a `secondary-fill` `Button`, and a `TextButton` for a link-style action. |
30
+ | `footnote` | `ReactNode` | — | Small note below the actions. |
31
+ | `media` | `ReactNode` | — | Illustration (svg/img) in the trailing column. |
32
+
33
+ Every slot except `heading` is optional. A slot is skipped when its value is `null`, `undefined`, `false`, an empty string, or an array with nothing renderable (e.g. `items.map(...)` over an empty list); numeric `0` still renders.
34
+
35
+ ## Sub-components
36
+
37
+ `Hero` is assembled with `Object.assign`; drop to these for full control. Each part spreads its own props, so any single slot can be restyled or rearranged.
38
+
39
+ - `Hero.Compose` - the two-column container: copy on the leading side, media on the trailing side, stacking on narrow viewports.
40
+ - `Hero.Content` - the copy column. It spaces its children apart: wrap the heading and subtitle in one column `FlexGroup` and the details, actions and footnote in another, as the root does.
41
+ - `Hero.Heading` - the main claim (`h1` by default; pass `component` to change the level; wraps `Typography.Heading`).
42
+ - `Hero.Subtitle` - supporting copy (wraps `Typography.Body`).
43
+ - `Hero.Actions` - the call-to-action row.
44
+ - `Hero.Footnote` - small note below the actions (wraps `Typography.Body`).
45
+ - `Hero.Media` - the trailing illustration column; a direct `svg`/`img` child fills the column up to a capped width.
46
+
47
+ ## Examples
48
+
49
+ ### Basic Usage
50
+
51
+ ```tsx
52
+ <Hero
53
+ heading="Live business data your agents can navigate."
54
+ subtitle="Model your entities, fields and relationships once. Agents follow defined paths through your data instead of guessing at SQL, and every call stays governed."
55
+ actions={
56
+ <>
57
+ <Button variant="primary">Create Context Gateway service</Button>
58
+ <TextButton variant="secondary">Read the docs</TextButton>
59
+ </>
60
+ }
61
+ media={<HeroArt />}
62
+ />
63
+ ```
64
+
65
+ ### WithoutMedia
66
+
67
+ > Without `media`, the copy keeps its column and the trailing column stays empty.
68
+
69
+ ```tsx
70
+ <Hero
71
+ heading="Projects group your databases and services."
72
+ subtitle="Create a project to keep environments, access, and billing in one place."
73
+ actions={<Button variant="primary">Create project</Button>}
74
+ />
75
+ ```
76
+
77
+ ### WithDetails
78
+
79
+ > `details` sits right above the actions, e.g. for highlight rows or a row of logos.
80
+
81
+ ```tsx
82
+ <Hero
83
+ heading="Redis, tuned for hot data."
84
+ subtitle="A Cache database keeps your working set in memory and answers in under a millisecond."
85
+ details={
86
+ <FlexGroup direction="column" gap="S">
87
+ {['Sub-millisecond reads at any scale', 'Evicts cold keys as new ones arrive'].map(
88
+ (highlight) => (
89
+ <FlexGroup key={highlight} gap="S" align="center">
90
+ <CheckThinIcon size="M" />
91
+ <Typography.Body color="secondary">{highlight}</Typography.Body>
92
+ </FlexGroup>
93
+ )
94
+ )}
95
+ </FlexGroup>
96
+ }
97
+ actions={<Button variant="primary">Create Cache database</Button>}
98
+ media={<HeroArt />}
99
+ />
100
+ ```
101
+
102
+ ### WithFootnote
103
+
104
+ > `actions` takes any mix of buttons; `footnote` adds a small note below them.
105
+
106
+ ```tsx
107
+ <Hero
108
+ heading="One network, many databases."
109
+ subtitle="A network is a cloud, a region and a CIDR block. Databases in the same network share VPC peering, so you configure it once."
110
+ actions={
111
+ <>
112
+ <Button variant="primary">Create database</Button>
113
+ <Button variant="secondary-fill">Create network</Button>
114
+ </>
115
+ }
116
+ footnote="Creating a database sets up its network for you. Create a network first if you want to configure peering ahead of time."
117
+ media={<HeroArt />}
118
+ />
119
+ ```
120
+
121
+ ### Composition
122
+
123
+ > Drop to `Hero.Compose` to change the layout of a slot, e.g. to put a badge next to the heading. Keep the badge outside `Hero.Heading` so the `h1` stays valid markup.
124
+
125
+ ```tsx
126
+ <Hero.Compose>
127
+ <Hero.Content>
128
+ <FlexGroup direction="column" align="start" gap="M">
129
+ <FlexGroup gap="M" align="center">
130
+ <Hero.Heading>Databases</Hero.Heading>
131
+ <FlexItem flex="none">
132
+ <Badge label="Coming soon" />
133
+ </FlexItem>
134
+ </FlexGroup>
135
+ <Hero.Subtitle>
136
+ Start with a cache, grow into a primary database and streaming engine, with no migration
137
+ and no new tools.
138
+ </Hero.Subtitle>
139
+ </FlexGroup>
140
+ <Hero.Actions>
141
+ <Button variant="primary">Create database</Button>
142
+ </Hero.Actions>
143
+ </Hero.Content>
144
+ <Hero.Media>
145
+ <HeroArt />
146
+ </Hero.Media>
147
+ </Hero.Compose>
148
+ ```
149
+
150
+ `HeroArt` in these examples is a story-local placeholder `svg`.
151
+
152
+ ## Notes
153
+
154
+ - Use the prop-driven `<Hero>` for the standard layout; drop to `Hero.Compose` + parts only to change the layout inside a slot.
155
+ - The heading is the page's `h1`. Pages that already have an `h1` can use `Hero.Heading component="h2"` through composition.
156
+ - Badges or tags next to the heading go beside `Hero.Heading` (see Composition), not inside it.
157
+ - Any animation in the illustration belongs to the consumer's artwork, including its `prefers-reduced-motion` handling.
@@ -14,6 +14,7 @@ import { SideBar } from '@redis-ui/components';
14
14
  |------|------|---------|-------------|
15
15
  | isExpanded | `boolean` | *required* | Controls whether the sidebar is expanded or collapsed |
16
16
  | expandedWidth | `string` | design-system default | Overrides the sidebar width when expanded |
17
+ | showActiveIndicator | `boolean` | `true` | Shows the line next to the active item. The active item keeps its background either way |
17
18
 
18
19
  The component also accepts all `FlexGroupProps` except `direction`, which is fixed to a vertical sidebar layout.
19
20
 
@@ -37,6 +38,7 @@ The component also accepts all `FlexGroupProps` except `direction`, which is fix
37
38
  - `SideBar.Footer.MetaData` - Footer metadata container.
38
39
  - `SideBar.Footer.Link` - Footer link rendered as body text.
39
40
  - `SideBar.Footer.Text` - Small footer text.
41
+ - `SideBar.CollapseButton` - Full-width expand/collapse toggle styled like an item, for use in the footer instead of `SideBar.Header`.
40
42
 
41
43
  ### SideBar.Header Props
42
44
 
@@ -123,6 +125,17 @@ The group title also accepts standard `HTMLAttributes<HTMLDivElement>` except `c
123
125
  The root button also inherits all `ButtonProps` from the base `Button` component.
124
126
  The tooltip text is used as the collapsed label and tooltip placement defaults to `right`.
125
127
 
128
+ ### SideBar.CollapseButton Props
129
+
130
+ | Prop | Type | Default | Description |
131
+ |------|------|---------|-------------|
132
+ | onToggle | `() => void` | *required* | Called when the button is pressed |
133
+ | icon | `IconType` | *required* | Icon shown in both states, typically `PanelLeftIcon` (requires `@redis-ui/icons` 10.3.0 or later) |
134
+ | collapseText | `string` | `'Collapse'` | Label shown while the sidebar is expanded |
135
+ | expandText | `string` | `'Expand sidebar'` | Accessible name and tooltip while the sidebar is collapsed |
136
+
137
+ The button also accepts standard `ButtonHTMLAttributes<HTMLButtonElement>` except `onClick`.
138
+
126
139
  ### SideBar.Footer Props
127
140
 
128
141
  This footer wrapper inherits `ComposeElementProps`.
@@ -329,6 +342,53 @@ const [activeLink, setActiveLink] = useState(groups[0].items[0].content);
329
342
  </SideBar>
330
343
  ```
331
344
 
345
+ ### CollapseButtonAtBottom
346
+
347
+ > Without `SideBar.Header`, `SideBar.CollapseButton` in the footer takes over the expand/collapse toggle.
348
+ > `showActiveIndicator={false}` drops the line next to the active item and keeps its background.
349
+
350
+ ```tsx
351
+ import { SideBar } from '@redis-ui/components';
352
+ import { PanelLeftIcon } from '@redis-ui/icons';
353
+ import { useState } from 'react';
354
+ import { groups } from './SideBar.data';
355
+
356
+ const [expanded, setExpanded] = useState(true);
357
+ const [activeLink, setActiveLink] = useState(groups[0].items[0].content);
358
+
359
+ <SideBar
360
+ isExpanded={expanded}
361
+ expandedWidth="24rem"
362
+ showActiveIndicator={false}
363
+ style={{ paddingTop: '1rem' }}
364
+ >
365
+ <SideBar.ScrollContainer>
366
+ {groups.map((group, groupIdx) => (
367
+ <SideBar.Group key={group.title ?? `group-${groupIdx}`}>
368
+ {group.title && <SideBar.Group.Title>{group.title}</SideBar.Group.Title>}
369
+ <SideBar.ItemsContainer>
370
+ {group.items.map((item) => (
371
+ <SideBar.Item
372
+ isActive={item.content === activeLink}
373
+ onClick={() => setActiveLink(item.content)}
374
+ key={item.content}
375
+ tooltipProps={{ text: item.content, placement: 'right' }}
376
+ >
377
+ <SideBar.Item.Icon icon={item.icon} />
378
+ <SideBar.Item.Text>{item.content}</SideBar.Item.Text>
379
+ </SideBar.Item>
380
+ ))}
381
+ </SideBar.ItemsContainer>
382
+ </SideBar.Group>
383
+ ))}
384
+ </SideBar.ScrollContainer>
385
+ <SideBar.Footer>
386
+ <SideBar.Divider fullWidth noMargin />
387
+ <SideBar.CollapseButton icon={PanelLeftIcon} onToggle={() => setExpanded(!expanded)} />
388
+ </SideBar.Footer>
389
+ </SideBar>
390
+ ```
391
+
332
392
  ### HeaderAndFooter
333
393
 
334
394
  > `Header` includes toggle button and. Set `onToggle` handler to switch expanded state.